ica_ecdsa_sign

Purpose

Creates an ECDSA signature for the given hashed data using the given private ICA_EC_KEY data structure.

Format


int ica_ecdsa_sign(ica_adapter_handle_t adapter_handle, 
  const ICA_EC_KEY    *privkey, 
  const unsigned char *data, 
  unsigned int         data_length,
  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 *privkey
Pointer to a readable private ICA_EC_KEY object.
const unsigned char *data
Pointer to a readable buffer containing the hashed data for which the signature is to be generated.
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 writable buffer where the ECDSA signature is returned.
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.
EFAULT
If an internal processing error occurred.

For return codes indicating exceptions, see Return codes.