hu_ECCParamsModeSet()

Sets the input policy and output format of elliptic curve point representations in the ECC parameters object.

Synopsis:

#include "huecc.h"
 
int hu_ECCParamsModeSet(int policy, int mode, sb_Params eccParams, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

policy

Point compression input policy.

mode

Point compression output mode.

eccParams

An ECC parameters object.

sbCtx

A global context.

Library:

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

Description:

This function affects all functions that accept elliptic curve point representations as input or produce them as output (e.g. creation of elliptic curve key objects).

By default, elliptic curve points can be passed as input in any supported representation; on output, they will be returned in compressed representation.

The mode can be set to change the output format of elliptic curve points. The policy can be set to either accept points in any supported representation, or, to reject input that is not in the same representation chosen for output. A detailed discussion of elliptic curve points and point compression may be found in the "Point Compression" section of the Security Builder API User's Guide.

For example, if the input policy is SB_ECC_POINT_INPUT_REJECT and the output mode is SB_ECC_COMPRESSION_OFF, then elliptic curve points will be returned in uncompressed representation, and only uncompressed points will be accepted as input.

A more detailed discussion of elliptic curve points and point compression is contained in the "Point Compression" section of the Security Builder API User's Guide.

Returns:

SB_ERR_BAD_INPUT

The policy or mode is invalid.

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_SUCCESS

Success.

Last modified: 2014-05-14



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

comments powered by Disqus