Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

beecrypt.h File Reference

BeeCrypt API, headers. More...

#include "beecrypt.api.h"
#include "memchunk.h"
#include "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(* 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

int entropySourceCount (void)
 This function returns the number of entropy sources implemented by the library.
const entropySource * entropySourceGet (int n)
 This function returns the n -th entropy source implemented by the library.
const entropySource * entropySourceFind (const char *name)
 This function returns the entropy source specified by the given name.
const entropySource * entropySourceDefault (void)
 This functions returns the default entropy source; the default value can be specified by setting environment variable BEECRYPT_ENTROPY.
int entropyGatherNext (byte *, size_t)
 This function gathers size bytes of entropy into data.
int randomGeneratorCount (void)
const randomGenerator * randomGeneratorGet (int)
const randomGenerator * randomGeneratorFind (const char *)
const randomGenerator * randomGeneratorDefault (void)
int randomGeneratorContextInit (randomGeneratorContext *, const randomGenerator *)
int randomGeneratorContextFree (randomGeneratorContext *)
int randomGeneratorContextNext (randomGeneratorContext *, byte *, size_t)
int hashFunctionCount (void)
const hashFunction * hashFunctionGet (int)
const hashFunction * hashFunctionFind (const char *)
const hashFunction * hashFunctionDefault (void)
int hashFunctionContextInit (hashFunctionContext *, const hashFunction *)
int hashFunctionContextFree (hashFunctionContext *)
int hashFunctionContextReset (hashFunctionContext *)
int hashFunctionContextUpdate (hashFunctionContext *, const byte *, size_t)
int hashFunctionContextUpdateMC (hashFunctionContext *, const memchunk *)
int hashFunctionContextUpdateMP (hashFunctionContext *, const mpnumber *)
int hashFunctionContextDigest (hashFunctionContext *, byte *)
int hashFunctionContextDigestMP (hashFunctionContext *, mpnumber *)
int hashFunctionContextDigestMatch (hashFunctionContext *, const mpnumber *)
int keyedHashFunctionCount (void)
const keyedHashFunction * keyedHashFunctionGet (int)
const keyedHashFunction * keyedHashFunctionFind (const char *)
const keyedHashFunction * keyedHashFunctionDefault (void)
int keyedHashFunctionContextInit (keyedHashFunctionContext *, const keyedHashFunction *)
int keyedHashFunctionContextFree (keyedHashFunctionContext *)
int keyedHashFunctionContextSetup (keyedHashFunctionContext *, const byte *, size_t)
int keyedHashFunctionContextReset (keyedHashFunctionContext *)
int keyedHashFunctionContextUpdate (keyedHashFunctionContext *, const byte *, size_t)
int keyedHashFunctionContextUpdateMC (keyedHashFunctionContext *, const memchunk *)
int keyedHashFunctionContextUpdateMP (keyedHashFunctionContext *, const mpnumber *)
int keyedHashFunctionContextDigest (keyedHashFunctionContext *, byte *)
int keyedHashFunctionContextDigestMP (keyedHashFunctionContext *, mpnumber *)
int keyedHashFunctionContextDigestMatch (keyedHashFunctionContext *, const mpnumber *)
int blockCipherCount (void)
 This function returns the number of blockciphers implemented by the library.
const blockCipher * blockCipherGet (int)
 This function returns the n -th blockcipher implemented by the library.
const blockCipher * blockCipherFind (const char *)
 This function returns the blockcipher specified by the given name.
const blockCipher * blockCipherDefault (void)
 This functions returns the default blockcipher; the default value can be specified by setting environment variable BEECRYPT_CIPHER.
int blockCipherContextInit (blockCipherContext *, const blockCipher *)
int blockCipherContextSetup (blockCipherContext *, const byte *, size_t, cipherOperation)
int blockCipherContextSetIV (blockCipherContext *, const byte *)
int blockCipherContextFree (blockCipherContext *)
int blockCipherContextECB (blockCipherContext *, uint32_t *, const uint32_t *, int)
int blockCipherContextCBC (blockCipherContext *, uint32_t *, const uint32_t *, int)


