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

header for ntru_file.c More...

#include "ntru_common.h"
#include "ntru_string.h"
#include <stdbool.h>
Include dependency graph for ntru_file.h:

Go to the source code of this file.

Functions

stringread_file (char const *const filename)
 
bool write_file (string const *wstring, char const *const filename)
 

Detailed Description

header for ntru_file.c

Header for the external API of ntru_file.c.

Definition in file ntru_file.h.

Function Documentation

string* read_file ( char const *const  filename)

Reads a file and returns a newly allocated string.

Parameters
filenamefile to open
Returns
a newly allocated string which must be freed by the caller or NULL on failure (e.g. if the file could not be opened/closed)

Definition at line 50 of file ntru_file.c.

bool write_file ( string const *  wstring,
char const *const  filename 
)

Write a string to a file. The file will be pruned or created if it does not exist.

Parameters
wstringthe string to write to the file
filenamethe name of the file to write to
Returns
true for success or false for failure if fopen or fclose failed

Definition at line 107 of file ntru_file.c.