helper.h File Reference

helper functions for sys_crypto_modes More...

Detailed Description

helper functions for sys_crypto_modes

Author
Freie Universitaet Berlin, Computer Systems & Telematics
Nico von Geyso nico..nosp@m.geys.nosp@m.o@fu-.nosp@m.berl.nosp@m.in.de

Definition in file helper.h.

#include <stddef.h>
#include <stdint.h>
+ Include dependency graph for helper.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...
 

Function Documentation

◆ crypto_block_inc_ctr()

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])

Parameters
blockencoded block
Llength of counter

◆ crypto_equals()

int crypto_equals ( const uint8_t *  a,
const uint8_t *  b,
size_t  len 
)

Compares two blocks of same size in deterministic time.

Parameters
ablock a
bblock b
lensize of both blocks
Returns
0 iff the blocks are non-equal.

◆ crypto_secure_wipe()

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.

Parameters
[in]bufbuffer to wipe
[in]lensize of the buffer in bytes