Detailed Description

BeeCrypt API, headers.

These API functions provide an abstract way for using most of the various algorithms implemented by the library.

Author:
Bob Deblier <bob.deblier@pandora.be>

Definition in file beecrypt.h.


Typedef Documentation

typedef uint32_t*(* blockCipherFeedback)(blockCipherParam *)
 

Definition at line 538 of file beecrypt.h.

typedef int(* hashFunctionDigest)(hashFunctionParam *, byte *)
 

Definition at line 256 of file beecrypt.h.

typedef int(* hashFunctionReset)(hashFunctionParam *)
 

Definition at line 254 of file beecrypt.h.

typedef int(* hashFunctionUpdate)(hashFunctionParam *, const byte *, size_t)
 

Definition at line 255 of file beecrypt.h.

typedef int(* keyedHashFunctionDigest)(keyedHashFunctionParam *, byte *)
 

Definition at line 367 of file beecrypt.h.

typedef int(* keyedHashFunctionReset)(keyedHashFunctionParam *)
 

Definition at line 365 of file beecrypt.h.

typedef int(* keyedHashFunctionSetup)(keyedHashFunctionParam *, const byte *, size_t)
 

Definition at line 364 of file beecrypt.h.

typedef int(* keyedHashFunctionUpdate)(keyedHashFunctionParam *, const byte *, size_t)
 

Definition at line 366 of file beecrypt.h.

typedef int(* randomGeneratorCleanup)(randomGeneratorParam *)
 

Definition at line 130 of file beecrypt.h.

typedef int(* randomGeneratorNext)(randomGeneratorParam *, byte *, size_t)
 

Definition at line 129 of file beecrypt.h.

typedef void randomGeneratorParam
 

Definition at line 125 of file beecrypt.h.

typedef int(* randomGeneratorSeed)(randomGeneratorParam *, const byte *, size_t)
 

Definition at line 128 of file beecrypt.h.

typedef int(* randomGeneratorSetup)(randomGeneratorParam *)
 

Definition at line 127 of file beecrypt.h.


Enumeration Type Documentation

enum cipherOperation
 

Specifies whether to perform encryption or decryption.

Enumeration values:
NOCRYPT 
ENCRYPT 
DECRYPT 

Definition at line 484 of file beecrypt.h.


Function Documentation

int blockCipherContextCBC (  blockCipherContext *  ,
uint32_t *  ,
const uint32_t *  ,
int 
) 
 

int blockCipherContextECB (  blockCipherContext *  ,
uint32_t *  ,
const uint32_t *  ,
int 
) 
 

int blockCipherContextFree (  blockCipherContext *   ) 
 

int blockCipherContextInit (  blockCipherContext *  ,
const blockCipher * 
) 
 

int blockCipherContextSetIV (  blockCipherContext *  ,
const byte * 
) 
 

int blockCipherContextSetup (  blockCipherContext *  ,
const byte *  ,
size_t  ,
cipherOperation 
) 
 

int blockCipherCount (  void   ) 
 

This function returns the number of blockciphers implemented by the library.

Returns:
The number of implemented blockciphers.

const blockCipher * blockCipherDefault (  void   ) 
 

This functions returns the default blockcipher; the default value can be specified by setting environment variable BEECRYPT_CIPHER.

Returns:
A pointer to a blockcipher or null, in case an error occured.

const blockCIiher * blockCipherFind (  const char *  name  ) 
 

This function returns the blockcipher specified by the given name.

Parameters:
name Name of the requested blockcipher.
Returns:
A pointer to a blockcipher or null, if the name wasn't found.

const blockCipher * blockCipherGet (  int  n  ) 
 

This function returns the n -th blockcipher implemented by the library.

Parameters:
n Index of the requested blockcipher; legal values are 0 through blockCipherCount() - 1.
Returns:
A pointer to a blockcipher or null, if the index was out of range.

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.

Parameters:
data Points to where the entropy should be stored.
size Indicates how many bytes of entropy should be gathered.
Return values:
0 On success.
-1 On failure.

int entropySourceCount (  void   ) 
 

