#include "beecrypt/api.h"
#include "beecrypt/memchunk.h"
#include "beecrypt/mpnumber.h"


Go to the source code of this file.
Data Structures | |
| struct | entropySource |
| This struct holds information and pointers to code specific to each source of entropy. More... | |
| struct | randomGenerator |
| This struct holds information and pointers to code specific to each pseudo-random number generator. More... | |
| struct | randomGeneratorContext |
| struct | hashFunction |
| struct | hashFunctionContext |
| struct | keyedHashFunction |
| struct | keyedHashFunctionContext |
| struct | blockCipherRaw |
| struct | blockCipherMode |
| struct | blockCipher |
| Holds information and pointers to code specific to each cipher. More... | |
| struct | blockCipherContext |
| Holds a pointer to a blockcipher as well as its parameters. More... | |
Typedefs | |
| typedef int(* | entropyNext )(byte *, size_t) |
| Prototype definition for an entropy-generating function. | |
| typedef void | randomGeneratorParam |
| typedef int(* | randomGeneratorSetup )(randomGeneratorParam *) |
| typedef int(* | randomGeneratorSeed )(randomGeneratorParam *, const byte *, size_t) |
| typedef int(* | randomGeneratorNext )(randomGeneratorParam *, byte *, size_t) |
| typedef int(* | randomGeneratorCleanup )(randomGeneratorParam *) |
| typedef void | hashFunctionParam |
| typedef int(* | hashFunctionReset )(hashFunctionParam *) |
| typedef int(* | hashFunctionUpdate )(hashFunctionParam *, const byte *, size_t) |
| typedef int(* | hashFunctionDigest )(hashFunctionParam *, byte *) |
| typedef void | keyedHashFunctionParam |
| typedef int(* | keyedHashFunctionSetup )(keyedHashFunctionParam *, const byte *, size_t) |
| typedef int(* | keyedHashFunctionReset )(keyedHashFunctionParam *) |
| typedef int(* | keyedHashFunctionUpdate )(keyedHashFunctionParam *, const byte *, size_t) |
| typedef int(* | keyedHashFunctionDigest )(keyedHashFunctionParam *, byte *) |
| typedef void | blockCipherParam |
| Placeholder type definition for blockcipher parameters. | |
| typedef int(* | blockCipherSetup )(blockCipherParam *, const byte *, size_t, cipherOperation) |
| Prototype definition for a setup function. | |
| typedef int(* | blockCipherSetIV )(blockCipherParam *, const byte *) |
| Prototype definition for an initialization vector setup function. | |
| typedef int(* | blockCipherSetCTR )(blockCipherParam *, const byte *, size_t) |
| Prototype definition for an initialization vector setup function. | |
| typedef int(* | blockCipherRawcrypt )(blockCipherParam *, uint32_t *, const uint32_t *) |
| Prototype for a raw encryption or decryption function. | |
| typedef int(* | blockCipherModcrypt )(blockCipherParam *, uint32_t *, const uint32_t *, unsigned int) |
| Prototype for a encryption or decryption function which operates on multiple blocks in a certain mode. | |
| typedef uint32_t *(* | blockCipherFeedback )(blockCipherParam *) |
Enumerations | |
| enum | cipherOperation { NOCRYPT, ENCRYPT, DECRYPT } |
| Specifies whether to perform encryption or decryption. More... | |
Functions | |
| BEECRYPTAPI int | entropySourceCount (void) |
| This function returns the number of entropy sources implemented by the library. | |
| BEECRYPTAPI const entropySource * | entropySourceGet (int n) |
| This function returns the n -th entropy source implemented by the library. | |
| BEECRYPTAPI const entropySource * | entropySourceFind (const char *name) |
| This function returns the entropy source specified by the given name. | |
| BEECRYPTAPI const entropySource * | entropySourceDefault (void) |
| This functions returns the default entropy source; the default value can be specified by setting environment variable BEECRYPT_ENTROPY. | |
| BEECRYPTAPI int | entropyGatherNext (byte *, size_t) |
| This function gathers size bytes of entropy into data. | |
| BEECRYPTAPI int | randomGeneratorCount (void) |
| BEECRYPTAPI const randomGenerator * | randomGeneratorGet (int) |
| BEECRYPTAPI const randomGenerator * | randomGeneratorFind (const char *) |
| BEECRYPTAPI const randomGenerator * | randomGeneratorDefault (void) |
| BEECRYPTAPI int | randomGeneratorContextInit (randomGeneratorContext *, const randomGenerator *) |
| BEECRYPTAPI int | randomGeneratorContextFree (randomGeneratorContext *) |
| BEECRYPTAPI int | randomGeneratorContextNext (randomGeneratorContext *, byte *, size_t) |
| BEECRYPTAPI int | randomGeneratorContextSeed (randomGeneratorContext *, const byte *, size_t) |
| BEECRYPTAPI int | hashFunctionCount (void) |
| BEECRYPTAPI const hashFunction * | hashFunctionGet (int) |
| BEECRYPTAPI const hashFunction * | hashFunctionFind (const char *) |
| BEECRYPTAPI const hashFunction * | hashFunctionDefault (void) |
| BEECRYPTAPI int | hashFunctionContextInit (hashFunctionContext *, const hashFunction *) |
| BEECRYPTAPI int | hashFunctionContextFree (hashFunctionContext *) |
| BEECRYPTAPI int | hashFunctionContextReset (hashFunctionContext *) |
| BEECRYPTAPI int | hashFunctionContextUpdate (hashFunctionContext *, const byte *, size_t) |
| BEECRYPTAPI int | hashFunctionContextUpdateMC (hashFunctionContext *, const memchunk *) |
| BEECRYPTAPI int | hashFunctionContextUpdateMP (hashFunctionContext *, const mpnumber *) |
| BEECRYPTAPI int | hashFunctionContextDigest (hashFunctionContext *, byte *) |
| BEECRYPTAPI int | hashFunctionContextDigestMP (hashFunctionContext *, mpnumber *) |
| BEECRYPTAPI int | hashFunctionContextDigestMatch (hashFunctionContext *, const mpnumber *) |
| BEECRYPTAPI int | keyedHashFunctionCount (void) |
| BEECRYPTAPI const keyedHashFunction * | keyedHashFunctionGet (int) |
| BEECRYPTAPI const keyedHashFunction * | keyedHashFunctionFind (const char *) |
| BEECRYPTAPI const keyedHashFunction * | keyedHashFunctionDefault (void) |
| BEECRYPTAPI int | keyedHashFunctionContextInit (keyedHashFunctionContext *, const keyedHashFunction *) |
| BEECRYPTAPI int | keyedHashFunctionContextFree (keyedHashFunctionContext *) |
| BEECRYPTAPI int | keyedHashFunctionContextSetup (keyedHashFunctionContext *, const byte *, size_t) |
| BEECRYPTAPI int | keyedHashFunctionContextReset (keyedHashFunctionContext *) |
| BEECRYPTAPI int | keyedHashFunctionContextUpdate (keyedHashFunctionContext *, const byte *, size_t) |
| BEECRYPTAPI int | keyedHashFunctionContextUpdateMC (keyedHashFunctionContext *, const memchunk *) |
| BEECRYPTAPI int | keyedHashFunctionContextUpdateMP (keyedHashFunctionContext *, const mpnumber *) |
| BEECRYPTAPI int | keyedHashFunctionContextDigest (keyedHashFunctionContext *, byte *) |
| BEECRYPTAPI int | keyedHashFunctionContextDigestMP (keyedHashFunctionContext *, mpnumber *) |
| BEECRYPTAPI int | keyedHashFunctionContextDigestMatch (keyedHashFunctionContext *, const mpnumber *) |
| BEECRYPTAPI int | blockCipherCount (void) |
| This function returns the number of blockciphers implemented by the library. | |
| BEECRYPTAPI const blockCipher * | blockCipherGet (int) |
| This function returns the n -th blockcipher implemented by the library. | |
| BEECRYPTAPI const blockCipher * | blockCipherFind (const char *) |
| This function returns the blockcipher specified by the given name. | |
| BEECRYPTAPI const blockCipher * | blockCipherDefault (void) |
| This functions returns the default blockcipher; the default value can be specified by setting environment variable BEECRYPT_CIPHER. | |
| BEECRYPTAPI int | blockCipherContextInit (blockCipherContext *, const blockCipher *) |
| BEECRYPTAPI int | blockCipherContextSetup (blockCipherContext *, const byte *, size_t, cipherOperation) |
| BEECRYPTAPI int | blockCipherContextSetIV (blockCipherContext *, const byte *) |
| BEECRYPTAPI int | blockCipherContextSetCTR (blockCipherContext *, const byte *, size_t) |
| BEECRYPTAPI int | blockCipherContextFree (blockCipherContext *) |
| BEECRYPTAPI int | blockCipherContextECB (blockCipherContext *, uint32_t *, const uint32_t *, int) |
| BEECRYPTAPI int | blockCipherContextCBC (blockCipherContext *, uint32_t *, const uint32_t *, int) |
| BEECRYPTAPI int | blockCipherContextCTR (blockCipherContext *, uint32_t *, const uint32_t *, int) |
| BEECRYPTAPI int | blockCipherContextValidKeylen (blockCipherContext *, size_t) |
These API functions provide an abstract way for using most of the various algorithms implemented by the library.
| typedef uint32_t*(* blockCipherFeedback)(blockCipherParam *) |
| typedef int(* hashFunctionDigest)(hashFunctionParam *, byte *) |
| typedef int(* hashFunctionReset)(hashFunctionParam *) |
| typedef int(* hashFunctionUpdate)(hashFunctionParam *, const byte *, size_t) |
| typedef int(* keyedHashFunctionDigest)(keyedHashFunctionParam *, byte *) |
| typedef int(* keyedHashFunctionReset)(keyedHashFunctionParam *) |
| typedef int(* keyedHashFunctionSetup)(keyedHashFunctionParam *, const byte *, size_t) |
| typedef int(* keyedHashFunctionUpdate)(keyedHashFunctionParam *, const byte *, size_t) |
| typedef int(* randomGeneratorCleanup)(randomGeneratorParam *) |
| typedef int(* randomGeneratorNext)(randomGeneratorParam *, byte *, size_t) |
| typedef void randomGeneratorParam |
| typedef int(* randomGeneratorSeed)(randomGeneratorParam *, const byte *, size_t) |
| typedef int(* randomGeneratorSetup)(randomGeneratorParam *) |
| BEECRYPTAPI int blockCipherContextCBC | ( | blockCipherContext * | , | |
| uint32_t * | , | |||
| const uint32_t * | , | |||
| int | ||||
| ) |
| BEECRYPTAPI int blockCipherContextCTR | ( | blockCipherContext * | , | |
| uint32_t * | , | |||
| const uint32_t * | , | |||
| int | ||||
| ) |
| BEECRYPTAPI int blockCipherContextECB | ( | blockCipherContext * | , | |
| uint32_t * | , | |||
| const uint32_t * | , | |||
| int | ||||
| ) |
| BEECRYPTAPI int blockCipherContextFree | ( | blockCipherContext * | ) |
| BEECRYPTAPI int blockCipherContextInit | ( | blockCipherContext * | , | |
| const blockCipher * | ||||
| ) |
| BEECRYPTAPI int blockCipherContextSetCTR | ( | blockCipherContext * | , | |
| const byte * | , | |||
| size_t | ||||
| ) |
| BEECRYPTAPI int blockCipherContextSetIV | ( | blockCipherContext * | , | |
| const byte * | ||||
| ) |
| BEECRYPTAPI int blockCipherContextSetup | ( | blockCipherContext * | , | |
| const byte * | , | |||
| size_t | , | |||
| cipherOperation | ||||
| ) |
| BEECRYPTAPI int blockCipherContextValidKeylen | ( | blockCipherContext * | , | |
| size_t | ||||
| ) |
| int blockCipherCount | ( | void | ) |
This function returns the number of blockciphers implemented by the library.
| const blockCipher * blockCipherDefault | ( | void | ) |
This functions returns the default blockcipher; the default value can be specified by setting environment variable BEECRYPT_CIPHER.
| const blockCipher * blockCipherFind | ( | const char * | name | ) |
This function returns the blockcipher specified by the given name.
| name | Name of the requested blockcipher. |
| const blockCipher * blockCipherGet | ( | int | n | ) |
This function returns the n -th blockcipher implemented by the library.
| n | Index of the requested blockcipher; legal values are 0 through blockCipherCount() - 1. |
| int entropyGatherNext | ( | byte * | data, | |
| size_t | size | |||
| ) |
This function gathers size bytes of entropy into data.
Unless environment variable BEECRYPT_ENTROPY is set, this function will try each successive entropy source to gather up the requested amount.
| data | Points to where the entropy should be stored. | |
| size | Indicates how many bytes of entropy should be gathered. |
| 0 | On success. | |
| -1 | On failure. |
| int entropySourceCount | ( | void | ) |
This function returns the number of entropy sources implemented by the library.
| const entropySource * entropySourceDefault | ( | void | ) |
This functions returns the default entropy source; the default value can be specified by setting environment variable BEECRYPT_ENTROPY.
| const entropySource * entropySourceFind | ( | const char * | name | ) |
This function returns the entropy source specified by the given name.
| name | Name of the requested entropy source. |
| const entropySource * entropySourceGet | ( | int | n | ) |
This function returns the n -th entropy source implemented by the library.
| n | Index of the requested entropy source; legal values are 0 through entropySourceCount() - 1. |
| BEECRYPTAPI int hashFunctionContextDigest | ( | hashFunctionContext * | , | |
| byte * | ||||
| ) |
| BEECRYPTAPI int hashFunctionContextDigestMatch | ( | hashFunctionContext * | , | |
| const mpnumber * | ||||
| ) |
| BEECRYPTAPI int hashFunctionContextDigestMP | ( | hashFunctionContext * | , | |
| mpnumber * | ||||
| ) |
| BEECRYPTAPI int hashFunctionContextFree | ( | hashFunctionContext * | ) |
| BEECRYPTAPI int hashFunctionContextInit | ( | hashFunctionContext * | , | |
| const hashFunction * | ||||
| ) |
| BEECRYPTAPI int hashFunctionContextReset | ( | hashFunctionContext * | ) |
| BEECRYPTAPI int hashFunctionContextUpdate | ( | hashFunctionContext * | , | |
| const byte * | , | |||
| size_t | ||||
| ) |
| BEECRYPTAPI int hashFunctionContextUpdateMC | ( | hashFunctionContext * | , | |
| const memchunk * | ||||
| ) |
| BEECRYPTAPI int hashFunctionContextUpdateMP | ( | hashFunctionContext * | , | |
| const mpnumber * | ||||
| ) |
| BEECRYPTAPI int hashFunctionCount | ( | void | ) |
| BEECRYPTAPI const hashFunction* hashFunctionDefault | ( | void | ) |
| BEECRYPTAPI const hashFunction* hashFunctionFind | ( | const char * | ) |
| BEECRYPTAPI const hashFunction* hashFunctionGet | ( | int | ) |
| BEECRYPTAPI int keyedHashFunctionContextDigest | ( | keyedHashFunctionContext * | , | |
| byte * | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextDigestMatch | ( | keyedHashFunctionContext * | , | |
| const mpnumber * | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextDigestMP | ( | keyedHashFunctionContext * | , | |
| mpnumber * | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextFree | ( | keyedHashFunctionContext * | ) |
| BEECRYPTAPI int keyedHashFunctionContextInit | ( | keyedHashFunctionContext * | , | |
| const keyedHashFunction * | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextReset | ( | keyedHashFunctionContext * | ) |
| BEECRYPTAPI int keyedHashFunctionContextSetup | ( | keyedHashFunctionContext * | , | |
| const byte * | , | |||
| size_t | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextUpdate | ( | keyedHashFunctionContext * | , | |
| const byte * | , | |||
| size_t | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextUpdateMC | ( | keyedHashFunctionContext * | , | |
| const memchunk * | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionContextUpdateMP | ( | keyedHashFunctionContext * | , | |
| const mpnumber * | ||||
| ) |
| BEECRYPTAPI int keyedHashFunctionCount | ( | void | ) |
| BEECRYPTAPI const keyedHashFunction* keyedHashFunctionDefault | ( | void | ) |
| BEECRYPTAPI const keyedHashFunction* keyedHashFunctionFind | ( | const char * | ) |
| BEECRYPTAPI const keyedHashFunction* keyedHashFunctionGet | ( | int | ) |
| BEECRYPTAPI int randomGeneratorContextFree | ( | randomGeneratorContext * | ) |
| BEECRYPTAPI int randomGeneratorContextInit | ( | randomGeneratorContext * | , | |
| const randomGenerator * | ||||
| ) |
| BEECRYPTAPI int randomGeneratorContextNext | ( | randomGeneratorContext * | , | |
| byte * | , | |||
| size_t | ||||
| ) |
| BEECRYPTAPI int randomGeneratorContextSeed | ( | randomGeneratorContext * | , | |
| const byte * | , | |||
| size_t | ||||
| ) |
| BEECRYPTAPI int randomGeneratorCount | ( | void | ) |
| BEECRYPTAPI const randomGenerator* randomGeneratorDefault | ( | void | ) |
| BEECRYPTAPI const randomGenerator* randomGeneratorFind | ( | const char * | ) |
| BEECRYPTAPI const randomGenerator* randomGeneratorGet | ( | int | ) |
1.5.8