Random
[API]

Typedefs

typedef C4eSysStatus(* C4eRngFunc )(C4eArchSize len, C4eArchUint8 *buf, void *usrarg)
 Typedef for Random Number Generator (RNG) function.

Enumerations

enum  C4eRngMode { C4eRngModeRaw, C4eRngModePkcs1v1 }

Functions

C4eRngFunc c4e_rng_install (C4eRngFunc fn_rng, void *arg_rng)
 Setup of random number generator (callback) function.

Typedef Documentation

typedef C4eSysStatus(* C4eRngFunc)(C4eArchSize len, C4eArchUint8 *buf, void *usrarg)

Typedef for Random Number Generator (RNG) function.

Parameters:
[in] len Number of random bytes requested.
[out] buf Buffer to be filled with random data (bytes).
[in] usrarg User argument as passed to c4e_rng_install().
Returns:
On success this function must return C4E_STATUS_OK. All other return values are interpreted as an error.

Definition at line 54 of file c4e_rng.h.


Enumeration Type Documentation

enum C4eRngMode

Random number generator mode.

The random number generator mode has to be used in conjunction with function c4e_rng_rand().

Enumerator:
C4eRngModeRaw 

Generate random w/o any restrictions

C4eRngModePkcs1v1 

Generate random compatible to PKCS #1 v1.5

Definition at line 64 of file c4e_rng.h.


Function Documentation

C4eRngFunc c4e_rng_install ( C4eRngFunc  fn_rng,
void *  arg_rng 
)

Setup of random number generator (callback) function.

Postcondition:
Function c4e_rng_rand() does work.
Parameters:
[in] fn_rng Random number generator (callback) function.
[in] arg_rng Argument to be passed to call of fn_rng.
Returns:
The old random number generator function (possibly NULL).