limb 0.2.0

2024-01-09

byte_zzero(3)
limb manual
byte_zzero(3)

NAME

byte_zzero - fill a byte array with zeroes

SYNOPSIS

#include <limb/bytestr.h>
void byte_zzero(const char *arr, size_t len)

DESCRIPTION

The byte_zzero() function writes zeroes in the len bytes of memory pointed by arr.

It guarantees that compiler optimizations will not remove the erase operation if the compiler deduces that the operation is "unnecessary" (e.g. memory is not used afterwards), which may be of importance when erasing sensitive information, such as keys in a cryptographic context.

Note

In order to ensure memory is erased :

  • if available, explicit_bzero(3) is called,
  • otherwise, Otherwise, memset(3) is used to clear the memory, then a special no-op function with a weak alias is called, in order to trick the compiler.
limb 0.1.0
2023-07-24
byte_zzero(3)