nvat_nonce_get_bytes#

nvat_rc_t nvat_nonce_get_bytes(
const nvat_nonce_t nonce,
char *bytes,
size_t bytes_len,
)#

Get a copy of the raw bytes from a nonce.

This function copies the nonce’s raw bytes into the provided buffer. The caller is responsible for allocating a buffer of sufficient size. Use nvat_nonce_get_length() to determine the required buffer size before calling this function.

Parameters:
  • nonce – The nonce to read from. Must not be null.

  • bytes – Buffer to copy the nonce bytes into. Must not be null and must be at least bytes_len in size. The nonce data is COPIED into this buffer - the caller owns the buffer and the nonce remains unchanged.

  • bytes_len – The size of the bytes buffer. Must match the nonce length exactly.

Returns:

NVAT_RC_OK on success, NVAT_RC_BAD_ARGUMENT if parameters are invalid or bytes_len doesn’t match nonce length.