diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/annotated.html b/annotated.html new file mode 100644 index 0000000..ce9ddbe --- /dev/null +++ b/annotated.html @@ -0,0 +1,112 @@ + + +
+ + +
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
keypair | |
ntru_params | |
string |
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
public API, decryption +More...
+Go to the source code of this file.
++Functions | |
string * | ntru_decrypt_string (const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params) |
public API, decryption
+This file holds the public API of decryption of the pqc NTRU implementation and is meant to be installed on the client system.
+ +Definition in file decrypt.h.
+string* ntru_decrypt_string | +( | +const string * | +encr_msg, | +
+ | + | const fmpz_poly_t | +priv_key, | +
+ | + | const fmpz_poly_t | +priv_key_inv, | +
+ | + | const ntru_params * | +params | +
+ | ) | ++ |
Decryption of a given encrypted string.
+encr_msg | the encrypted message in the form of a string |
priv_key | the polynom containing the private key to decrypt the message |
priv_key_inv | the inverse polynome to the private key |
params | the ntru_params |
Decryption of a given encrypted string.
+encr_msg | the encrypted message in the form of a string |
priv_key | the polynom containing the private key to decrypt the message |
priv_key_inv | the inverse polynome to the private key |
params | the ntru_params |
Definition at line 92 of file ntru_decrypt.c.
+ +
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
00001 /* +00002 * Copyright (C) 2014 FH Bielefeld +00003 * +00004 * This file is part of a FH Bielefeld project. +00005 * +00006 * This library is free software; you can redistribute it and/or +00007 * modify it under the terms of the GNU Lesser General Public +00008 * License as published by the Free Software Foundation; either +00009 * version 2.1 of the License, or (at your option) any later version. +00010 * +00011 * This library is distributed in the hope that it will be useful, +00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +00014 * Lesser General Public License for more details. +00015 * +00016 * You should have received a copy of the GNU Lesser General Public +00017 * License along with this library; if not, write to the Free Software +00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +00019 * MA 02110-1301 USA +00020 */ +00021 +00030 #ifndef PUBLIC_NTRU_DECRYPT_H_ +00031 #define PUBLIC_NTRU_DECRYPT_H_ +00032 +00033 +00034 #include "ntru.h" +00035 +00036 #include <fmpz_poly.h> +00037 #include <fmpz.h> +00038 +00039 +00050 string * +00051 ntru_decrypt_string( +00052 const string *encr_msg, +00053 const fmpz_poly_t priv_key, +00054 const fmpz_poly_t priv_key_inv, +00055 const ntru_params *params); +00056 +00057 +00058 #endif /* PUBLIC_NTRU_DECRYPT_H_ */ +
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
public API, encryption +More...
+Go to the source code of this file.
++Functions | |
string * | ntru_encrypt_string (const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params) |
public API, encryption
+This file holds the public API of encryption of the pqc NTRU implementation and is meant to be installed on the client system.
+ +Definition in file encrypt.h.
+string* ntru_encrypt_string | +( | +const string * | +msg, | +
+ | + | const fmpz_poly_t | +pub_key, | +
+ | + | const fmpz_poly_t | +rnd, | +
+ | + | const ntru_params * | +params | +
+ | ) | ++ |
Encrypt a message in the form of a null-terminated char array and return a string.
+msg | the message |
pub_key | the public key |
rnd | the random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1}) |
params | ntru_params the ntru context |
Encrypt a message in the form of a null-terminated char array and return a string.
+msg | the message |
pub_key | the public key |
rnd | the random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1}) |
params | ntru_params the ntru context |
Definition at line 74 of file ntru_encrypt.c.
+ +
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
00001 /* +00002 * Copyright (C) 2014 FH Bielefeld +00003 * +00004 * This file is part of a FH Bielefeld project. +00005 * +00006 * This library is free software; you can redistribute it and/or +00007 * modify it under the terms of the GNU Lesser General Public +00008 * License as published by the Free Software Foundation; either +00009 * version 2.1 of the License, or (at your option) any later version. +00010 * +00011 * This library is distributed in the hope that it will be useful, +00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +00014 * Lesser General Public License for more details. +00015 * +00016 * You should have received a copy of the GNU Lesser General Public +00017 * License along with this library; if not, write to the Free Software +00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +00019 * MA 02110-1301 USA +00020 */ +00021 +00030 #ifndef PUBLIC_NTRU_ENCRYPT_H_ +00031 #define PUBLIC_NTRU_ENCRYPT_H_ +00032 +00033 +00034 #include "ntru.h" +00035 +00036 #include <fmpz_poly.h> +00037 #include <fmpz.h> +00038 +00039 +00051 string * +00052 ntru_encrypt_string( +00053 const string *msg, +00054 const fmpz_poly_t pub_key, +00055 const fmpz_poly_t rnd, +00056 const ntru_params *params); +00057 +00058 +00059 #endif /* PUBLIC_NTRU_ENCRYPT_H_ */ +
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
/home/travis/build/hasufell/pqc/include/decrypt.h [code] | Public API, decryption |
/home/travis/build/hasufell/pqc/include/encrypt.h [code] | Public API, encryption |
/home/travis/build/hasufell/pqc/include/keypair.h [code] | Public API, key handling |
/home/travis/build/hasufell/pqc/include/ntru.h [code] | Public API, basic data types |
/home/travis/build/hasufell/pqc/include/rnd.h [code] | Public API, random polynomials |
/home/travis/build/hasufell/pqc/src/ntru_ascii_poly.c [code] | Ascii to polynomials |
/home/travis/build/hasufell/pqc/src/ntru_ascii_poly.h [code] | Header for ntru_ascii_poly.c |
/home/travis/build/hasufell/pqc/src/ntru_common.h [code] | Common macros/functions |
/home/travis/build/hasufell/pqc/src/ntru_decrypt.c [code] | NTRU decryption |
/home/travis/build/hasufell/pqc/src/ntru_decrypt.h [code] | Header for ntru_decrypt.c |
/home/travis/build/hasufell/pqc/src/ntru_encrypt.c [code] | NTRU encryption |
/home/travis/build/hasufell/pqc/src/ntru_encrypt.h [code] | Header for encrypt.c |
/home/travis/build/hasufell/pqc/src/ntru_err.h [code] | Error handling |
/home/travis/build/hasufell/pqc/src/ntru_file.c [code] | File operations |
/home/travis/build/hasufell/pqc/src/ntru_file.h [code] | Header for ntru_file.c |
/home/travis/build/hasufell/pqc/src/ntru_keypair.c [code] | Key creation and operations |
/home/travis/build/hasufell/pqc/src/ntru_keypair.h [code] | Header for ntru_keypair.c |
/home/travis/build/hasufell/pqc/src/ntru_mem.c [code] | Memory management |
/home/travis/build/hasufell/pqc/src/ntru_mem.h [code] | Header for ntru_mem.c |
/home/travis/build/hasufell/pqc/src/ntru_params.h [code] | NTRU parameters |
/home/travis/build/hasufell/pqc/src/ntru_poly.c [code] | Operations on polynomials |
/home/travis/build/hasufell/pqc/src/ntru_poly.h [code] | Header for ntru_poly.c |
/home/travis/build/hasufell/pqc/src/ntru_poly_ascii.c [code] | Polynomials to acii |
/home/travis/build/hasufell/pqc/src/ntru_poly_ascii.h [code] | Header for ntru_poly_ascii.c |
/home/travis/build/hasufell/pqc/src/ntru_rnd.c [code] | Random polynomials |
/home/travis/build/hasufell/pqc/src/ntru_rnd.h [code] | Header for ntru_rnd.c |
/home/travis/build/hasufell/pqc/src/ntru_string.c [code] | String type and operations |
/home/travis/build/hasufell/pqc/src/ntru_string.h [code] | Header for ntru_string.c |
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
This page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
+/*! Invisible class because of truncation */ +class Invisible { }; + +/*! Truncated class, inheritance relation is hidden */ +class Truncated : public Invisible { }; + +/* Class not documented with doxygen comments */ +class Undocumented { }; + +/*! Class that is inherited using public inheritance */ +class PublicBase : public Truncated { }; + +/*! A template class */ +template<class T> class Templ { }; + +/*! Class that is inherited using protected inheritance */ +class ProtectedBase { }; + +/*! Class that is inherited using private inheritance */ +class PrivateBase { }; + +/*! Class that is used by the Inherited class */ +class Used { }; + +/*! Super class that inherits a number of other classes */ +class Inherited : public PublicBase, + protected ProtectedBase, + private PrivateBase, + public Undocumented, + public Templ<int> +{ + private: + Used *m_usedClass; +}; +
This will result in the following graph:
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
Highly optimized C implementation of the NTRUEncrypt algorithm, using the FLINT library.
+Modern quantum computers will enable us to ride extremely effective attacks on crypto algorithms like rsa. One known attack is the quantum algorithm called Shor's algorithm. In the light of fast paced computer hardware development and known quantum algorithms, it is of importance to find and implement alternatives which are not vulnerable to these attacks.
+One known alternative is called NTRU and will be our main focus. It is lattice-based (shortest vector problem in a lattice). In fact, NTRU is a parametrised family of cryptosystems. As such it is represented by the triple (N, p, q), where N is prime, q is always larger than p and p and q are coprime. As well as four sets of polynomials: a polynomial part of the private key, a polynomial for generation of the public key, the message and a blinding value, respectively, all of degree at most N - 1. It is, in theory, very efficient, since encryption and decryption only use simple polynomial multiplication which are very fast compared to asymmetric encryption schemes.
+Our main goal is to implement an alternative library of the NTRU algorithm in C and gather experience in cryptographic programming. Further, it may help to raise awareness of the need of quantum-secure encryption and enable us to contribute to already present implementations. It may even reveal problems of other implementations and help advancing them. It may as well help with diversity in crypto implementations, which is always a good thing. On top of that we will provide a command-line interface to our library and allow basic operations like key creation and encryption from stdin.
+Optimizing the algorithm itself is not within our scope. However, the library may undergo heavy changes on the mathematical implementation of polynomial arithmetic, in order to optimize run-time behaviour.
+Most of the algorithms in ntru_poly.c, ntru_decrypt.c, ntru_encrypt.c and ntru_keypair.c are based on the pseudo-code from Efficient NTRU Implementations by Colleen Marie O'Rourke.
+Further work is based on Das NTRU-Kryptosystem von Anja Moldenhauer and the official NTRU Cryptosystems Technical Report #14.
+This library was written for Linux systems. Support for windows will not be added. \* FLINT-2.4.3 or later (compiled with gmp and mpfr) \* glib-2.0 \* pkg-config (for the build only)
+\* make \* make install
+See this API doc, the public headers are in the include/ subfolder.
+See Performance Analysis on github.
+\* This library on github \* Original NTRUEncrypt paper \* Efficient NTRU Implementations by Colleen Marie O'Rourke \* Das NTRU-Kryptosystem von Anja Moldenhauer \* NTRU Cryptosystems Technical Report #14 \* The NTRU Cryptosystem: Implementation and Comparative Analysis by Rodney D'Souza \* Wikipedia Article
+
+ post quantum cryptography
+
+
+ Highly optimized implementation of the NTRUEncrypt algorithm
+ |
+
+
+
+
public API, key handling +More...
+#include "ntru.h"
#include <fmpz_poly.h>
#include <fmpz.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
++Data Structures | |
struct | keypair |
+Typedefs | |
typedef struct keypair | keypair |
+Functions | |
bool | ntru_create_keypair (fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params) |
void | export_public_key (char const *const filename, fmpz_poly_t pub, ntru_params *params) |
void | export_priv_key (char const *const filename, fmpz_poly_t priv, ntru_params *params) |
void | import_public_key (char const *const filename, fmpz_poly_t pub, ntru_params *params) |
void | import_priv_key (char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params) |
void | ntru_delete_keypair (keypair *pair) |
public API, key handling
+This file holds the public API of generating, exporting and importing public and private keys of the pqc NTRU implementation and is meant to be installed on the client system.
+ +Definition in file keypair.h.
+void export_priv_key | +( | +char const *const | +filename, | +
+ | + | fmpz_poly_t | +priv, | +
+ | + | ntru_params * | +params | +
+ | ) | ++ |
Export the private key to a file.
+filename | the file to save the private key into |
priv | the private key |
params | the NTRU context |
Definition at line 111 of file ntru_keypair.c.
+ +void export_public_key | +( | +char const *const | +filename, | +
+ | + | fmpz_poly_t | +pub, | +
+ | + | ntru_params * | +params | +
+ | ) | ++ |
Export the public key to a file.
+filename | the file to save the public key into |
pub | the public key |
params | the NTRU context |
Definition at line 96 of file ntru_keypair.c.
+ +void import_priv_key | +( | +char const *const | +filename, | +
+ | + | fmpz_poly_t | +priv, | +
+ | + | fmpz_poly_t | +priv_inv, | +
+ | + | ntru_params * | +params | +
+ | ) | ++ |
Import the private key from a file and store him along with his inverse.
+filename | the file to get the private key from |
priv | where to save the private key [out] |
priv_inv | where to save the inverse of the private key [out] |
params | the NTRU context |
Definition at line 157 of file ntru_keypair.c.
+ +void import_public_key | +( | +char const *const | +filename, | +
+ | + | fmpz_poly_t | +pub, | +
+ | + | ntru_params * | +params | +
+ | ) | ++ |
Import the public key from a file.
+filename | the file to get the public key from |
pub | where to save the public key [out] |
params | the NTRU context |
Definition at line 132 of file ntru_keypair.c.
+ +bool ntru_create_keypair | +( | +fmpz_poly_t | +f, | +
+ | + | fmpz_poly_t | +g, | +
+ | + | keypair * | +pair, | +
+ | + | ntru_params * | +params | +
+ | ) | ++ |
Creates an NTRU key pair, consisting of public and private components.
+f | a random polynomial |
g | a random polynomial |
pair | store private and public components here [out] |
params | the NTRU context |
Creates an NTRU key pair, consisting of public and private components.
+f | a random polynomial |
g | a random polynomial |
pair | store private and public components here [out] |
params | the NTRU context |
Definition at line 47 of file ntru_keypair.c.
+ +void ntru_delete_keypair | +( | +keypair * | +pair | ) | ++ |
Used to free the inner structure of a keypair. This will not call free() on the pair itself.
+pair | the pair to free the inner structure of |
Definition at line 197 of file ntru_keypair.c.
+ +