CRYPTO_VerifySignature

C Specification


#include <nitroCrypto/crypto/sign.h>

int CRYPTO_VerifySignature(
const void* data_ptr,
int   data_len,
const void* sign_ptr,
const void* mod_ptr
);
		

Arguments

data_ptr Pointer to target data for digital signature verification.
data_len Length of the verification data specified by data_ptr.
sign_ptr Pointer to the digital signature (128 bytes).
mod_ptr Pointer to the public key modulus (128 bytes).

Return Values

Returns one of the following process results.

TRUE Digitial signature verification succeeded.
FALSE Verification failed. Failure results if the signature and the data differ, the public key and the signature do not match, the signature format is incorrect, or the memory allocation fails.

Description

Digital signatures are used to verify whether data is correct. sign_ptr is assigned 128 bytes of signature data. The signature data uses PKCS #1 v.1.5 formatting for a 1024-bit RSA key length, hashed with the SHA-1 algorithm. mod_ptr is a byte sequence of the 128 byte public key modulus, arranged in order from the upper byte. Note: The public exponent for the public key is fixed as 65537 (0x10001). This function does not support RSA keys with a public exponent other than 65537.

Dynamically allocates memory for calculations during the call. Uses the memory management function specified by the CRYPTO_SetAllocator function. The amount of memory used varies depending on the data to verify. This is usually not a problem if 4KB is provided in advance. This function returns FALSE if memory allocation fails and NULL is passed by the memory management function. In addition, there is no correlation between the amount of memory used and data_len.

For detailed information on electronic signatures, see Digital Signature Overview

See Also

CRYPTO_VerifySignatureWithHash

Revision History

03/07/2006 Added an overview.
03/02/2006 Added a description of operations when memory is insufficient.
02/24/2006 Switched from Crypt to Crypto.
01/30/2006 Added a description.
12/21/2005 Initial version.

CONFIDENTIAL