openthread_sys

Function otPlatCryptoEcdsaSignUsingKeyRef

Source
pub unsafe extern "C" fn otPlatCryptoEcdsaSignUsingKeyRef(
    aKeyRef: otCryptoKeyRef,
    aHash: *const otPlatCryptoSha256Hash,
    aSignature: *mut otPlatCryptoEcdsaSignature,
) -> otError
Expand description

Calculate the ECDSA signature for a hashed message using the Key reference passed.

Uses the deterministic digital signature generation procedure from RFC 6979.

@param[in] aKeyRef Key Reference to the slot where the key-pair is stored. @param[in] aHash A pointer to a SHA-256 hash structure where the hash value for signature calculation is stored. @param[out] aSignature A pointer to an ECDSA signature structure to output the calculated signature.

@retval OT_ERROR_NONE The signature was calculated successfully, @p aSignature was updated. @retval OT_ERROR_PARSE The key-pair DER format could not be parsed (invalid format). @retval OT_ERROR_NO_BUFS Failed to allocate buffer for signature calculation. @retval OT_ERROR_INVALID_ARGS The @p aContext is NULL.

@note This API is only used by OT core when OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE is enabled.