hu_ARC4KeyGen()

Creates an ARC4 key object of the specified length from random data that can later be used for encryption and/or decryption.

Synopsis:

#include "huarc4.h"
 
int hu_ARC4KeyGen(sb_Params arc4Params, size_t keyLen, sb_Key *arc4Key, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc4Params

An ARC4 parameters object.

keyLen

The length (in bytes) of the ARC4 key value. The maximum allowable length is SB_ARC4_MAX_KEY_LEN.

arc4Key

The ARC4 key object pointer.

sbCtx

A global context.

Library:

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

Description:

The ARC4 parameter object must have been created with an RNG context.

Returns:

SB_ERR_NULL_PARAMS

The arc4Params parameters object is NULL.

SB_ERR_BAD_PARAMS

The tag for the params object is not of the expected type.

SB_ERR_BAD_KEY_LEN

keyLen is an invalid key length.

SB_ERR_NULL_KEY_PTR

The arc4Key object pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.