hu_ECPVSRecoverBeginV2()

Creates an ECPVS recovery context object.

Synopsis:

#include "huecpvs.h"
 
int hu_ECPVSRecoverBeginV2(sb_Params eccParams, sb_PublicKey publicKey, int hash, int kdf, int encoding, int mode, int flag, size_t ivLen, const unsigned char *iv, size_t padLen, size_t addInfoLen, const unsigned char *addInfo, size_t sLen, unsigned char *sValue, sb_Context *ecpvsContext, sb_GlobalCtx sbCtx)

Arguments:

eccParams

An ECC parameters object.

publicKey

An ECC public key object.

hash

The hash algorithm to use. This is one of: HU_DIGEST_SHA1, HU_DIGEST_SHA224, HU_DIGEST_SHA256, HU_DIGEST_SHA384, or HU_DIGEST_SHA512.

kdf

The KDF algorithm to use. This is one of: HU_KDF_ANSI_SHA1, HU_KDF_ANSI_SHA224, HU_KDF_ANSI_SHA256, HU_KDF_ANSI_SHA384, or HU_KDF_ANSI_SHA512.

encoding

The symmetric encryption to use. Currently, the only valid value is HU_ECPVS_ENCRYPTION_STREAM.

mode

The encryption mode for block symmetric ciphers. Ignored for the stream cipher HU_ECPVS_ENCRYPTION_STREAM.

flag

If flag is set to HU_ECPVS_FLAG_RAW, no padding will be added to the recoverable message.

ivLen

The length (in bytes) of iv. Ignored for the stream cipher HU_ECPVS_ENCRYPTION_STREAM.

iv

The initialization vector for block symmetric ciphers. Ignored for the stream cipher HU_ECPVS_ENCRYPTION_STREAM.

padLen

The number of bytes for additional redundancy. It should be in the range 1..255 if the exact length is known. 0 means that the redundancy level is unknown. (Optional)

addInfoLen

The length (in bytes) of addInfo.

addInfo

Additional information to be used by the KDF.

sLen

The length (in bytes) of sValue.

sValue

The s component from the signature computation.

ecpvsContext

ECPVS context object pointer.

sbCtx

A global context.

Library:

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

Description:

Note: This function is identical in functionality to hu_ECPVSRecoverBegin(), while allowing you to specify the additional information to be used by the KDF. This additional information is passed using the addInfoLen and addInfo fields.

The ANSI X9.92-conformant usage of this API function should include only security primitives with the security level set at more than 80 bits.

Currently only the KDF-based symmetric stream cipher is supported (i.e. HU_ECPVS_ENCRYPTION_STREAM).

This is the first of four API functions to be called during the ECPVS recovery process. It is followed by one or more calls to hu_ECPVSRecoverUpdate(), then one or more calls to hu_ECPVSRecoverDecrypt(), and then finally a call to hu_ECPVSRecoverEnd().

Returns:

SB_ERR_NULL_PARAMS

The eccParams object is NULL.

SB_ERR_BAD_PARAMS

The eccParams object is invalid.

SB_ERR_NULL_PUBLIC_KEY

The publicKey object NULL.

SB_ERR_BAD_PUBLIC_KEY

The publicKey object is invalid.

SB_ERR_NULL_S_VALUE

The signature component is NULL.

SB_ERR_NULL_CONTEXT_PTR

The ecpvsContext is NULL.

SB_ERR_NULL_INPUT_BUF

iv is NULL and ivLen is greater than 0.

SB_ERR_HASH_TYPE

The hash algorithm is not supported.

SB_ERR_BAD_ALG

The KDF algorithm or encryption is not supported.

SB_ERR_BAD_LENGTH

The padLen is out of range or ivLen is too large.

SB_FAIL_INVALID_SIGNATURE

Redundancy check failed. The padding value did not match the expected result.

SB_ERR_BAD_S_VALUE_LEN

The signature component length is invalid.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.

Last modified: 2014-05-14



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

comments powered by Disqus