c4e_rng.h File Reference

(Version 557)

Random Number Generator. More...

#include "c4e_sys.h"
Include dependency graph for c4e_rng.h:

Go to the source code of this file.

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.
C4eSysStatus c4e_rng_rand (C4eRngMode mode, C4eArchUint8 *buf, C4eArchSize len)
 Random Number Generator (RNG).

Detailed Description

Random Number Generator.

Author:
Copyright (C) 2007-2015 Ralf Hoppe <ralf.hoppe@ieee.org>
Version:
Id
c4e_rng.h 557 2015-03-22 17:54:10Z ralf

Definition in file c4e_rng.h.


Function Documentation

C4eSysStatus c4e_rng_rand ( C4eRngMode  mode,
C4eArchUint8 buf,
C4eArchSize  len 
)

Random Number Generator (RNG).

Precondition:
A (user defined) random number generator function must be setup in advance, using function c4e_rng_install().
Parameters:
[in] mode Random number generator mode.
[out] buf Buffer to be filled with random data.
[in] len Number of random bytes requested.
Returns:
On success returns C4E_STATUS_OK. All other return values shall be interpreted as an error.