post quantum cryptography
Highly optimized implementation of the NTRUEncrypt algorithm
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
ntru_mem.h File Reference

header for ntru_mem.c More...

#include <stdlib.h>
Include dependency graph for ntru_mem.h:

Go to the source code of this file.

Macros

#define REALLOC(ptr, size)
 

Functions

void * ntru_malloc (size_t size)
 
void * ntru_calloc (size_t nmemb, size_t size)
 

Detailed Description

header for ntru_mem.c

Header for the internal API of ntru_mem.c.

Definition in file ntru_mem.h.

Macro Definition Documentation

#define REALLOC (   ptr,
  size 
)
Value:
{ \
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.

Function Documentation

void* ntru_calloc ( size_t  nmemb,
size_t  size 
)

Allocate memory of size and return a void pointer. The memory is zeroed.

Parameters
nmembamount of blocks to allocate
sizeof the memory blocks to allocate in bytes
Returns
void pointer to the beginning of the allocated memory block

Definition at line 56 of file ntru_mem.c.

void* ntru_malloc ( size_t  size)

Allocate memory of size and return a void pointer.

Parameters
sizeof the memory to allocate in bytes
Returns
void pointer to the beginning of the allocated memory block

Definition at line 38 of file ntru_mem.c.