hu_ECPVSSignEncrypt()

Encrypts a message using ECPVS.

Synopsis:

#include "huecpvs.h"
 
int hu_ECPVSSignEncrypt(sb_Context ecpvsContext, size_t recoverableMessageLen, const unsigned char *recoverableMessage, size_t *rLen, unsigned char *rValue, sb_GlobalCtx sbCtx)

Arguments:

ecpvsContext

ECPVS context object pointer.

recoverableMessageLen

The length (in bytes) of recoverableMessage. Set to 0 if there is no recoverable part of the message.

recoverableMessage

The recoverable part of the message. This can be NULL if there is no recoverable part of the message.

rLen

The length (in bytes) of rValue.

rValue

The r component from the signature computation.

sbCtx

A global context.

Library:

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

Description:

This is the second API function to be called during the ECPVS signing process. It can be called multiple times to encrypt parts of the message; this is useful if the message is particularly large.

Provide output buffer in rValue, and indicate the amount in rLen. If sufficient amount of buffer is supplied, this function will place the value of r into rValue and set the actual length in rLen. If the buffer is insufficient, this function will return an error.

If rValue is NULL, this function will set the correct length of r in rLen.

The final signature element, r, is the concatenation of all output rValue, in order, by this function.

Returns:

SB_ERR_NULL_CONTEXT

Context object is NULL.

SB_ERR_BAD_CONTEXT

Context object is invalid.

SB_ERR_NULL_GLOBAL_CTX

Global context is NULL.

SB_ERR_NULL_INPUT_BUF

The recoverable part of the message is NULL and the corresponding length parameter is greater than 0.

SB_ERR_BAD_INPUT

No recoverable part of message is supplied when no padding is used.

SB_ERR_NULL_R_VALUE_LEN

The signature component length is NULL.

SB_ERR_BAD_R_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