diff --git a/src/Makefile b/src/Makefile index 942ee6f..0a8bcd8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,31 +2,32 @@ include ../common.mk # sources, headers, objects -PQC_SOURCES = poly.c \ - mem.c \ - encrypt.c \ - decrypt.c \ - keypair.c \ - ascii_poly.c \ - file.c \ - ntru_string.c \ - poly_ascii.c \ - rnd.c +PQC_SOURCES = \ + ntru_ascii_poly.c \ + ntru_decrypt.c \ + ntru_encrypt.c \ + ntru_file.c \ + ntru_keypair.c \ + ntru_mem.c \ + ntru_poly.c \ + ntru_poly_ascii.c \ + ntru_rnd.c \ + ntru_string.c PQC_OBJS = $(patsubst %.c, %.o, $(PQC_SOURCES)) -PQC_HEADERS = err.h \ - poly.h \ - params.h \ - encrypt.h \ - decrypt.h \ - keypair.h \ - ascii_poly.h \ - params.h \ - file.h \ - ntru_string.h \ - poly_ascii.h \ - rnd.h +PQC_HEADERS = \ + ntru_ascii_poly.h \ + ntru_decrypt.h \ + ntru_encrypt.h \ + ntru_err.h \ + ntru_file.h \ + ntru_keypair.h \ + ntru_poly.h \ + ntru_params.h \ + ntru_poly_ascii.h \ + ntru_rnd.h \ + ntru_string.h # libs LIBS += -L. -lgmp -lmpfr -lflint $(shell $(PKG_CONFIG) --libs glib-2.0) -lm diff --git a/src/ascii_poly.c b/src/ntru_ascii_poly.c similarity index 97% rename from src/ascii_poly.c rename to src/ntru_ascii_poly.c index e957c9e..7bb27a0 100644 --- a/src/ascii_poly.c +++ b/src/ntru_ascii_poly.c @@ -20,18 +20,18 @@ */ /** - * @file ascii_poly.c + * @file ntru_ascii_poly.c * This file allows to convert ascii strings, including * base64 encoded ones, to polynomials. * @brief ascii to polynomials */ -#include "ascii_poly.h" -#include "common.h" -#include "mem.h" +#include "ntru_ascii_poly.h" +#include "ntru_common.h" +#include "ntru_mem.h" +#include "ntru_params.h" +#include "ntru_poly.h" #include "ntru_string.h" -#include "params.h" -#include "poly.h" #include diff --git a/src/ascii_poly.h b/src/ntru_ascii_poly.h similarity index 94% rename from src/ascii_poly.h rename to src/ntru_ascii_poly.h index 8a2a611..8ebc70e 100644 --- a/src/ascii_poly.h +++ b/src/ntru_ascii_poly.h @@ -20,18 +20,18 @@ */ /** - * @file ascii_poly.h - * Header for the internal API of ascii_poly.c. - * @brief header for ascii_poly.c + * @file ntru_ascii_poly.h + * Header for the internal API of ntru_ascii_poly.c. + * @brief header for ntru_ascii_poly.c */ #ifndef NTRU_ASCII_POLY_H_ #define NTRU_ASCII_POLY_H_ -#include "common.h" +#include "ntru_common.h" #include "ntru_string.h" -#include "params.h" +#include "ntru_params.h" #include #include diff --git a/src/common.h b/src/ntru_common.h similarity index 98% rename from src/common.h rename to src/ntru_common.h index cf3fe4b..0b20b4f 100644 --- a/src/common.h +++ b/src/ntru_common.h @@ -20,7 +20,7 @@ */ /** - * @file common.h + * @file ntru_common.h * This file holds common macros and functions * shared throughout the whole codebase without * any particular purpose. diff --git a/src/decrypt.c b/src/ntru_decrypt.c similarity index 95% rename from src/decrypt.c rename to src/ntru_decrypt.c index daf2df6..80d5060 100644 --- a/src/decrypt.c +++ b/src/ntru_decrypt.c @@ -20,17 +20,17 @@ */ /** - * @file decrypt.c + * @file ntru_decrypt.c * This file handles the NTRU decryption * algorithm. * @brief NTRU decryption */ -#include "ascii_poly.h" -#include "decrypt.h" +#include "ntru_ascii_poly.h" +#include "ntru_decrypt.h" +#include "ntru_params.h" +#include "ntru_poly_ascii.h" #include "ntru_string.h" -#include "params.h" -#include "poly_ascii.h" #include #include diff --git a/src/decrypt.h b/src/ntru_decrypt.h similarity index 93% rename from src/decrypt.h rename to src/ntru_decrypt.h index 877dfb9..f4f8b60 100644 --- a/src/decrypt.h +++ b/src/ntru_decrypt.h @@ -20,17 +20,17 @@ */ /** - * @file decrypt.h - * Header for the external API of decrypt.c. - * @brief header for decrypt.c + * @file ntru_decrypt.h + * Header for the external API of ntru_decrypt.c. + * @brief header for ntru_decrypt.c */ #ifndef NTRU_DECRYPT_H #define NTRU_DECRYPT_H +#include "ntru_params.h" +#include "ntru_poly.h" #include "ntru_string.h" -#include "params.h" -#include "poly.h" #include diff --git a/src/encrypt.c b/src/ntru_encrypt.c similarity index 93% rename from src/encrypt.c rename to src/ntru_encrypt.c index 5e3505f..060d174 100644 --- a/src/encrypt.c +++ b/src/ntru_encrypt.c @@ -20,18 +20,18 @@ */ /** - * @file encrypt.c + * @file ntru_encrypt.c * This file handles the NTRU encryption * algorithm. * @brief NTRU encryption */ -#include "ascii_poly.h" -#include "encrypt.h" -#include "mem.h" +#include "ntru_ascii_poly.h" +#include "ntru_encrypt.h" +#include "ntru_mem.h" +#include "ntru_params.h" +#include "ntru_poly_ascii.h" #include "ntru_string.h" -#include "params.h" -#include "poly_ascii.h" #include diff --git a/src/encrypt.h b/src/ntru_encrypt.h similarity index 94% rename from src/encrypt.h rename to src/ntru_encrypt.h index ea40da0..49416ac 100644 --- a/src/encrypt.h +++ b/src/ntru_encrypt.h @@ -20,8 +20,8 @@ */ /** - * @file encrypt.h - * Header for the internal API of encrypt.c. + * @file ntru_encrypt.h + * Header for the internal API of ntru_encrypt.c. * @brief header for encrypt.c */ @@ -29,9 +29,9 @@ #define PQC_ENCRYPT_H +#include "ntru_params.h" +#include "ntru_poly.h" #include "ntru_string.h" -#include "params.h" -#include "poly.h" #include diff --git a/src/err.h b/src/ntru_err.h similarity index 98% rename from src/err.h rename to src/ntru_err.h index 531b3c5..bac621c 100644 --- a/src/err.h +++ b/src/ntru_err.h @@ -20,7 +20,7 @@ */ /** - * @file err.h + * @file ntru_err.h * This file provides error macros * and functions for the NTRU cryptosystem. * @brief error handling diff --git a/src/file.c b/src/ntru_file.c similarity index 96% rename from src/file.c rename to src/ntru_file.c index 751bc99..bb061c6 100644 --- a/src/file.c +++ b/src/ntru_file.c @@ -20,15 +20,15 @@ */ /** - * @file file.c + * @file ntru_file.c * Allows operations on files, such as reading * and writing. * @brief file operations */ -#include "common.h" -#include "err.h" -#include "mem.h" +#include "ntru_common.h" +#include "ntru_err.h" +#include "ntru_mem.h" #include "ntru_string.h" #include diff --git a/src/file.h b/src/ntru_file.h similarity index 92% rename from src/file.h rename to src/ntru_file.h index 6debaa8..a7ae424 100644 --- a/src/file.h +++ b/src/ntru_file.h @@ -20,16 +20,16 @@ */ /** - * @file file.h - * Header for the external API of file.c. - * @brief header for file.c + * @file ntru_file.h + * Header for the external API of ntru_file.c. + * @brief header for ntru_file.c */ #ifndef NTRU_FILE_H #define NTRU_FILE_H -#include "common.h" +#include "ntru_common.h" #include "ntru_string.h" diff --git a/src/keypair.c b/src/ntru_keypair.c similarity index 96% rename from src/keypair.c rename to src/ntru_keypair.c index 7450670..67600ff 100644 --- a/src/keypair.c +++ b/src/ntru_keypair.c @@ -20,19 +20,19 @@ */ /** - * @file keypair.c + * @file ntru_keypair.c * This file handles the creation of the * key pair and possibly common operations on them. * @brief key creation and operations */ -#include "ascii_poly.h" -#include "file.h" -#include "keypair.h" +#include "ntru_ascii_poly.h" +#include "ntru_file.h" +#include "ntru_keypair.h" +#include "ntru_params.h" +#include "ntru_poly.h" +#include "ntru_poly_ascii.h" #include "ntru_string.h" -#include "params.h" -#include "poly.h" -#include "poly_ascii.h" #include #include diff --git a/src/keypair.h b/src/ntru_keypair.h similarity index 96% rename from src/keypair.h rename to src/ntru_keypair.h index 11e1b24..6179638 100644 --- a/src/keypair.h +++ b/src/ntru_keypair.h @@ -20,16 +20,16 @@ */ /** - * @file keypair.h - * Header for internal API of keypair.c. - * @brief header for keypair.c + * @file ntru_keypair.h + * Header for internal API of ntru_keypair.c. + * @brief header for ntru_keypair.c */ #ifndef NTRU_KEYPAIR_H #define NTRU_KEYPAIR_H -#include "params.h" +#include "ntru_params.h" #include #include diff --git a/src/mem.c b/src/ntru_mem.c similarity index 97% rename from src/mem.c rename to src/ntru_mem.c index bb0d13c..0ac0c16 100644 --- a/src/mem.c +++ b/src/ntru_mem.c @@ -20,13 +20,13 @@ */ /** - * @file mem.c + * @file ntru_mem.c * This file provides functions for * memory management. * @brief memory management */ -#include "mem.h" +#include "ntru_mem.h" #include #include diff --git a/src/mem.h b/src/ntru_mem.h similarity index 94% rename from src/mem.h rename to src/ntru_mem.h index 0fea006..4e40db7 100644 --- a/src/mem.h +++ b/src/ntru_mem.h @@ -20,9 +20,9 @@ */ /** - * @file mem.h - * Header for the internal API of mem.c. - * @brief header for mem.c + * @file ntru_mem.h + * Header for the internal API of ntru_mem.c. + * @brief header for ntru_mem.c */ #ifndef NTRU_MEM_H diff --git a/src/params.h b/src/ntru_params.h similarity index 98% rename from src/params.h rename to src/ntru_params.h index 503a32a..aae74ba 100644 --- a/src/params.h +++ b/src/ntru_params.h @@ -20,7 +20,7 @@ */ /** - * @file params.h + * @file ntru_params.h * This file defines the ntru_params * and related data types. * @brief NTRU parameters diff --git a/src/poly.c b/src/ntru_poly.c similarity index 99% rename from src/poly.c rename to src/ntru_poly.c index 7730f7a..00150c4 100644 --- a/src/poly.c +++ b/src/ntru_poly.c @@ -20,17 +20,17 @@ */ /** - * @file poly.c + * @file ntru_poly.c * This files purpose is to handle polynomials * in general, allowing modification, arithmetic * and common algorithms like inverting them. * @brief operations on polynomials */ -#include "err.h" -#include "mem.h" -#include "params.h" -#include "poly.h" +#include "ntru_err.h" +#include "ntru_mem.h" +#include "ntru_params.h" +#include "ntru_poly.h" #include #include diff --git a/src/poly.h b/src/ntru_poly.h similarity index 97% rename from src/poly.h rename to src/ntru_poly.h index f0a396f..6876ad3 100644 --- a/src/poly.h +++ b/src/ntru_poly.h @@ -20,16 +20,16 @@ */ /** - * @file poly.h - * Header for the internal API of poly.c. - * @brief header for poly.c + * @file ntru_poly.h + * Header for the internal API of ntru_poly.c. + * @brief header for ntru_poly.c */ #ifndef NTRU_POLY_H #define NTRU_POLY_H -#include "err.h" -#include "params.h" +#include "ntru_err.h" +#include "ntru_params.h" #include #include diff --git a/src/poly_ascii.c b/src/ntru_poly_ascii.c similarity index 97% rename from src/poly_ascii.c rename to src/ntru_poly_ascii.c index dece753..75c915b 100644 --- a/src/poly_ascii.c +++ b/src/ntru_poly_ascii.c @@ -20,18 +20,18 @@ */ /** - * @file poly_ascii.c + * @file ntru_poly_ascii.c * This file allows to convert polynomials to * ascii strings, including base64 encoded. * @brief polynomials to acii */ -#include "poly_ascii.h" -#include "common.h" -#include "mem.h" +#include "ntru_poly_ascii.h" +#include "ntru_common.h" +#include "ntru_mem.h" +#include "ntru_params.h" +#include "ntru_poly.h" #include "ntru_string.h" -#include "params.h" -#include "poly.h" #include diff --git a/src/poly_ascii.h b/src/ntru_poly_ascii.h similarity index 96% rename from src/poly_ascii.h rename to src/ntru_poly_ascii.h index af77c20..e2f64e8 100644 --- a/src/poly_ascii.h +++ b/src/ntru_poly_ascii.h @@ -20,18 +20,18 @@ */ /** - * @file poly_ascii.h - * Header for the internal API of poly_ascii.c. - * @brief header for poly_ascii.c + * @file ntru_poly_ascii.h + * Header for the internal API of ntru_poly_ascii.c. + * @brief header for ntru_poly_ascii.c */ #ifndef NTRU_POLY_ASCII_H_ #define NTRU_POLY_ASCII_H_ -#include "common.h" +#include "ntru_common.h" +#include "ntru_params.h" #include "ntru_string.h" -#include "params.h" #include #include diff --git a/src/rnd.c b/src/ntru_rnd.c similarity index 96% rename from src/rnd.c rename to src/ntru_rnd.c index 924289d..94366cd 100644 --- a/src/rnd.c +++ b/src/ntru_rnd.c @@ -20,15 +20,15 @@ */ /** - * @file rnd.c + * @file ntru_rnd.c * This file allows generation of random polynomials. * @brief random polynomials */ -#include "err.h" #include "math.h" -#include "params.h" -#include "poly.h" +#include "ntru_err.h" +#include "ntru_params.h" +#include "ntru_poly.h" #include #include diff --git a/src/rnd.h b/src/ntru_rnd.h similarity index 93% rename from src/rnd.h rename to src/ntru_rnd.h index aa9ce14..4f9864d 100644 --- a/src/rnd.h +++ b/src/ntru_rnd.h @@ -20,15 +20,15 @@ */ /** - * @file rnd.h - * Header for the internal API of rnd.c. - * @brief header for rnd.c + * @file ntru_rnd.h + * Header for the internal API of ntru_rnd.c. + * @brief header for ntru_rnd.c */ #ifndef NTRU_RND_H #define NTRU_RND_H -#include "params.h" +#include "ntru_params.h" #include