hu_CustomRngCreate()

Initializes a random number generator (RNG) context for the user defined RNG using user-provided callback functions and seed value.

Synopsis:

#include "hurandom.h"
 
int hu_CustomRngCreate(void *initInput, hu_RngInitFunc *init, hu_RngEndFunc *end, hu_RngGetBytesFunc *getbytes, hu_RngReseedFunc *reseed, sb_YieldCtx yieldCtx, sb_RNGCtx *rngCtx, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

initInput

Input to the supplied initialization function. This value is passed to the user-defined init function.

init

RNG initialization callback function pointer. (Optional - set to NULL if not used.)

end

RNG end callback function pointer. (Optional - set to NULL if not used.)

getbytes

RNG get bytes callback function pointer. This function pointer must be supplied.

reseed

RNG reseed callback function pointer. (Optional - set to NULL if not used.)

yieldCtx

Yield context. (Optional - set to NULL if not used.)

rngCtx

RNG context pointer.

sbCtx

A global context.

Library:

libhuapi (For the qcc command, use the -l huapi option to link against this library)

Description:

Returns:

SB_ERR_NULL_CONTEXT_PTR

RNG context pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_X

Failure return from the callback function.

SB_SUCCESS

Success.