hu_IDLCFIPSParamsGen()

Generate IDLC domain parameters based on FIPS 186-3, and set them into the IDLC parameters object.

Synopsis:

#include "huidlc.h"
 
int hu_IDLCFIPSParamsGen(size_t pSize, size_t qSize, sb_RNGCtx rngCtx, sb_YieldCtx yieldCtx, sb_Params *idlcParams, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

pSize

The length (in bits) of the prime modulus p.

qSize

The length (in bits) of the prime divisor q.

rngCtx

An RNG context.

yieldCtx

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

idlcParams

The IDLC parameters object pointer.

sbCtx

A global context.

Library:

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

Description:

This IDLC parameter object can be used for DH or DSA.

An RNG context must be supplied. A yielding context must be supplied if yielding will be performed.

This function will generate values p, q, and g such that p and q are prime, q is a divisor of (p-1) and, g has order q modulo p. p will have bitlength pSize and q will have bitlength qSize.

Returns:

SB_ERR_NULL_PARAMS_PTR

The idlcParams object pointer is NULL.

SB_ERR_BAD_INPUT

The length of p and/or q was invalid.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.