pub unsafe extern "C" fn Hacl_P256_ecdsa_sign_p256_without_hash(
signature: *mut u8,
msg_len: u32,
msg: *mut u8,
private_key: *mut u8,
nonce: *mut u8,
) -> bool
Expand description
Create an ECDSA signature WITHOUT hashing first.
This function is intended to receive a hash of the input. For convenience, we recommend using one of the hash-and-sign combined functions above.
The argument msg
MUST be at least 32 bytes (i.e. msg_len >= 32
).
NOTE: The equivalent functions in OpenSSL and Fiat-Crypto both accept inputs smaller than 32 bytes. These libraries left-pad the input with enough zeroes to reach the minimum 32 byte size. Clients who need behavior identical to OpenSSL need to perform the left-padding themselves.
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 values:
• 0 < private_key
< the order of the curve
• 0 < nonce
< the order of the curve