post quantum cryptography
Highly optimized implementation of the NTRUEncrypt algorithm
|
header for ntru_mem.c More...
#include <stdlib.h>
Go to the source code of this file.
Defines | |
#define | REALLOC(ptr, size) |
Functions | |
void * | ntru_malloc (size_t size) |
void * | ntru_calloc (size_t nmemb, size_t size) |
#define REALLOC | ( | ptr, | |
size | |||
) |
{ \
void *tmp_ptr = NULL; \
tmp_ptr = realloc(ptr, size); \
if (tmp_ptr == NULL) { \
fprintf(stderr,"NULL Pointer in %s [%d]",__FILE__,__LINE__); \
abort(); \
} \
ptr = tmp_ptr; \
}
Realloc macro which checks if reallocation worked via a temporary pointer.
Definition at line 38 of file ntru_mem.h.
void* ntru_calloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Allocate memory of size and return a void pointer. The memory is zeroed.
nmemb | amount of blocks to allocate |
size | of the memory blocks to allocate in bytes |
Definition at line 56 of file ntru_mem.c.
void* ntru_malloc | ( | size_t | size | ) |
Allocate memory of size and return a void pointer.
size | of the memory to allocate in bytes |
Definition at line 38 of file ntru_mem.c.