TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ltc_prng_descriptor Struct Reference

#include <tomcrypt_prng.h>

Public Attributes

char * name
 
int export_size
 
int(* start )(prng_state *prng)
 
int(* add_entropy )(const unsigned char *in, unsigned long inlen, prng_state *prng)
 
int(* ready )(prng_state *prng)
 
unsigned long(* read )(unsigned char *out, unsigned long outlen, prng_state *prng)
 
int(* done )(prng_state *prng)
 
int(* pexport )(unsigned char *out, unsigned long *outlen, prng_state *prng)
 
int(* pimport )(const unsigned char *in, unsigned long inlen, prng_state *prng)
 
int(* test )(void)
 

Detailed Description

PRNG descriptor

Member Data Documentation

int(* ltc_prng_descriptor::add_entropy)(const unsigned char *in, unsigned long inlen, prng_state *prng)

Add entropy to the PRNG

Parameters
inThe entropy
inlenLength of the entropy (octets)\
prngThe PRNG state
Returns
CRYPT_OK if successful
int(* ltc_prng_descriptor::done)(prng_state *prng)

Terminate a PRNG state

Parameters
prngThe PRNG state to terminate
Returns
CRYPT_OK if successful
int ltc_prng_descriptor::export_size

size in bytes of exported state

char* ltc_prng_descriptor::name

Name of the PRNG

int(* ltc_prng_descriptor::pexport)(unsigned char *out, unsigned long *outlen, prng_state *prng)

Export a PRNG state

Parameters
out[out] The destination for the state
outlen[in/out] The max size and resulting size of the PRNG state
prngThe PRNG to export
Returns
CRYPT_OK if successful
int(* ltc_prng_descriptor::pimport)(const unsigned char *in, unsigned long inlen, prng_state *prng)

Import a PRNG state

Parameters
inThe data to import
inlenThe length of the data to import (octets)
prngThe PRNG to initialize/import
Returns
CRYPT_OK if successful
unsigned long(* ltc_prng_descriptor::read)(unsigned char *out, unsigned long outlen, prng_state *prng)

Read from the PRNG

Parameters
out[out] Where to store the data
outlenLength of data desired (octets)
prngThe PRNG state to read from
Returns
Number of octets read
int(* ltc_prng_descriptor::ready)(prng_state *prng)

Ready a PRNG state to read from

Parameters
prngThe PRNG state to ready
Returns
CRYPT_OK if successful
int(* ltc_prng_descriptor::start)(prng_state *prng)

Start a PRNG state

Parameters
prng[out] The state to initialize
Returns
CRYPT_OK if successful
int(* ltc_prng_descriptor::test)(void)

Self-test the PRNG

Returns
CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled

The documentation for this struct was generated from the following file: