Generates a signature on the given message using ECPVS.
#include "huecpvs.h"
int hu_ECPVSSign(sb_Params eccParams, sb_PrivateKey privateKey, int hash, int kdf, int encoding, int mode, size_t ivLen, const unsigned char *iv, size_t padLen, size_t recoverableMessageLen, const unsigned char *recoverableMessage, size_t visibleMessageLen, const unsigned char *visibleMessage, size_t *sLen, unsigned char *sValue, size_t *rLen, unsigned char *rValue, 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.
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.
The length (in bytes) of recoverableMessage. Set to 0 if there is no recoverable part of the message.
The recoverable part of the message. This can be NULL if there is no recoverable part of the message.
The length (in bytes) of visibleMessage.
The visible part of the message.
The length (in bytes) of sValue.
The s component from the signature computation.
The length (in bytes) of rValue.
The r component from the signature computation.
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.
Provide output buffer in sValue, and indicate the amount in sLen. If sufficient amount of buffer is supplied, this function will place the value of s into sValue and set the actual length in sLen. If the buffer is insufficient, this function will return an error.
If sValue is NULL, this function will set the correct length of s in sLen.
Similarly for r.
The length of r is variable, dependent on both the amount of padding and the desired length of the recoverable portion of the message.
There is no restriction on the length of the recoverable portion of the message.
The length of s can also be determined by calling hu_ECCParamsGet() and retrieving the OrdLen argument.
Currently only the KDF-based symmetric stream cipher (i.e. HU_ECPVS_ENCRYPTION_STREAM) is supported.
The eccParams object is NULL.
The eccParams object is invalid.
The privateKey object is NULL.
The privateKey object is invalid.
Global context is NULL.
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.
The recoverable or visible part of the message is NULL, or iv is NULL, and the corresponding length parameter is greater than 0.
The signature component length is NULL.
The signature component length is invalid.
The signature component length is NULL.
The signature component length is invalid.
Memory allocation failure.
Success.