hu_ECCParamsGet()

Retrieves settings from an ECC parameters object.

Synopsis:

#include "huecc.h"
 
int hu_ECCParamsGet(sb_Params eccParams, int *fieldType, size_t *reducLen, unsigned char *reduc, size_t *seedLen, unsigned char *seed, size_t *aLen, unsigned char *a, size_t *bLen, unsigned char *b, size_t *GLen, unsigned char *G, size_t *OrdLen, unsigned char *Ord, size_t *CofactLen, unsigned char *Cofact, size_t *OIDLen, unsigned char *OID, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

eccParams

An ECC parameters object.

fieldType

Type of underlying finite field. The two values that can be returned are SB_ECC_FIELD_F2M and SB_ECC_FIELD_FP.

reducLen

The length (in bytes) of reduc.

reduc

Prime (SB_ECC_FIELD_FP) or irreducible polynomial (SB_ECC_FIELD_F2M) defining the underlying finite field.

seedLen

The length (in bytes) of seed.

seed

The seed from which parameters were generated.

aLen

The length (in bytes) of a.

a

Coefficient a in the elliptic curve equation.

bLen

The length (in bytes) of b.

b

Coefficient b in the elliptic curve equation.

GLen

The length (in bytes) of G.

G

The generator or base point.

OrdLen

The length (in bytes) of Ord.

Ord

The order of the base point.

CofactLen

The length (in bytes) of Cofact.

Cofact

Cofactor.

OIDLen

The length (in bytes) of OID.

OID

The ASN.1 object identifier of curve parameters (DER-encoded).

sbCtx

A global context.

Library:

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

Description:

One or more of the domain parameters can be retrieved in one call to this function.

If the length of a parameter is known, then a pointer to a buffer large enough to hold the parameter should be passed in the appropriate argument and its length in the corresponding length argument. This function will copy the value into the buffer and set the actual length of the value in the length argument.

If a parameter argument is NULL, then this function will set the correct length of the parameter in the length argument. If the argument is not NULL but the corresponding length argument is too small, this function will return an error.

Set both the parameter argument and its length to NULL for any parameters that are to be ignored.

Returns:

SB_ERR_NULL_PARAMS_PTR

The eccParams object pointer is NULL.

SB_ERR_NULL_PARAMS

The eccParams object is NULL.

SB_ERR_BAD_PARAMS

The tag for the params object is not of the expected type.

SB_ERR_BAD_OUTPUT_BUF_LEN

The output buffer length is invalid.

SB_SUCCESS

Success.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus