Function anj_crypto_zeroize

Function Documentation

void anj_crypto_zeroize(void *buf, size_t size)

Securely clears the contents of a memory buffer.

This function overwrites the memory region pointed to by buf to ensure that sensitive data such as cryptographic keys, passwords, or temporary plaintext is not left in memory after it is no longer needed.

The actual implementation of this operation is determined by the crypto backend in use, and is designed to prevent the compiler from optimizing the memory wiping away.

Parameters:
  • buf – Pointer to the buffer to be cleared.

  • size – Size of the buffer in bytes.