helper functions for sys_crypto_modes More...
helper functions for sys_crypto_modes
Definition in file helper.h.
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
void | crypto_block_inc_ctr (uint8_t block[16], int L) |
Increment a counter encoded in an 16 octet block. More... | |
int | crypto_equals (const uint8_t *a, const uint8_t *b, size_t len) |
Compares two blocks of same size in deterministic time. More... | |
void | crypto_secure_wipe (void *buf, size_t len) |
Secure wipe function. More... | |
void crypto_block_inc_ctr | ( | uint8_t | block[16], |
int | L | ||
) |
Increment a counter encoded in an 16 octet block.
The counter is encoded from the least significant bit in the following form: block[15-L..15])
block | encoded block |
L | length of counter |
int crypto_equals | ( | const uint8_t * | a, |
const uint8_t * | b, | ||
size_t | len | ||
) |
Compares two blocks of same size in deterministic time.
a | block a |
b | block b |
len | size of both blocks |
void crypto_secure_wipe | ( | void * | buf, |
size_t | len | ||
) |
Secure wipe function.
This wipe function zeros the supplied buffer in a way that the compiler is not allowed to optimize. This can be used to erase secrets from memory.
Note that this function on its own could be insufficient against (data remanence) attacks. It is outside the scope of this function to thoroughly shred the memory area.
[in] | buf | buffer to wipe |
[in] | len | size of the buffer in bytes |