hu_RngCreate()

Creates an RNG context object with optional initial seed and reseed callback.

Synopsis:

#include "hurandom.h"
 
int hu_RngCreate(size_t seedLen, const unsigned char *seed, hu_ReseedCallbackFunc *seedFunc, void *rsourceParam, sb_YieldCtx yieldCtx, sb_RNGCtx *rngCtx, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

seedLen

The length (in bytes) of initial seed. (Optional)

seed

The initial seed value. Set to NULL if not used.

seedFunc

A user-provided callback function. (Optional - set to NULL if not used.)

rsourceParam

A user-defined data that will be passed to seedFunc. (Optional - set to NULL if not used.)

yieldCtx

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

rngCtx

An RNG context object pointer.

sbCtx

A global context.

Library:

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

Description:

If a reseed callback function is provided, it will be called periodically to obtain additional seeding data.

Returns:

SB_ERR_NULL_CONTEXT_PTR

The RNG context object pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.