Function hacl_sys::Hacl_P256_ecdsa_sign_p256_sha2
source · pub unsafe extern "C" fn Hacl_P256_ecdsa_sign_p256_sha2(
signature: *mut u8,
msg_len: u32,
msg: *mut u8,
private_key: *mut u8,
nonce: *mut u8
) -> bool
Expand description
Create an ECDSA signature using SHA2-256.
The function returns true
for successful creation of an ECDSA signature and false
otherwise.
The outparam signature
(R || S) points to 64 bytes of valid memory, i.e., uint8_t[64].
The argument msg
points to msg_len
bytes of valid memory, i.e., uint8_t[msg_len].
The arguments private_key
and nonce
point to 32 bytes of valid memory, i.e., uint8_t[32].
The function also checks whether private_key
and nonce
are valid:
• 0 < private_key
< the order of the curve
• 0 < nonce
< the order of the curve