cryptsetup API
Public cryptsetup API
Loading...
Searching...
No Matches
Functions
Safe memory helpers functions

Functions

void * crypt_safe_alloc (size_t size)
 
void crypt_safe_free (void *data)
 
void * crypt_safe_realloc (void *data, size_t size)
 
void crypt_safe_memzero (void *data, size_t size)
 

Detailed Description

Function Documentation

◆ crypt_safe_alloc()

void * crypt_safe_alloc ( size_t  size)

Allocate safe memory (content is safely wiped on deallocation).

Parameters
sizesize of memory in bytes
Returns
pointer to allocated memory or NULL.

◆ crypt_safe_free()

void crypt_safe_free ( void *  data)

Release safe memory, content is safely wiped. The pointer must be allocated with crypt_safe_alloc

Parameters
datapointer to memory to be deallocated

◆ crypt_safe_memzero()

void crypt_safe_memzero ( void *  data,
size_t  size 
)

Safe clear memory area (compile should not compile this call out).

Parameters
datapointer to memory to be cleared
sizesize of memory in bytes

◆ crypt_safe_realloc()

void * crypt_safe_realloc ( void *  data,
size_t  size 
)

Reallocate safe memory (content is copied and safely wiped on deallocation).

Parameters
datapointer to memory to be deallocated
sizenew size of memory in bytes
Returns
pointer to allocated memory or NULL.