crypto_DigiSign_Status_E Crypto_DigiSign_Ecdsa_SignData(
crypto_HandlerType_E ecdsaHandlerType_en,
uint8_t ptr_inputData,
uint32_t hashLen,
uint8_t *ptr_outSig,
uint32_t sigLen,
uint8_t *ptr_privKey,
uint32_t privKeyLen,
crypto_Hash_Algo_E hashType_en,
crypto_EccCurveType_E eccCurveType_en,
uint32_t ecdsaSessionId
);
Description
This API is utilized for signing a hash using the ECDSA algorithm. It employs the ECC
private key to sign the hash. The size of the ECC private key is determined by the
curve being used. For instance, the private key size for secp256r1 is 32 bytes. The
HW handler currently does not support compressed key format.
Parameters
No. | Argument Type | Argument Name | Type | Description |
---|
1 | crypto_HandlerType_E | ecdsaHandlerType_en | Input | Enum for
crypto operation handler i.e., SW, HW |
2 | uint8_t* | ptr_inputData | Input | Pointer which
holds data to sign |
3 | uint32_t | hashLen | Input | Length of the
hash in bytes |
4 | uint8_t* | ptr_outSig | Output | Pointer holds
the signatures of hash |
5 | uint32_t | sigLen | Input | Length of
signature in bytes |
6 | uint8_t* | ptr_privKey | Input | Pointer to
hold private key x9.63 format |
7 | uint32_t | privKeyLen | Input | Length of ECC
private key in bytes |
8 | crypto_Hash_Algo_E | hashType_en | Input | Hash algo type
to use |
9 | crypto_EccCurveType_E | eccCurveType_en | Input | Curve type
used for the ECC keys |
10 | uint32_t | ecdsaSessionId | Input | It defines the
session ID, must be more than zero |
Returns
Return Type | Description |
---|
crypto_DigiSign_Status_E | Function
returns the status of the API. |
Remarks
- This API does not support DER format of Keys.
- In order to use a compressed key,
software must be selected for the handler.
Prerequisites
- To use the HW handler, the
algorithm must be enabled in Crypto v4 in MPLAB® Code Configurator.
- To use the SW handler, the
algorithm must be enabled in wolfCrypt, and linked to Crypto V4 in MPLAB® Code
Configurator.
- SHA algorithm must be selected in
MPLAB® Code Configurator.