hu_RngReseed()

For ANSI and FIPS140 ANSI RNGs, updates the RNG context object with the given seed data.

Synopsis:

#include "hurandom.h"
 
int hu_RngReseed(sb_RNGCtx rngCtx, size_t seedLen, const unsigned char *seed, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

rngCtx

An RNG context object.

seedLen

The length (in bytes) of seed.

seed

The seed value.

sbCtx

A global context.

Library:

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

Description:

For cipher, hash, HMAC and EC DRBG RNGs, the given 'seed' data is used as the additional input into the reseeding function.

Reseeding the RNG context with whatever new entropy is collected is excellent practice.

Returns:

SB_ERR_BAD_INPUT_BUF_LEN

The length of the input buffer is invalid.

SB_ERR_NULL_INPUT_BUF

The input buffer is NULL.

SB_ERR_NULL_CONTEXT

The RNG context object is NULL.

SB_ERR_BAD_CONTEXT

The RNG context object is invalid.

SB_ERR_RNG_ADDITIONAL_INPUT_TOO_BIG

The seed (additional input in DRBG) is too long.

SB_SUCCESS

Success.