VerifyRecover

This function implements a single-part signature or MAC verification operation with recovery. It can be used for either discovering the target buffer length, or for actually performing the operation.

If the target buffer address, tgt, is NULL, then the variable pointed to by plen is updated to contain the length of the output that is required to perform the operation.

If the target buffer address is not NULL, then the verification operation is performed. In addition to the verification, the recovered signature is placed in the output buffer.

Synopsis

#include “fmciphobj.h”
int (*VerifyRecover)(struct CipherObj * ctx,
const void * sig, unsigned int slength,
void * tgt, unsigned int tlength, unsigned int * plen,
const void * src, unsigned int length);
Parameter Description
ctx The address of a cipher object instance.
sig The address of the buffer containing the signature or the MAC.
slength Number of bytes in the sig buffer.
tgt The address of the output buffer. It may be set to NULL for output buffer length estimation.
tlength Total number of bytes available in the output buffer.
plen Address of a variable that will receive the number of bytes placed in the target buffer. This variable must not be NULL.
src Address of the buffer containing the input data.
length Number of bytes in the src buffer.

Return Value

0: The operation was successful.

Otherwise: an error occurred.

Comments

Most block cipher algorithm cipher objects do not implement this function.

This function finalizes the verification context. VerifyInit() must be called again to verify more data, even when the key is the same.