hu_RngGetBytes()

Generates random data of the specified length.

Synopsis:

#include "hurandom.h"
 
int hu_RngGetBytes(sb_RNGCtx rngCtx, size_t bufSize, unsigned char *buf, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

rngCtx

An RNG context object.

bufSize

The length (in bytes) of random data buffer.

buf

Random data.

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

The RNG context object is NULL.

SB_ERR_BAD_CONTEXT

The RNG context object is invalid.

SB_ERR_BAD_OUTPUT_BUF_LEN

The length of the output buffer is invalid.

SB_ERR_NULL_OUTPUT_BUF

The output buffer is NULL.

SB_FAIL_RANDOM_GEN

FIPS 140-1/2 condition failed.

SB_SUCCESS

Success.