hu_ARC2ParamsCreate()

Creates an ARC2 parameters object.

Synopsis:

#include "huarc2.h"
 
int hu_ARC2ParamsCreate(int mode, size_t effectiveKeyBits, sb_RNGCtx rngContext, sb_YieldCtx yieldCtx, sb_Params *arc2Params, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

mode

The mode of operation. The acceptable values are SB_ARC2_ECB, SB_ARC2_CBC, SB_ARC2_CFB64 or SB_ARC2_OFB64. 0 is also acceptable since some adapters support hu_ARC2BeginV2().

effectiveKeyBits

The length (in bits) of the effective key strength. The maximum allowable length is SB_ARC2_MAX_EFFECTIVE_KEY_BITS.

rngContext

An RNG context. (Optional - set to NULL if key generation will not be performed.)

yieldCtx

The yield context. (Optional - set to NULL if yielding is not required.)

arc2Params

The ARC2 parameters object pointer.

sbCtx

A global context.

Library:

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

Description:

The mode of operation and effective key length must be specified. An RNG context and/or yielding context must be supplied if key generation and/or yielding will be performed, respectively.

Returns:

SB_ERR_BAD_MODE

The mode of operation is invalid.

SB_ERR_BAD_INPUT

effectiveKeyBits is an invalid effective key strength.

SB_ERR_NULL_PARAMS_PTR

The arc2Params parameters object pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.