hu_ARC2KeySet()

Creates an ARC2 key object from the given key value that can later be used for encryption and/or decryption.

Synopsis:

#include "huarc2.h"
 
int hu_ARC2KeySet(sb_Params arc2Params, size_t keyLen, const unsigned char *keyValue, sb_Key *arc2Key, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc2Params

The ARC2 parameters object.

keyLen

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

keyValue

The key value.

arc2Key

An 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:

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_INPUT_BUF

keyValue is NULL.

SB_ERR_NULL_KEY_PTR

The arc2Key key object pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.