Creates an ECPVS signing context object.
#include "huecpvs.h"
int hu_ECPVSSignBegin(sb_Params eccParams, sb_PrivateKey privateKey, int hash, int kdf, int encoding, int mode, int flag, size_t ivLen, const unsigned char *iv, size_t padLen, sb_Context *ecpvsContext, sb_GlobalCtx sbCtx)
An ECC parameters object.
An ECC private key object.
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.
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.
The symmetric encryption to use. Currently, the only valid value is HU_ECPVS_ENCRYPTION_STREAM.
The encryption mode for block symmetric ciphers. Ignored for the stream cipher HU_ECPVS_ENCRYPTION_STREAM.
If flag is set to HU_ECPVS_FLAG_RAW, no padding will be added to the recoverable message. When no padding is used, there has to be sufficient amount of redundancy in the recoverable part of the message.
The length (in bytes) of iv. Ignored for the stream cipher HU_ECPVS_ENCRYPTION_STREAM.
The initialization vector for block symmetric ciphers. Ignored for the stream cipher HU_ECPVS_ENCRYPTION_STREAM.
The number of bytes of additional redundancy. It should be in the range 1..255.
ECPVS context object pointer.
A global context.
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.
The ECC parameter object must have been created with an RNG context.
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 signing process. It is followed by one or more calls to hu_ECPVSSignEncrypt(), then one or more calls to hu_ECPVSSignUpdate(), and then finally a call to hu_ECPVSSignEnd().
The eccParams object is NULL.
The eccParams object is invalid.
Global context is NULL.
The privateKey object is NULL.
The privateKey object is invalid.
The ecpvsContext is NULL.
iv is NULL and ivLen is greater than 0.
The hash algorithm is not supported.
The KDF algorithm or encryption is not supported.
The padLen is out of range or ivLen is too large.
Memory allocation failure.
Success.