hu_ECCalcOrderIntSet()

Create a point order integer object and set integer value if supplied.

Synopsis:

#include "hueccalc.h"
 
int hu_ECCalcOrderIntSet(sb_Params eccParams, size_t orderIntLen, const unsigned char *orderIntValue, sb_ECCalcOrderInt *orderInt, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

eccParams

ECC parameters object.

orderIntLen

The length (in bytes) of the integer value.

orderIntValue

The point order integer value.

orderInt

The point order integer object.

sbCtx

SB context or memory callback data.

Library:

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

Description:

If the value is not supplied, it generates an empty object.

A point order object contains an element of the point order finite field.

When supplied, the point order integer value (a finite field element) must be represented as an octet string. Even if the supplied value has correct byte length, it can be rejected by returning an error if the value is larger than or equal to point order.

An empty point order integer object represents an integer with the value of 0. In order to generate an empty elliptic curve point object, set NULL to orderIntValue.

The appropriate length can be inquired by using hu_ECCalcOrderIntGet() function.

Returns:

SB_ERR_NULL_PARAMS

ECC parameters object is NULL.

SB_ERR_BAD_PARAMS

ECC parameters object is invalid.

SB_ERR_NULL_ORDER_INT_PTR

Point order object pointer is NULL.

SB_ERR_BAD_INPUT_BUF_LEN

The value length is invalid.

SB_ERR_BAD_INPUT

The value is larger than or equal to point order.

SB_FAIL_ALLOC

Memory allocation failure.

SB_FAILURE

Operation failed.

SB_SUCCESS

Success.