crypto_operation
namespace. For example, the "hash" operation defines:crypto_hash_PRIMITIVE
.crypto_hash_BYTES
.crypto_hash_bytes(void)
.crypto_hash()
.crypto_operation_primitivename
namespace. For example, specific hash functions and their related macros are defined in the crypto_hash_sha256
, crypto_hash_sha512
, and crypto_hash_sha512256
namespaces.unsigned long long
values. Other values representing the size of an object in memory use the standard size_t
type.sodium_init()
must be called before any other function. It picks the best implementations for the current platform, initializes the random number generator, and generates the canary for guarded heap allocations.malloc
, calloc
, etc), except for crypto_pwhash
and sodium_malloc
.*_ZEROBYTES
, *_BOXZEROBYTES
) before messages and ciphertexts.sodium_memcmp()
or crypto_verify_(16|32|64)()
.--enable-opt
switch remains available for more aggressive optimizations._keygen()
function.abort()
if something unusual is detected. This requires a few extra checks but is useful for spotting internal and application-specific bugs that tests don't catch.--enable-minimal
.sodium_malloc()
whenever possible. This immediately detects out-of-bounds accesses, including reads. The base address is also not guaranteed to be aligned, which helps detect mishandling of unaligned data.check-valgrind
target, which checks that the whole suite passes with the Valgrind's Memcheck, Helgrind, DRD, and SGCheck modules.stable
branch.-fsanitize=address,undefined
and Valgrind (Memcheck, Helgrind, DRD, and SGCheck)-fsanitize=address,undefined
and Valgrind (Memcheck, Helgrind, DRD, and SGCheck)deprecated
attribute. They can also be removed from minimal builds.