ica_ecdsa_verify

Purpose

Verifies an ECDSA signature with the given data using the public ICA_EC_KEY data structure.

Format


int ica_ecdsa_verify(ica_adapter_handle_t adapter_handle, 
  const ICA_EC_KEY     *pubkey,
  const unsigned char  *data, 
  unsigned int          data_length,
  const unsigned char  *signature, 
  unsigned int          signature_length);

Required hardware support

  • At least, a Crypto Express4S CCA coprocessor is required (CEX4C or later).
  • MSA9 (IBM z15® or later) for ECDH and ECDSA support via CPACF for these elliptic curves: p256, p384, p521.

Parameters

ica_adapter_handle_t adapter_handle
Pointer to a previously opened device handle.
const ICA_EC_KEY *pubkey
Pointer to a readable public ICA_EC_KEY object.
const unsigned char *data
Pointer to a readable buffer containing the hashed data for which the signature is to be verified.
unsigned int data_length
The length of the hashed data. Supported lengths are 20, 28, 32, 48, and 64 bytes.
unsigned char *signature
Pointer to a readable buffer where the ECDSA signature is provided.
unsigned int signature_length
The length of the buffer. It must be greater or equal to 2*privlen as returned when creating the ICA_EC_KEY data structure.

Return codes

0
Success
EINVAL
If at least one invalid parameter is given.
EIO
If an internal processing error occurred.
EFAULT
If the signature is invalid.

For return codes indicating exceptions, see Return codes.