This function returns the number of entropy sources implemented by the library.

Returns:
The number of implemented entropy sources.

const entropySource * entropySourceDefault (  void   ) 
 

This functions returns the default entropy source; the default value can be specified by setting environment variable BEECRYPT_ENTROPY.

Returns:
A pointer to an entropy source or null, in case an error occured.

const entropySource * entropySourceFind (  const char *  name  ) 
 

This function returns the entropy source specified by the given name.

Parameters:
name Name of the requested entropy source.
Returns:
A pointer to an entropy source or null, if the name wasn't found.

const entropySource * entropySourceGet (  int  n  ) 
 

This function returns the n -th entropy source implemented by the library.

Parameters:
n Index of the requested entropy source; legal values are 0 through entropySourceCount() - 1.
Returns:
A pointer to an entropy source or null, if the index was out of range.

int hashFunctionContextDigest (  hashFunctionContext *  ,
byte * 
) 
 

int hashFunctionContextDigestMatch (  hashFunctionContext *  ,
const mpnumber * 
) 
 

int hashFunctionContextDigestMP (  hashFunctionContext *  ,
mpnumber * 
) 
 

int hashFunctionContextFree (  hashFunctionContext *   ) 
 

int hashFunctionContextInit (  hashFunctionContext *  ,
const hashFunction * 
) 
 

int hashFunctionContextReset (  hashFunctionContext *   ) 
 

int hashFunctionContextUpdate (  hashFunctionContext *  ,
const byte *  ,
size_t 
) 
 

int hashFunctionContextUpdateMC (  hashFunctionContext *  ,
const memchunk * 
) 
 

int hashFunctionContextUpdateMP (  hashFunctionContext *  ,
const mpnumber * 
) 
 

int hashFunctionCount (  void   ) 
 

const hashFunction* hashFunctionDefault (  void   ) 
 

const hashFunction* hashFunctionFind (  const char *   ) 
 

const hashFunction* hashFunctionGet (  int   ) 
 

int keyedHashFunctionContextDigest (  keyedHashFunctionContext *  ,
byte * 
) 
 

int keyedHashFunctionContextDigestMatch (  keyedHashFunctionContext *  ,
const mpnumber * 
) 
 

int keyedHashFunctionContextDigestMP (  keyedHashFunctionContext *  ,
mpnumber * 
) 
 

int keyedHashFunctionContextFree (  keyedHashFunctionContext *   ) 
 

int keyedHashFunctionContextInit (  keyedHashFunctionContext *  ,
const keyedHashFunction * 
) 
 

int keyedHashFunctionContextReset (  keyedHashFunctionContext *   ) 
 

int keyedHashFunctionContextSetup (  keyedHashFunctionContext *  ,
const byte *  ,
size_t 
) 
 

int keyedHashFunctionContextUpdate (  keyedHashFunctionContext *  ,
const byte *  ,
size_t 
) 
 

int keyedHashFunctionContextUpdateMC (  keyedHashFunctionContext *  ,
const memchunk * 
) 
 

int keyedHashFunctionContextUpdateMP (  keyedHashFunctionContext *  ,
const mpnumber * 
) 
 

int keyedHashFunctionCount (  void   ) 
 

const keyedHashFunction* keyedHashFunctionDefault (  void   ) 
 

const keyedHashFunction* keyedHashFunctionFind (  const char *   ) 
 

const keyedHashFunction* keyedHashFunctionGet (  int   ) 
 

int randomGeneratorContextFree (  randomGeneratorContext *   ) 
 

int randomGeneratorContextInit (  randomGeneratorContext *  ,
const randomGenerator * 
) 
 

int randomGeneratorContextNext (  randomGeneratorContext *  ,
byte *  ,
size_t 
) 
 

int randomGeneratorCount (  void   ) 
 

const randomGenerator* randomGeneratorDefault (  void   ) 
 

const randomGenerator* randomGeneratorFind (  const char *   ) 
 

const randomGenerator* randomGeneratorGet (  int   ) 
 


Generated on Fri Feb 18 01:31:25 2005 for BeeCrypt by  doxygen 1.3.9.1