hu_ECDHKDFIEEESharedGen()

Generates a shared secret of fixed length by applying IEEE 1363 KDF1 to the output of an ECDH key agreement.

Synopsis:

#include "huecc.h"
 
int hu_ECDHKDFIEEESharedGen(sb_Params eccParams, sb_PrivateKey privateKey, sb_PublicKey remotePublicKey, size_t addInfoLen, const unsigned char *addInfo, size_t secretLen, unsigned char *sharedSecret, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

eccParams

An ECC parameters object.

privateKey

An ECC private key object.

remotePublicKey

An ECC public key object.

addInfoLen

The length (in bytes) of additional information. (Optional)

addInfo

Additional information for use with the KDF. (Optional - set to NULL if not used.)

secretLen

The length (in bytes) of the shared secret. The only acceptable value is SB_SHA1_DIGEST_LEN.

sharedSecret

The shared secret value.

sbCtx

A global context.

Library:

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

Description:

Returns:

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_NULL_PRIVATE_KEY

privateKey object is NULL.

SB_ERR_BAD_PRIVATE_KEY

privateKey object is invalid.

SB_ERR_NULL_PUBLIC_KEY

The publicKey object is NULL.

SB_ERR_BAD_PUBLIC_KEY

The publicKey object is invalid.

SB_ERR_NULL_ADDINFO

Additional information is NULL.

SB_ERR_NULL_OUTPUT_BUF

The shared secret buffer is NULL.

SB_ERR_BAD_OUTPUT_BUF_LEN

The shared secret length is invalid.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.