hu_ARC2KeyGen()

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

Synopsis:

#include "huarc2.h"
 
int hu_ARC2KeyGen(sb_Params arc2Params, size_t keyLen, sb_Key *arc2Key, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc2Params

An ARC2 parameters object.

keyLen

The length (in bytes) of the ARC2 key value. The maximum allowable length is SB_ARC2_MAX_KEY_SIZE.

arc2Key

The ARC2 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 ARC2 parameter object must have been created with an RNG context.

Returns:

SB_ERR_NULL_PARAMS

The arc2Params 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 arc2Key key object pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.