- sodium_add
void sodium_add(ubyte* a, const(ubyte)* b, size_t len)
- sodium_allocarray
void* sodium_allocarray(size_t count, size_t size)
- sodium_base642bin
int sodium_base642bin(ubyte* bin, size_t bin_maxlen, const(char*) b64, size_t b64_len, const(char*) ignore, size_t* bin_len, const(char)** b64_end, int variant)
- sodium_base64_ENCODED_LEN
size_t sodium_base64_ENCODED_LEN(size_t BIN_LEN, int VARIANT)
#define sodium_base64_ENCODED_LEN(BIN_LEN, VARIANT)
Computes the required length to encode BIN_LEN bytes as a base64 string
using the given variant. The computed length includes a trailing \0.
- sodium_base64_encoded_len
size_t sodium_base64_encoded_len(size_t bin_len, int variant)
- sodium_bin2base64
char* sodium_bin2base64(char* b64, size_t b64_maxlen, const(ubyte*) bin, size_t bin_len, int variant)
- sodium_bin2hex
char* sodium_bin2hex(char* hex, size_t hex_maxlen, const(ubyte*) bin, size_t bin_len)
- sodium_compare
int sodium_compare(const(ubyte)* b1_, const(ubyte)* b2_, size_t len)
- sodium_free
void sodium_free(void* ptr)
- sodium_hex2bin
int sodium_hex2bin(ubyte* bin, size_t bin_maxlen, const(char*) hex, size_t hex_len, const(char*) ignore, size_t* bin_len, const(char)** hex_end)
- sodium_increment
void sodium_increment(ubyte* n, size_t nlen)
- sodium_is_zero
int sodium_is_zero(const(ubyte)* n, size_t nlen)
- sodium_malloc
void* sodium_malloc(size_t size)
- sodium_memcmp
int sodium_memcmp(const(void*) b1_, const(void*) b2_, size_t len)
Constant-time test for equality.
- sodium_memzero
void sodium_memzero(void* pnt, size_t len)
- sodium_mlock
int sodium_mlock(void* addr, size_t len)
The sodium_mlock() function locks at least len bytes of memory starting at addr.
This can help avoid swapping sensitive data to disk.
- sodium_mprotect_noaccess
int sodium_mprotect_noaccess(void* ptr)
- sodium_mprotect_readonly
int sodium_mprotect_readonly(void* ptr)
- sodium_mprotect_readwrite
int sodium_mprotect_readwrite(void* ptr)
- sodium_munlock
int sodium_munlock(void* addr, size_t len)
The sodium_munlock() function should be called after locked memory is not being used any more.
It will zero len bytes starting at addr before actually flagging the pages as
swappable again. Calling sodium_memzero() prior to sodium_munlock() is thus not required.
- sodium_pad
int sodium_pad(size_t* padded_buflen_p, ubyte* buf, size_t unpadded_buflen, size_t blocksize, size_t max_buflen)
- sodium_stackzero
void sodium_stackzero(size_t len)
Clearing the stack.
*
* The sodium_stackzero() function clears len bytes above the current stack pointer, to
* overwrite sensitive values that may have been temporarily stored on the stack.
* Note that these values can still be present in registers.
* History: This function was introduced in libsodium 1.0.16.
* See_Also: https://download.libsodium.org/doc/helpers#clearing-the-stack
- sodium_sub
void sodium_sub(ubyte* a, const(ubyte)* b, size_t len)
- sodium_unpad
int sodium_unpad(size_t* unpadded_buflen_p, const(ubyte)* buf, size_t padded_buflen, size_t blocksize)
Utility functions.