6.3.1 Crypto_DigiSign_Ecdsa_Sign

crypto_DigiSign_Status_E Crypto_DigiSign_Ecdsa_Sign(
    crypto_HandlerType_E ecdsaHandlerType_en, 
    uint8_t *ptr_inputHash, 
    uint32_t hashLen, 
    uint8_t *ptr_outSig, 
    uint32_t sigLen, 
    uint8_t *ptr_privKey, 
    uint32_t privKeyLen, 
    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

Parameters

No.Argument TypeArgument NameTypeDescription
1crypto_HandlerType_EecdsaHandlerType_enInputEnum for crypto operation handler i.e., SW, HW
2uint8_t*ptr_inputHashInputPointer which holds hash to sign
3uint32_thashLenInputLength of the hash in bytes
4uint8_t*ptr_outSigOutputPointer holds the signatures of hash
5uint32_tsigLenInputLength of signature in bytes
6uint8_t*ptr_privKeyInputPointer to hold private key x9.63 format
7uint32_tprivKeyLenInputLength of ECC private key in bytes
8crypto_EccCurveType_EeccCurveType_enInputCurve type used for the ECC keys
9uint32_tecdsaSessionIdInputIt defines the session ID, must be more than zero

Returns

Return TypeDescription
crypto_DigiSign_Status_EFunction returns the status of the API.

Remarks

This API does not support DER format of Keys.