diff --git a/annotated.html b/annotated.html index 9715b3f..59675c6 100644 --- a/annotated.html +++ b/annotated.html @@ -71,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
@@ -95,7 +95,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
diff --git a/classes.html b/classes.html index 7d94b0c..92530eb 100644 --- a/classes.html +++ b/classes.html @@ -71,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
@@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
diff --git a/decrypt_8h.html b/decrypt_8h.html index fd288a5..bb30df4 100644 --- a/decrypt_8h.html +++ b/decrypt_8h.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/decrypt.h File Reference +post quantum cryptography: decrypt.h File Reference @@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
@@ -78,10 +78,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
-
@@ -99,9 +95,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Include dependency graph for decrypt.h:
-
- - +
+ +

Go to the source code of this file.

@@ -156,33 +152,20 @@ Functions
Parameters
- +
encr_msgthe encrypted message in the form of a string
priv_keythe polynom containing the private key to decrypt the message
priv_keythe polynomial containing the private key to decrypt the message
priv_key_invthe inverse polynome to the private key
paramsthe ntru_params
-
Returns
the decrypted string or NULL on failure
-

Decryption of a given encrypted string.

-
Parameters
- - - - - -
encr_msgthe encrypted message in the form of a string
priv_keythe polynom containing the private key to decrypt the message
priv_key_invthe inverse polynome to the private key
paramsthe ntru_params
-
-
-
Returns
the decrypted string
- -

Definition at line 92 of file ntru_decrypt.c.

+
Returns
the decrypted string or NULL on failure
diff --git a/decrypt_8h__incl.map b/decrypt_8h__incl.map index 1131961..ed86b42 100644 --- a/decrypt_8h__incl.map +++ b/decrypt_8h__incl.map @@ -1,3 +1,3 @@ - - + + diff --git a/decrypt_8h__incl.md5 b/decrypt_8h__incl.md5 index 2f3f458..e7a4a78 100644 --- a/decrypt_8h__incl.md5 +++ b/decrypt_8h__incl.md5 @@ -1 +1 @@ -fb24b66731f4f649376520135129d066 \ No newline at end of file +72dd9c38e8928e631b0cdf7d289bf155 \ No newline at end of file diff --git a/decrypt_8h__incl.png b/decrypt_8h__incl.png index f496123..3f8b8f2 100644 Binary files a/decrypt_8h__incl.png and b/decrypt_8h__incl.png differ diff --git a/decrypt_8h_source.html b/decrypt_8h_source.html index e4e2dc4..1745112 100644 --- a/decrypt_8h_source.html +++ b/decrypt_8h_source.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/decrypt.h Source File +post quantum cryptography: decrypt.h Source File @@ -64,12 +64,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Globals
  • +
    - All Data Structures Files Functions Variables Typedefs Macros Pages
    + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,11 +79,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - -
    decrypt.h
    @@ -129,12 +125,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    57 
    58 #endif /* PUBLIC_NTRU_DECRYPT_H_ */
    public API, basic data types
    -
    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)
    Definition: ntru_decrypt.c:92
    - +
    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)
    +
    diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html deleted file mode 100644 index 8c4caab..0000000 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src Directory Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - -
    - -
    - - -
    -
    -
    -
    src Directory Reference
    -
    -
    -
    -Directory dependency graph for src:
    -
    -
    /home/travis/build/hasufell/pqc/src
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Files

    file  ntru_ascii_poly.c [code]
     ascii to polynomials
     
    file  ntru_ascii_poly.h [code]
     header for ntru_ascii_poly.c
     
    file  ntru_common.h [code]
     common macros/functions
     
    file  ntru_decrypt.c [code]
     NTRU decryption.
     
    file  ntru_decrypt.h [code]
     header for ntru_decrypt.c
     
    file  ntru_encrypt.c [code]
     NTRU encryption.
     
    file  ntru_encrypt.h [code]
     header for encrypt.c
     
    file  ntru_err.h [code]
     error handling
     
    file  ntru_file.c [code]
     file operations
     
    file  ntru_file.h [code]
     header for ntru_file.c
     
    file  ntru_keypair.c [code]
     key creation and operations
     
    file  ntru_keypair.h [code]
     header for ntru_keypair.c
     
    file  ntru_mem.c [code]
     memory management
     
    file  ntru_mem.h [code]
     header for ntru_mem.c
     
    file  ntru_params.h [code]
     NTRU parameters.
     
    file  ntru_poly.c [code]
     operations on polynomials
     
    file  ntru_poly.h [code]
     header for ntru_poly.c
     
    file  ntru_poly_ascii.c [code]
     polynomials to acii
     
    file  ntru_poly_ascii.h [code]
     header for ntru_poly_ascii.c
     
    file  ntru_rnd.c [code]
     random polynomials
     
    file  ntru_rnd.h [code]
     header for ntru_rnd.c
     
    file  ntru_string.c [code]
     string type and operations
     
    file  ntru_string.h [code]
     header for ntru_string.c
     
    -
    - - - - diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map deleted file mode 100644 index d8bb682..0000000 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 deleted file mode 100644 index 0e72bc2..0000000 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 +++ /dev/null @@ -1 +0,0 @@ -ecc0aab54f5ba6a2126063459d871bbe \ No newline at end of file diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png deleted file mode 100644 index 256aacc..0000000 Binary files a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png and /dev/null differ diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html deleted file mode 100644 index 018ca5f..0000000 --- a/dir_d44c64559bbebec7f509842c48db8b23.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/include Directory Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - -
    - -
    - - -
    -
    -
    -
    include Directory Reference
    -
    -
    -
    -Directory dependency graph for include:
    -
    -
    /home/travis/build/hasufell/pqc/include
    - - -
    - - - - - - - - - - - - - - - - - -

    -Files

    file  decrypt.h [code]
     public API, decryption
     
    file  encrypt.h [code]
     public API, encryption
     
    file  keypair.h [code]
     public API, key handling
     
    file  ntru.h [code]
     public API, basic data types
     
    file  rnd.h [code]
     public API, random polynomials
     
    -
    - - - - diff --git a/dir_d44c64559bbebec7f509842c48db8b23_dep.map b/dir_d44c64559bbebec7f509842c48db8b23_dep.map deleted file mode 100644 index b0b0095..0000000 --- a/dir_d44c64559bbebec7f509842c48db8b23_dep.map +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 b/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 deleted file mode 100644 index dc87a87..0000000 --- a/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 +++ /dev/null @@ -1 +0,0 @@ -0949ded2bc36ea9f7de2d964cd6cf98d \ No newline at end of file diff --git a/dir_d44c64559bbebec7f509842c48db8b23_dep.png b/dir_d44c64559bbebec7f509842c48db8b23_dep.png deleted file mode 100644 index 8332be9..0000000 Binary files a/dir_d44c64559bbebec7f509842c48db8b23_dep.png and /dev/null differ diff --git a/doxygen_8dox.html b/doxygen_8dox.html index 64442ba..3cd9ebb 100644 --- a/doxygen_8dox.html +++ b/doxygen_8dox.html @@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    diff --git a/encrypt_8h.html b/encrypt_8h.html index 3862df0..60a3a84 100644 --- a/encrypt_8h.html +++ b/encrypt_8h.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/encrypt.h File Reference +post quantum cryptography: encrypt.h File Reference @@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,10 +78,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -
    @@ -99,9 +95,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Include dependency graph for encrypt.h:
    -
    - - +
    + +

    Go to the source code of this file.

    @@ -162,27 +158,14 @@ Functions -
    Returns
    the newly allocated encrypted string, NULL on failure
    -

    Encrypt a message in the form of a null-terminated char array and return a string.

    -
    Parameters
    - - - - - -
    msgthe message
    pub_keythe public key
    rndthe random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1})
    paramsntru_params the ntru context
    -
    -
    -
    Returns
    the newly allocated encrypted string
    - -

    Definition at line 74 of file ntru_encrypt.c.

    +
    Returns
    the newly allocated encrypted string, NULL on failure
    diff --git a/encrypt_8h__incl.map b/encrypt_8h__incl.map index 077af7d..cc642c3 100644 --- a/encrypt_8h__incl.map +++ b/encrypt_8h__incl.map @@ -1,3 +1,3 @@ - - + + diff --git a/encrypt_8h__incl.md5 b/encrypt_8h__incl.md5 index 2f576d6..96c3e4e 100644 --- a/encrypt_8h__incl.md5 +++ b/encrypt_8h__incl.md5 @@ -1 +1 @@ -6aad9be46b94806b9b3f39bcf0b88dd9 \ No newline at end of file +d865c2c2cae936ced9a44350d42213b0 \ No newline at end of file diff --git a/encrypt_8h__incl.png b/encrypt_8h__incl.png index d3d9ec7..cdfdd1e 100644 Binary files a/encrypt_8h__incl.png and b/encrypt_8h__incl.png differ diff --git a/encrypt_8h_source.html b/encrypt_8h_source.html index c9da5ea..811021d 100644 --- a/encrypt_8h_source.html +++ b/encrypt_8h_source.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/encrypt.h Source File +post quantum cryptography: encrypt.h Source File @@ -64,12 +64,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Globals
  • + + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,11 +79,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - -
    encrypt.h
    @@ -128,13 +124,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    57 
    58 
    59 #endif /* PUBLIC_NTRU_ENCRYPT_H_ */
    -
    string * ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params)
    Definition: ntru_encrypt.c:74
    +
    string * ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params)
    public API, basic data types
    - +
    diff --git a/files.html b/files.html index 150da6b..60ffb68 100644 --- a/files.html +++ b/files.html @@ -70,7 +70,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -85,43 +85,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Here is a list of all files with brief descriptions:
    -
    [detail level 12]
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
      include
     decrypt.hPublic API, decryption
     encrypt.hPublic API, encryption
     keypair.hPublic API, key handling
     ntru.hPublic API, basic data types
     rnd.hPublic API, random polynomials
      src
     ntru_ascii_poly.cAscii to polynomials
     ntru_ascii_poly.hHeader for ntru_ascii_poly.c
     ntru_common.hCommon macros/functions
     ntru_decrypt.cNTRU decryption
     ntru_decrypt.hHeader for ntru_decrypt.c
     ntru_encrypt.cNTRU encryption
     ntru_encrypt.hHeader for encrypt.c
     ntru_err.hError handling
     ntru_file.cFile operations
     ntru_file.hHeader for ntru_file.c
     ntru_keypair.cKey creation and operations
     ntru_keypair.hHeader for ntru_keypair.c
     ntru_mem.cMemory management
     ntru_mem.hHeader for ntru_mem.c
     ntru_params.hNTRU parameters
     ntru_poly.cOperations on polynomials
     ntru_poly.hHeader for ntru_poly.c
     ntru_poly_ascii.cPolynomials to acii
     ntru_poly_ascii.hHeader for ntru_poly_ascii.c
     ntru_rnd.cRandom polynomials
     ntru_rnd.hHeader for ntru_rnd.c
     ntru_string.cString type and operations
     ntru_string.hHeader for ntru_string.c
    + + + + +
     decrypt.hPublic API, decryption
     encrypt.hPublic API, encryption
     keypair.hPublic API, key handling
     ntru.hPublic API, basic data types
     rnd.hPublic API, random polynomials
    diff --git a/functions.html b/functions.html index 33afa0c..869e472 100644 --- a/functions.html +++ b/functions.html @@ -77,7 +77,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : keypair
  • ptr -: string +: string
  • pub : keypair @@ -116,7 +116,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • diff --git a/functions_vars.html b/functions_vars.html index 340c400..caa9620 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -77,7 +77,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : keypair
  • ptr -: string +: string
  • pub : keypair @@ -116,7 +116,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • diff --git a/globals.html b/globals.html index 5d4b123..18377a2 100644 --- a/globals.html +++ b/globals.html @@ -69,24 +69,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • All
  • Functions
  • Typedefs
  • -
  • Macros
  • - - - @@ -95,7 +77,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -105,300 +87,84 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -
    Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
    - -

    - a -

    - - -

    - b -

    - - -

    - c -

    - - -

    - e -

    diff --git a/globals_defs.html b/globals_defs.html deleted file mode 100644 index 2428dfe..0000000 --- a/globals_defs.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - -post quantum cryptography: Globals - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - -
    - - - - -
    - -
    - -
    -
    - - - - diff --git a/globals_func.html b/globals_func.html index 3adfe30..5eeafb8 100644 --- a/globals_func.html +++ b/globals_func.html @@ -69,22 +69,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • All
  • Functions
  • Typedefs
  • -
  • Macros
  • - - - @@ -93,7 +77,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -103,256 +87,75 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -  - -

    - a -

    - - -

    - b -

    - - -

    - e -

    diff --git a/globals_type.html b/globals_type.html index e0baf46..0f3f60a 100644 --- a/globals_type.html +++ b/globals_type.html @@ -69,7 +69,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • All
  • Functions
  • Typedefs
  • -
  • Macros
  • @@ -78,7 +77,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -90,22 +89,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
     
    diff --git a/graph_legend.html b/graph_legend.html index 086943f..cf7b550 100644 --- a/graph_legend.html +++ b/graph_legend.html @@ -64,7 +64,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages
    + All Data Structures Files Functions Variables Typedefs Pages
    @@ -144,7 +144,7 @@ A yellow dashed arrow denotes a relation between a template instance and the tem
    diff --git a/index.html b/index.html index 15d4b05..30cddaa 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -105,7 +105,7 @@ Goals

    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.

    Algorithms

    -

    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.

    +

    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.

    License

    @@ -143,7 +143,7 @@ References
    diff --git a/keypair_8h.html b/keypair_8h.html index b5cb677..a8647f7 100644 --- a/keypair_8h.html +++ b/keypair_8h.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/keypair.h File Reference +post quantum cryptography: keypair.h File Reference @@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,10 +78,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -
    @@ -103,9 +99,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Include dependency graph for keypair.h:
    -
    - - +
    + +

    Go to the source code of this file.

    @@ -195,8 +191,6 @@ Functions -

    Definition at line 111 of file ntru_keypair.c.

    -
    @@ -238,8 +232,6 @@ Functions -

    Definition at line 96 of file ntru_keypair.c.

    - @@ -288,8 +280,6 @@ Functions -

    Definition at line 157 of file ntru_keypair.c.

    - @@ -330,8 +320,6 @@ Functions -

    Definition at line 132 of file ntru_keypair.c.

    - @@ -370,16 +358,6 @@ Functions

    Creates an NTRU key pair, consisting of public and private components.

    -
    Parameters
    - - - - - -
    fa random polynomial
    ga random polynomial
    pairstore private and public components here [out]
    paramsthe NTRU context
    -
    -
    -

    Creates an NTRU key pair, consisting of public and private components.

    Parameters
    @@ -389,9 +367,6 @@ Functions
    fa random polynomial
    -
    Returns
    true for success, false if f or g are not invertible (then the caller hast to try different ones)
    - -

    Definition at line 47 of file ntru_keypair.c.

    @@ -416,14 +391,12 @@ Functions -

    Definition at line 197 of file ntru_keypair.c.

    - diff --git a/keypair_8h__incl.map b/keypair_8h__incl.map index 18fd83f..a7d1cbd 100644 --- a/keypair_8h__incl.map +++ b/keypair_8h__incl.map @@ -1,3 +1,3 @@ - - + + diff --git a/keypair_8h__incl.md5 b/keypair_8h__incl.md5 index 0997380..f2c08fb 100644 --- a/keypair_8h__incl.md5 +++ b/keypair_8h__incl.md5 @@ -1 +1 @@ -2b4a3f942ca05de6bc8500cbf9030539 \ No newline at end of file +5244a16f466f27cefc219ec159829f7d \ No newline at end of file diff --git a/keypair_8h__incl.png b/keypair_8h__incl.png index fa347ca..749a6b7 100644 Binary files a/keypair_8h__incl.png and b/keypair_8h__incl.png differ diff --git a/keypair_8h_source.html b/keypair_8h_source.html index a8e8e05..b7fa85c 100644 --- a/keypair_8h_source.html +++ b/keypair_8h_source.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/keypair.h Source File +post quantum cryptography: keypair.h Source File @@ -64,12 +64,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Globals
  • + + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,11 +79,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - -
    keypair.h
    @@ -123,10 +119,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    42 typedef struct keypair keypair;
    43 
    44 
    -
    49 struct keypair {
    -
    54  fmpz_poly_t priv;
    -
    59  fmpz_poly_t priv_inv;
    -
    64  fmpz_poly_t pub;
    +
    49 struct keypair {
    +
    54  fmpz_poly_t priv;
    +
    59  fmpz_poly_t priv_inv;
    +
    64  fmpz_poly_t pub;
    65 };
    66 
    67 
    @@ -163,22 +159,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    144 
    145 
    146 #endif /* PUBLIC_NTRU_KEYPAIR_H_ */
    -
    void ntru_delete_keypair(keypair *pair)
    Definition: ntru_keypair.c:197
    -
    void import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params)
    Definition: ntru_keypair.c:157
    +
    void ntru_delete_keypair(keypair *pair)
    +
    void import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params)
    public API, basic data types
    -
    void export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params)
    Definition: ntru_keypair.c:111
    -
    bool ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params)
    Definition: ntru_keypair.c:47
    - -
    fmpz_poly_t priv_inv
    Definition: ntru_keypair.h:56
    -
    void import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    Definition: ntru_keypair.c:132
    -
    fmpz_poly_t pub
    Definition: ntru_keypair.h:61
    -
    fmpz_poly_t priv
    Definition: ntru_keypair.h:51
    - -
    void export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    Definition: ntru_keypair.c:96
    +
    void export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params)
    +
    bool ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params)
    + +
    fmpz_poly_t priv_inv
    Definition: keypair.h:59
    +
    void import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    +
    fmpz_poly_t pub
    Definition: keypair.h:64
    +
    fmpz_poly_t priv
    Definition: keypair.h:54
    + +
    void export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    diff --git a/ntru_8h.html b/ntru_8h.html index 5636ffb..7983ec7 100644 --- a/ntru_8h.html +++ b/ntru_8h.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/ntru.h File Reference +post quantum cryptography: ntru.h File Reference @@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,10 +78,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -
    @@ -101,8 +97,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Include dependency graph for ntru.h:
    -
    - +
    +
    @@ -201,8 +197,6 @@ Functions -

    Definition at line 123 of file ntru_poly.c.

    -
    @@ -237,8 +231,6 @@ Functions -

    Definition at line 149 of file ntru_poly.c.

    - @@ -262,8 +254,6 @@ Functions -

    Definition at line 131 of file ntru_poly.c.

    - @@ -287,8 +277,6 @@ Functions -

    Definition at line 574 of file ntru_poly.c.

    - @@ -312,8 +300,6 @@ Functions -

    Definition at line 583 of file ntru_poly.c.

    - @@ -356,8 +342,6 @@ Functions
    Returns
    newly allocated polynomial pointer, must be freed with fmpz_poly_clear()
    -

    Definition at line 110 of file ntru_poly.c.

    - @@ -381,8 +365,6 @@ Functions -

    Definition at line 37 of file ntru_string.c.

    - @@ -405,17 +387,7 @@ Functions -
    Returns
    a newly allocated string which must be freed by the caller or NULL on failure
    -

    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.

    +
    Returns
    a newly allocated string which must be freed by the caller or NULL on failure
    @@ -440,8 +412,6 @@ Functions -

    Definition at line 47 of file ntru_string.c.

    - @@ -468,14 +438,6 @@ Functions

    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
    -
    -
    -

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

    Parameters
    @@ -483,16 +445,13 @@ Functions
    wstringthe string to write to the file
    -
    Returns
    true for success or false for failure if fopen or fclose failed
    - -

    Definition at line 107 of file ntru_file.c.

    diff --git a/ntru_8h__incl.map b/ntru_8h__incl.map index 6ce85f8..508e53e 100644 --- a/ntru_8h__incl.map +++ b/ntru_8h__incl.map @@ -1,2 +1,2 @@ - + diff --git a/ntru_8h__incl.md5 b/ntru_8h__incl.md5 index 9896a1d..4fbaf23 100644 --- a/ntru_8h__incl.md5 +++ b/ntru_8h__incl.md5 @@ -1 +1 @@ -eacd6dc5eb22433d8cb012ec28b3ce8a \ No newline at end of file +4f58550f1bf3fc0e7a21db75f42bafb9 \ No newline at end of file diff --git a/ntru_8h__incl.png b/ntru_8h__incl.png index b187fb0..67634e1 100644 Binary files a/ntru_8h__incl.png and b/ntru_8h__incl.png differ diff --git a/ntru_8h_source.html b/ntru_8h_source.html index 217c038..de1d531 100644 --- a/ntru_8h_source.html +++ b/ntru_8h_source.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/ntru.h Source File +post quantum cryptography: ntru.h Source File @@ -64,12 +64,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Globals
  • + + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,11 +79,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - -
    ntru.h
    @@ -122,15 +118,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    40 typedef struct string string;
    41 
    42 
    -
    47 struct ntru_params {
    -
    52  uint32_t N;
    -
    56  uint32_t q;
    -
    60  uint32_t p;
    +
    47 struct ntru_params {
    +
    52  uint32_t N;
    +
    56  uint32_t q;
    +
    60  uint32_t p;
    61 };
    62 
    -
    66 struct string {
    -
    74  char *ptr;
    -
    78  size_t len;
    +
    66 struct string {
    +
    74  char *ptr;
    +
    78  size_t len;
    79 };
    80 
    81 
    @@ -168,27 +164,27 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    186 
    187 
    188 #endif /* NTRU_NTRU_H_ */
    -
    void string_delete(string *del_string)
    Definition: ntru_string.c:47
    -
    void poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len)
    Definition: ntru_poly.c:110
    -
    size_t len
    Definition: ntru_string.h:53
    -
    void poly_delete_array(fmpz_poly_t **poly_array)
    Definition: ntru_poly.c:131
    -
    uint32_t N
    Definition: ntru_params.h:48
    -
    void poly_draw(const fmpz_poly_t poly)
    Definition: ntru_poly.c:574
    -
    void poly_delete_all(fmpz_poly_t poly,...)
    Definition: ntru_poly.c:149
    -
    uint32_t p
    Definition: ntru_params.h:56
    - -
    void write_file(string const *wstring, char const *const filename)
    Definition: ntru_file.c:107
    -
    void prints(const string *print_string)
    Definition: ntru_string.c:37
    - -
    uint32_t q
    Definition: ntru_params.h:52
    -
    string * read_file(char const *const filename)
    Definition: ntru_file.c:50
    -
    void poly_delete(fmpz_poly_t poly)
    Definition: ntru_poly.c:123
    -
    char * ptr
    Definition: ntru_string.h:49
    -
    void poly_draw_pretty(const fmpz_poly_t poly)
    Definition: ntru_poly.c:583
    +
    void string_delete(string *del_string)
    +
    void poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len)
    +
    size_t len
    Definition: ntru.h:78
    +
    char * ptr
    Definition: ntru.h:74
    +
    void poly_delete_array(fmpz_poly_t **poly_array)
    +
    uint32_t N
    Definition: ntru.h:52
    +
    void poly_draw(const fmpz_poly_t poly)
    +
    void poly_delete_all(fmpz_poly_t poly,...)
    +
    uint32_t p
    Definition: ntru.h:60
    + +
    void write_file(string const *wstring, char const *const filename)
    +
    void prints(const string *print_string)
    +
    Definition: ntru.h:66
    +
    uint32_t q
    Definition: ntru.h:56
    +
    string * read_file(char const *const filename)
    +
    void poly_delete(fmpz_poly_t poly)
    +
    void poly_draw_pretty(const fmpz_poly_t poly)
    diff --git a/ntru__ascii__poly_8c.html b/ntru__ascii__poly_8c.html deleted file mode 100644 index f8973c7..0000000 --- a/ntru__ascii__poly_8c.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_ascii_poly.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_ascii_poly.c File Reference
    -
    -
    - -

    ascii to polynomials -More...

    -
    #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 <glib.h>
    -#include <stdint.h>
    -#include <stdlib.h>
    -#include <string.h>
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_ascii_poly.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - -

    -Functions

    static char * get_int_to_bin_str (uint8_t value)
     
    fmpz_poly_t * ascii_bin_to_bin_poly (const char *to_poly, const ntru_params *params)
     
    fmpz_poly_t ** ascii_to_bin_poly_arr (const string *to_poly, const ntru_params *params)
     
    fmpz_poly_t ** base64_to_poly_arr (const string *to_poly, const ntru_params *params)
     
    -

    Detailed Description

    -

    ascii to polynomials

    -

    This file allows to convert ascii strings, including base64 encoded ones, to polynomials.

    - -

    Definition in file ntru_ascii_poly.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    fmpz_poly_t* ascii_bin_to_bin_poly (const char * to_poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a "binary" ascii string to a binary polyomial. The ascii string will be converted to a binary representation and the following mapping will apply between binary -> poly:

    -

    1 => 1

    -

    0 => -1

    -

    If the polynomial is of degree less than N -1, then it will be filled with trailing 2's for later use in bin_poly_to_ascii().

    -
    Parameters
    - - - -
    to_polythe string to get into binary polynomial format
    paramsthe NTRUEncrypt context
    -
    -
    -
    Returns
    newly allocated array of binary polynomials
    - -

    Definition at line 81 of file ntru_ascii_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    fmpz_poly_t** ascii_to_bin_poly_arr (const stringto_poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert an ascii string to an array of binary polyomials. The ascii string will be converted to a binary representation and the following mapping will apply between binary -> poly:

    -

    1 => 1

    -

    0 => -1

    -

    If the last polynomial is of degree less than N -1, then it will be filled with trailing 2's for later use in bin_poly_arr_to_ascii().

    -
    Parameters
    - - - -
    to_polythe string to get into binary polynomial format
    paramsthe NTRUEncrypt context
    -
    -
    -
    Returns
    newly allocated array of binary polynomials
    - -

    Definition at line 101 of file ntru_ascii_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    fmpz_poly_t** base64_to_poly_arr (const stringto_poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert an base64 encoded string to an array of polyomials with coefficients which are expected to be in the range [0, q-1]. The chars will be converted (after decoding) to their integer representation and directly put into the coefficients.

    -

    If the last polynomial is of degree less than N -1, then it will be filled with trailing q's for later user in poly_arr_to_base64().

    -
    Parameters
    - - - -
    to_polythe string to get into polynomial format, which is of type string, so we can iterate safely over it (the string might have null-bytes in the middle of it)
    paramsthe NTRUEncrypt context
    -
    -
    -
    Returns
    newly allocated array of polynomials
    - -

    Definition at line 146 of file ntru_ascii_poly.c.

    - -
    -
    - -
    -
    - - - - - -
    - - - - - - - - -
    static char * get_int_to_bin_str (uint8_t value)
    -
    -static
    -
    -

    Convert an integer to it's binary representation as a string and return it.

    -

    As in: 90 => "10110101"

    -
    Parameters
    - - -
    valuethe integer to convert
    -
    -
    -
    Returns
    the binary representation as a newly allocated string
    - -

    Definition at line 62 of file ntru_ascii_poly.c.

    - -
    -
    -
    - - - - diff --git a/ntru__ascii__poly_8c__incl.map b/ntru__ascii__poly_8c__incl.map deleted file mode 100644 index 2cf929d..0000000 --- a/ntru__ascii__poly_8c__incl.map +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ntru__ascii__poly_8c__incl.md5 b/ntru__ascii__poly_8c__incl.md5 deleted file mode 100644 index c67d638..0000000 --- a/ntru__ascii__poly_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -4b96241be94029950c1b05fd20de29d0 \ No newline at end of file diff --git a/ntru__ascii__poly_8c__incl.png b/ntru__ascii__poly_8c__incl.png deleted file mode 100644 index fcd7075..0000000 Binary files a/ntru__ascii__poly_8c__incl.png and /dev/null differ diff --git a/ntru__ascii__poly_8c_source.html b/ntru__ascii__poly_8c_source.html deleted file mode 100644 index e418cc9..0000000 --- a/ntru__ascii__poly_8c_source.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_ascii_poly.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_ascii_poly.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_ascii_poly.h"
    -
    30 #include "ntru_common.h"
    -
    31 #include "ntru_mem.h"
    -
    32 #include "ntru_params.h"
    -
    33 #include "ntru_poly.h"
    -
    34 #include "ntru_string.h"
    -
    35 
    -
    36 #include <glib.h>
    -
    37 
    -
    38 #include <stdint.h>
    -
    39 #include <stdlib.h>
    -
    40 #include <string.h>
    -
    41 
    -
    42 #include <fmpz_poly.h>
    -
    43 #include <fmpz.h>
    -
    44 
    -
    45 
    -
    55 static char *
    -
    56 get_int_to_bin_str(uint8_t value);
    -
    57 
    -
    58 
    -
    59 /*------------------------------------------------------------------------*/
    -
    60 
    -
    61 static char *
    -
    62 get_int_to_bin_str(uint8_t value)
    -
    63 {
    -
    64  int i;
    -
    65  const size_t bin_string_size = ASCII_BITS + 1;
    -
    66  char *bin_string = ntru_malloc(sizeof(*bin_string) *
    -
    67  (bin_string_size)); /* account for trailing null-byte */
    -
    68 
    -
    69  /* terminate properly */
    -
    70  bin_string[bin_string_size - 1] = '\0';
    -
    71 
    -
    72  for (i = ASCII_BITS - 1; i >= 0; --i, value >>= 1)
    -
    73  bin_string[i] = (value & 1) + '0';
    -
    74 
    -
    75  return bin_string;
    -
    76 }
    -
    77 
    -
    78 /*------------------------------------------------------------------------*/
    -
    79 
    -
    80 fmpz_poly_t *
    -
    81 ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params)
    -
    82 {
    -
    83  uint32_t i = 0;
    -
    84  fmpz_poly_t *new_poly = ntru_malloc(sizeof(*new_poly));
    -
    85 
    -
    86  fmpz_poly_init(*new_poly);
    -
    87 
    -
    88  while (to_poly[i] && i < params->N) {
    -
    89  fmpz_poly_set_coeff_si(*new_poly,
    -
    90  i,
    -
    91  (to_poly[i] == '0') ? -1 : 1);
    -
    92  i++;
    -
    93  }
    -
    94 
    -
    95  return new_poly;
    -
    96 }
    -
    97 
    -
    98 /*------------------------------------------------------------------------*/
    -
    99 
    -
    100 fmpz_poly_t **
    -
    101 ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params)
    -
    102 {
    -
    103  char *cur = to_poly->ptr;
    -
    104  char *out = ntru_malloc(CHAR_SIZE * (to_poly->len * ASCII_BITS + 1));
    -
    105  uint32_t polyc = 0;
    -
    106  size_t out_len = 0;
    -
    107  fmpz_poly_t **poly_array;
    -
    108 
    -
    109  for (uint32_t i = 0; i < to_poly->len; i++) {
    -
    110  char *tmp_string = get_int_to_bin_str((int)(*cur));
    -
    111  memcpy(out + out_len, tmp_string, ASCII_BITS);
    -
    112  out_len += ASCII_BITS;
    -
    113  cur++;
    -
    114  free(tmp_string);
    -
    115  }
    -
    116  out[out_len] = '\0';
    -
    117 
    -
    118  poly_array = ntru_malloc(sizeof(**poly_array) *
    -
    119  (strlen(out) / params->N + 1));
    -
    120 
    -
    121  for (uint32_t i = 0; i < out_len; i += params->N) {
    -
    122  char chunk[params->N + 1];
    -
    123  size_t real_chunk_size;
    -
    124 
    -
    125  real_chunk_size =
    -
    126  (out_len - i > params->N) ? params->N : out_len - i;
    -
    127 
    -
    128  memcpy(chunk, out + i, real_chunk_size);
    -
    129  chunk[real_chunk_size] = '\0';
    -
    130 
    -
    131  poly_array[polyc] = ascii_bin_to_bin_poly(chunk, params);
    -
    132 
    -
    133  polyc++;
    -
    134  }
    -
    135 
    -
    136  free(out);
    -
    137 
    -
    138  poly_array[polyc] = NULL;
    -
    139 
    -
    140  return poly_array;
    -
    141 }
    -
    142 
    -
    143 /*------------------------------------------------------------------------*/
    -
    144 
    -
    145 fmpz_poly_t **
    -
    146 base64_to_poly_arr(const string *to_poly, const ntru_params *params)
    -
    147 {
    -
    148  uint32_t i = 0,
    -
    149  polyc = 0;
    -
    150  gsize out_len;
    -
    151  guchar *base64_decoded = NULL,
    -
    152  *base_tmp = NULL;
    -
    153  string *new_string = ntru_malloc(sizeof(*new_string));
    -
    154  fmpz_poly_t **poly_array;
    -
    155  char *tmp = ntru_malloc(sizeof(char) * (to_poly->len + 1));
    -
    156 
    -
    157  /* g_base64_decode() needs it null-terminated */
    -
    158  memcpy(tmp, to_poly->ptr, to_poly->len);
    -
    159  tmp[to_poly->len] = '\0';
    -
    160 
    -
    161  base_tmp = g_base64_decode((const gchar *)tmp, &out_len);
    -
    162 
    -
    163  /* g_base64_decode() needs it null-terminated */
    -
    164  REALLOC(tmp, sizeof(char) * (out_len + 1));
    -
    165  memcpy(tmp, base_tmp, out_len);
    -
    166  tmp[out_len] = '\0';
    -
    167 
    -
    168  base64_decoded = g_base64_decode((const gchar *)tmp, &out_len);
    -
    169 
    -
    170  new_string->ptr = (char *)base64_decoded;
    -
    171  new_string->len = (unsigned long)(out_len);
    -
    172 
    -
    173  poly_array = ntru_malloc(sizeof(**poly_array) *
    -
    174  (new_string->len / params->N));
    -
    175 
    -
    176  while (i < new_string->len) {
    -
    177  uint32_t j = 0;
    -
    178  fmpz_poly_t *new_poly = ntru_malloc(sizeof(*new_poly));
    -
    179 
    -
    180  fmpz_poly_init(*new_poly);
    -
    181 
    -
    182  while (j < params->N) {
    -
    183  fmpz_poly_set_coeff_si(*new_poly,
    -
    184  j,
    -
    185  (uint8_t)(base64_decoded[i]));
    -
    186  j++;
    -
    187  i++;
    -
    188  }
    -
    189 
    -
    190  /* fill the last poly with q (which is a non-standard
    -
    191  * coefficient) */
    -
    192  for (uint32_t k = j; k < params->N; k++) {
    -
    193  fmpz_poly_set_coeff_si(*new_poly,
    -
    194  k,
    -
    195  params->q);
    -
    196  }
    -
    197 
    -
    198  poly_array[polyc] = new_poly;
    -
    199  polyc++;
    -
    200  }
    -
    201 
    -
    202  poly_array[polyc] = NULL;
    -
    203 
    -
    204  string_delete(new_string);
    -
    205  free(base_tmp);
    -
    206  free(tmp);
    -
    207 
    -
    208  return poly_array;
    -
    209 }
    -
    fmpz_poly_t ** ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params)
    -
    #define ASCII_BITS
    Definition: ntru_common.h:38
    -
    void string_delete(string *del_string)
    Definition: ntru_string.c:47
    -
    size_t len
    Definition: ntru_string.h:53
    -
    uint32_t N
    Definition: ntru_params.h:48
    -
    fmpz_poly_t ** base64_to_poly_arr(const string *to_poly, const ntru_params *params)
    - -
    header for ntru_mem.c
    -
    NTRU parameters.
    -
    #define REALLOC(ptr, size)
    Definition: ntru_mem.h:38
    -
    common macros/functions
    -
    static char * get_int_to_bin_str(uint8_t value)
    -
    void * ntru_malloc(size_t size)
    Definition: ntru_mem.c:38
    -
    uint32_t q
    Definition: ntru_params.h:52
    -
    header for ntru_string.c
    -
    #define CHAR_SIZE
    Definition: ntru_common.h:37
    -
    char * ptr
    Definition: ntru_string.h:49
    -
    fmpz_poly_t * ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params)
    -
    header for ntru_poly.c
    -
    header for ntru_ascii_poly.c
    -
    - - - - diff --git a/ntru__ascii__poly_8h.html b/ntru__ascii__poly_8h.html deleted file mode 100644 index a1f9b3b..0000000 --- a/ntru__ascii__poly_8h.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_ascii_poly.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_ascii_poly.h File Reference
    -
    -
    - -

    header for ntru_ascii_poly.c -More...

    -
    #include "ntru_common.h"
    -#include "ntru_string.h"
    -#include "ntru_params.h"
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_ascii_poly.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - -

    -Functions

    fmpz_poly_t * ascii_bin_to_bin_poly (const char *to_poly, const ntru_params *params)
     
    fmpz_poly_t ** ascii_to_bin_poly_arr (const string *to_poly, const ntru_params *params)
     
    fmpz_poly_t ** base64_to_poly_arr (const string *to_poly, const ntru_params *params)
     
    -

    Detailed Description

    -

    header for ntru_ascii_poly.c

    -

    Header for the internal API of ntru_ascii_poly.c.

    - -

    Definition in file ntru_ascii_poly.h.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    fmpz_poly_t* ascii_bin_to_bin_poly (const char * to_poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a "binary" ascii string to a binary polyomial. The ascii string will be converted to a binary representation and the following mapping will apply between binary -> poly:

    -

    1 => 1

    -

    0 => -1

    -

    If the polynomial is of degree less than N -1, then it will be filled with trailing 2's for later use in bin_poly_to_ascii().

    -
    Parameters
    - - - -
    to_polythe string to get into binary polynomial format
    paramsthe NTRUEncrypt context
    -
    -
    -
    Returns
    newly allocated array of binary polynomials
    - -

    Definition at line 81 of file ntru_ascii_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    fmpz_poly_t** ascii_to_bin_poly_arr (const stringto_poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert an ascii string to an array of binary polyomials. The ascii string will be converted to a binary representation and the following mapping will apply between binary -> poly:

    -

    1 => 1

    -

    0 => -1

    -

    If the last polynomial is of degree less than N -1, then it will be filled with trailing 2's for later use in bin_poly_arr_to_ascii().

    -
    Parameters
    - - - -
    to_polythe string to get into binary polynomial format
    paramsthe NTRUEncrypt context
    -
    -
    -
    Returns
    newly allocated array of binary polynomials
    - -

    Definition at line 101 of file ntru_ascii_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    fmpz_poly_t** base64_to_poly_arr (const stringto_poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert an base64 encoded string to an array of polyomials with coefficients which are expected to be in the range [0, q-1]. The chars will be converted (after decoding) to their integer representation and directly put into the coefficients.

    -

    If the last polynomial is of degree less than N -1, then it will be filled with trailing q's for later user in poly_arr_to_base64().

    -
    Parameters
    - - - -
    to_polythe string to get into polynomial format, which is of type string, so we can iterate safely over it (the string might have null-bytes in the middle of it)
    paramsthe NTRUEncrypt context
    -
    -
    -
    Returns
    newly allocated array of polynomials
    - -

    Definition at line 146 of file ntru_ascii_poly.c.

    - -
    -
    -
    - - - - diff --git a/ntru__ascii__poly_8h__incl.map b/ntru__ascii__poly_8h__incl.map deleted file mode 100644 index 9e56527..0000000 --- a/ntru__ascii__poly_8h__incl.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/ntru__ascii__poly_8h__incl.md5 b/ntru__ascii__poly_8h__incl.md5 deleted file mode 100644 index 90f3b99..0000000 --- a/ntru__ascii__poly_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -81e7fc7cf2132dda2768b24004a75bbb \ No newline at end of file diff --git a/ntru__ascii__poly_8h__incl.png b/ntru__ascii__poly_8h__incl.png deleted file mode 100644 index 6dd7055..0000000 Binary files a/ntru__ascii__poly_8h__incl.png and /dev/null differ diff --git a/ntru__ascii__poly_8h_source.html b/ntru__ascii__poly_8h_source.html deleted file mode 100644 index 09c96af..0000000 --- a/ntru__ascii__poly_8h_source.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_ascii_poly.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_ascii_poly.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_ASCII_POLY_H_
    -
    29 #define NTRU_ASCII_POLY_H_
    -
    30 
    -
    31 
    -
    32 #include "ntru_common.h"
    -
    33 #include "ntru_string.h"
    -
    34 #include "ntru_params.h"
    -
    35 
    -
    36 #include <fmpz_poly.h>
    -
    37 #include <fmpz.h>
    -
    38 
    -
    39 
    -
    56 fmpz_poly_t *
    -
    57 ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params);
    -
    58 
    -
    75 fmpz_poly_t **
    -
    76 ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params);
    -
    77 
    -
    93 fmpz_poly_t **
    -
    94 base64_to_poly_arr(const string *to_poly, const ntru_params *params);
    -
    95 
    -
    96 
    -
    97 #endif /* NTRU_ASCII_POLY_H_ */
    -
    fmpz_poly_t ** ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params)
    - -
    NTRU parameters.
    -
    common macros/functions
    -
    fmpz_poly_t ** base64_to_poly_arr(const string *to_poly, const ntru_params *params)
    -
    header for ntru_string.c
    -
    fmpz_poly_t * ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params)
    -
    - - - - diff --git a/ntru__common_8h.html b/ntru__common_8h.html deleted file mode 100644 index df2ba36..0000000 --- a/ntru__common_8h.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_common.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_common.h File Reference
    -
    -
    - -

    common macros/functions -More...

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

    Go to the source code of this file.

    - - - - - - -

    -Macros

    #define CHAR_SIZE   sizeof(char)
     
    #define ASCII_BITS   8
     
    -

    Detailed Description

    -

    common macros/functions

    -

    This file holds common macros and functions shared throughout the whole codebase without any particular purpose.

    - -

    Definition in file ntru_common.h.

    -

    Macro Definition Documentation

    - -
    -
    - - - - -
    #define ASCII_BITS   8
    -
    - -

    Definition at line 38 of file ntru_common.h.

    - -
    -
    - -
    -
    - - - - -
    #define CHAR_SIZE   sizeof(char)
    -
    - -

    Definition at line 37 of file ntru_common.h.

    - -
    -
    -
    - - - - diff --git a/ntru__common_8h__incl.map b/ntru__common_8h__incl.map deleted file mode 100644 index 1ba3095..0000000 --- a/ntru__common_8h__incl.map +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/ntru__common_8h__incl.md5 b/ntru__common_8h__incl.md5 deleted file mode 100644 index b4380ba..0000000 --- a/ntru__common_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -263919482a59e32c059432052bc45afa \ No newline at end of file diff --git a/ntru__common_8h__incl.png b/ntru__common_8h__incl.png deleted file mode 100644 index 9fd4e37..0000000 Binary files a/ntru__common_8h__incl.png and /dev/null differ diff --git a/ntru__common_8h_source.html b/ntru__common_8h_source.html deleted file mode 100644 index c7aadc9..0000000 --- a/ntru__common_8h_source.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_common.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_common.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    30 #ifndef NTRU_COMMON_H
    -
    31 #define NTRU_COMMON_H
    -
    32 
    -
    33 
    -
    34 #include <stdlib.h>
    -
    35 
    -
    36 
    -
    37 #define CHAR_SIZE sizeof(char)
    -
    38 #define ASCII_BITS 8
    -
    39 
    -
    40 
    -
    41 #endif /* NTRU_COMMON_H */
    -
    - - - - diff --git a/ntru__decrypt_8c.html b/ntru__decrypt_8c.html deleted file mode 100644 index 6d8ce11..0000000 --- a/ntru__decrypt_8c.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_decrypt.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_decrypt.c File Reference
    -
    -
    - -

    NTRU decryption. -More...

    -
    #include "ntru_ascii_poly.h"
    -#include "ntru_decrypt.h"
    -#include "ntru_params.h"
    -#include "ntru_poly.h"
    -#include "ntru_poly_ascii.h"
    -#include "ntru_string.h"
    -#include <stdbool.h>
    -#include <string.h>
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_decrypt.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - -

    -Functions

    void ntru_decrypt_poly (const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_bin, const ntru_params *params)
     
    stringntru_decrypt_string (const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params)
     
    -

    Detailed Description

    -

    NTRU decryption.

    -

    This file handles the NTRU decryption algorithm.

    - -

    Definition in file ntru_decrypt.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ntru_decrypt_poly (const fmpz_poly_t encr_msg,
    const fmpz_poly_t priv_key,
    const fmpz_poly_t priv_key_inv,
    fmpz_poly_t out_tern,
    const ntru_paramsparams 
    )
    -
    -

    Decryption of the given Polynom with the private key, its inverse and the fitting ntru_params

    -
    Parameters
    - - - - - - -
    encr_msgencrypted polynom with maximum length of N from the given context
    priv_keythe polynom containing the private key to decrypt the message
    priv_key_invthe inverse polynome to the private key
    out_ternthe resulting ternary polynom [out]
    paramsthe ntru_params
    -
    -
    - -

    Definition at line 46 of file ntru_decrypt.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    string* ntru_decrypt_string (const stringencr_msg,
    const fmpz_poly_t priv_key,
    const fmpz_poly_t priv_key_inv,
    const ntru_paramsparams 
    )
    -
    -

    Decryption of a given encrypted string.

    -
    Parameters
    - - - - - -
    encr_msgthe encrypted message in the form of a string
    priv_keythe polynom containing the private key to decrypt the message
    priv_key_invthe inverse polynome to the private key
    paramsthe ntru_params
    -
    -
    -
    Returns
    the decrypted string
    - -

    Definition at line 92 of file ntru_decrypt.c.

    - -
    -
    -
    - - - - diff --git a/ntru__decrypt_8c__incl.map b/ntru__decrypt_8c__incl.map deleted file mode 100644 index cd456c8..0000000 --- a/ntru__decrypt_8c__incl.map +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ntru__decrypt_8c__incl.md5 b/ntru__decrypt_8c__incl.md5 deleted file mode 100644 index c786193..0000000 --- a/ntru__decrypt_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -fd7a83e2e136c4b6ede8e55ee7aa3b6d \ No newline at end of file diff --git a/ntru__decrypt_8c__incl.png b/ntru__decrypt_8c__incl.png deleted file mode 100644 index 35f0deb..0000000 Binary files a/ntru__decrypt_8c__incl.png and /dev/null differ diff --git a/ntru__decrypt_8c_source.html b/ntru__decrypt_8c_source.html deleted file mode 100644 index 346d81f..0000000 --- a/ntru__decrypt_8c_source.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_decrypt.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_decrypt.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_ascii_poly.h"
    -
    30 #include "ntru_decrypt.h"
    -
    31 #include "ntru_params.h"
    -
    32 #include "ntru_poly.h"
    -
    33 #include "ntru_poly_ascii.h"
    -
    34 #include "ntru_string.h"
    -
    35 
    -
    36 #include <stdbool.h>
    -
    37 #include <string.h>
    -
    38 
    -
    39 #include <fmpz_poly.h>
    -
    40 #include <fmpz.h>
    -
    41 
    -
    42 
    -
    43 /*------------------------------------------------------------------------*/
    -
    44 
    -
    45 void
    - -
    47  const fmpz_poly_t encr_msg,
    -
    48  const fmpz_poly_t priv_key,
    -
    49  const fmpz_poly_t priv_key_inv,
    -
    50  fmpz_poly_t out_bin,
    -
    51  const ntru_params *params)
    -
    52 {
    -
    53  fmpz_poly_t a,
    -
    54  priv_key_tmp,
    -
    55  priv_key_inv_tmp,
    -
    56  encr_msg_tmp;
    -
    57 
    -
    58  if (!encr_msg || !priv_key || !priv_key_inv || !out_bin || !params)
    -
    59  NTRU_ABORT_DEBUG("Unexpected NULL parameters");
    -
    60 
    -
    61  fmpz_poly_init(a);
    -
    62  fmpz_poly_zero(a);
    -
    63 
    -
    64  /*
    -
    65  * make sure all are shifted to
    -
    66  * [-q/2, q/2]
    -
    67  */
    -
    68  fmpz_poly_init(priv_key_tmp);
    -
    69  fmpz_poly_init(priv_key_inv_tmp);
    -
    70  fmpz_poly_init(encr_msg_tmp);
    -
    71  fmpz_poly_set(priv_key_tmp, priv_key);
    -
    72  fmpz_poly_set(priv_key_inv_tmp, priv_key_inv);
    -
    73  fmpz_poly_set(encr_msg_tmp, encr_msg);
    -
    74  fmpz_poly_mod(priv_key_tmp, params->q);
    -
    75  fmpz_poly_mod(priv_key_inv_tmp, params->q);
    -
    76  fmpz_poly_mod(encr_msg_tmp, params->q);
    -
    77 
    -
    78  poly_starmultiply(priv_key_tmp, encr_msg_tmp, a, params, params->q);
    -
    79  fmpz_poly_mod(a, params->q);
    -
    80  poly_starmultiply(a, priv_key_inv_tmp, out_bin, params, params->p);
    -
    81  fmpz_poly_mod(out_bin, params->p);
    -
    82 
    -
    83  fmpz_poly_clear(a);
    -
    84  fmpz_poly_clear(priv_key_tmp);
    -
    85  fmpz_poly_clear(priv_key_inv_tmp);
    -
    86  fmpz_poly_clear(encr_msg_tmp);
    -
    87 }
    -
    88 
    -
    89 /*------------------------------------------------------------------------*/
    -
    90 
    -
    91 string *
    - -
    93  const string *encr_msg,
    -
    94  const fmpz_poly_t priv_key,
    -
    95  const fmpz_poly_t priv_key_inv,
    -
    96  const ntru_params *params)
    -
    97 {
    -
    98  uint32_t i = 0;
    -
    99  string *decr_msg;
    -
    100  fmpz_poly_t **poly_array;
    -
    101 
    -
    102  if (!encr_msg || !encr_msg->len)
    -
    103  NTRU_ABORT_DEBUG("Unexpected NULL parameters");
    -
    104 
    -
    105  poly_array = base64_to_poly_arr(encr_msg, params);
    -
    106 
    -
    107  while (*poly_array[i]) {
    -
    108  ntru_decrypt_poly(*poly_array[i],
    -
    109  priv_key,
    -
    110  priv_key_inv,
    -
    111  *poly_array[i],
    -
    112  params);
    -
    113  i++;
    -
    114  }
    -
    115 
    -
    116  decr_msg = bin_poly_arr_to_ascii((const fmpz_poly_t **)poly_array,
    -
    117  i, params);
    -
    118 
    -
    119  poly_delete_array(poly_array);
    -
    120 
    -
    121  return decr_msg;
    -
    122 }
    -
    123 
    -
    124 /*------------------------------------------------------------------------*/
    -
    size_t len
    Definition: ntru_string.h:53
    -
    void fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:182
    -
    #define NTRU_ABORT_DEBUG(...)
    Definition: ntru_err.h:39
    -
    uint32_t p
    Definition: ntru_params.h:56
    -
    fmpz_poly_t ** base64_to_poly_arr(const string *to_poly, const ntru_params *params)
    -
    header for ntru_decrypt.c
    - -
    header for ntru_poly_ascii.c
    -
    NTRU parameters.
    -
    void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
    Definition: ntru_poly.c:239
    -
    void poly_delete_array(fmpz_poly_t **poly_array)
    Definition: ntru_poly.c:131
    -
    string * bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params)
    -
    uint32_t q
    Definition: ntru_params.h:52
    -
    void ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_bin, const ntru_params *params)
    Definition: ntru_decrypt.c:46
    -
    header for ntru_string.c
    -
    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)
    Definition: ntru_decrypt.c:92
    -
    header for ntru_poly.c
    -
    header for ntru_ascii_poly.c
    -
    - - - - diff --git a/ntru__decrypt_8h.html b/ntru__decrypt_8h.html deleted file mode 100644 index 54bc813..0000000 --- a/ntru__decrypt_8h.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_decrypt.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_decrypt.h File Reference
    -
    -
    - -

    header for ntru_decrypt.c -More...

    -
    #include "ntru_params.h"
    -#include "ntru_poly.h"
    -#include "ntru_string.h"
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_decrypt.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - -

    -Functions

    void ntru_decrypt_poly (const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_tern, const ntru_params *params)
     
    stringntru_decrypt_string (const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params)
     
    -

    Detailed Description

    -

    header for ntru_decrypt.c

    -

    Header for the external API of ntru_decrypt.c.

    - -

    Definition in file ntru_decrypt.h.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ntru_decrypt_poly (const fmpz_poly_t encr_msg,
    const fmpz_poly_t priv_key,
    const fmpz_poly_t priv_key_inv,
    fmpz_poly_t out_tern,
    const ntru_paramsparams 
    )
    -
    -

    Decryption of the given Polynom with the private key, its inverse and the fitting ntru_params

    -
    Parameters
    - - - - - - -
    encr_msgencrypted polynom with maximum length of N from the given context
    priv_keythe polynom containing the private key to decrypt the message
    priv_key_invthe inverse polynome to the private key
    out_ternthe resulting ternary polynom [out]
    paramsthe ntru_params
    -
    -
    - -

    Definition at line 46 of file ntru_decrypt.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    string* ntru_decrypt_string (const stringencr_msg,
    const fmpz_poly_t priv_key,
    const fmpz_poly_t priv_key_inv,
    const ntru_paramsparams 
    )
    -
    -

    Decryption of a given encrypted string.

    -
    Parameters
    - - - - - -
    encr_msgthe encrypted message in the form of a string
    priv_keythe polynom containing the private key to decrypt the message
    priv_key_invthe inverse polynome to the private key
    paramsthe ntru_params
    -
    -
    -
    Returns
    the decrypted string
    - -

    Definition at line 92 of file ntru_decrypt.c.

    - -
    -
    -
    - - - - diff --git a/ntru__decrypt_8h__incl.map b/ntru__decrypt_8h__incl.map deleted file mode 100644 index 35c1361..0000000 --- a/ntru__decrypt_8h__incl.map +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ntru__decrypt_8h__incl.md5 b/ntru__decrypt_8h__incl.md5 deleted file mode 100644 index e7a1060..0000000 --- a/ntru__decrypt_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -8fb618f6c80c80fe82e657fdec2bcc8e \ No newline at end of file diff --git a/ntru__decrypt_8h__incl.png b/ntru__decrypt_8h__incl.png deleted file mode 100644 index 2425348..0000000 Binary files a/ntru__decrypt_8h__incl.png and /dev/null differ diff --git a/ntru__decrypt_8h_source.html b/ntru__decrypt_8h_source.html deleted file mode 100644 index ea9362e..0000000 --- a/ntru__decrypt_8h_source.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_decrypt.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_decrypt.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_DECRYPT_H
    -
    29 #define NTRU_DECRYPT_H
    -
    30 
    -
    31 #include "ntru_params.h"
    -
    32 #include "ntru_poly.h"
    -
    33 #include "ntru_string.h"
    -
    34 
    -
    35 #include <fmpz_poly.h>
    -
    36 #include <fmpz.h>
    -
    37 
    -
    38 
    -
    51 void
    - -
    53  const fmpz_poly_t encr_msg,
    -
    54  const fmpz_poly_t priv_key,
    -
    55  const fmpz_poly_t priv_key_inv,
    -
    56  fmpz_poly_t out_tern,
    -
    57  const ntru_params *params);
    -
    58 
    -
    69 string *
    - -
    71  const string *encr_msg,
    -
    72  const fmpz_poly_t priv_key,
    -
    73  const fmpz_poly_t priv_key_inv,
    -
    74  const ntru_params *params);
    -
    75 
    -
    76 
    -
    77 #endif /* NTRU_DECRYPT */
    -
    void ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_tern, const ntru_params *params)
    Definition: ntru_decrypt.c:46
    - -
    NTRU parameters.
    -
    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)
    Definition: ntru_decrypt.c:92
    -
    header for ntru_string.c
    -
    header for ntru_poly.c
    -
    - - - - diff --git a/ntru__encrypt_8c.html b/ntru__encrypt_8c.html deleted file mode 100644 index 517879b..0000000 --- a/ntru__encrypt_8c.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_encrypt.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_encrypt.c File Reference
    -
    -
    - -

    NTRU encryption. -More...

    -
    #include "ntru_ascii_poly.h"
    -#include "ntru_encrypt.h"
    -#include "ntru_mem.h"
    -#include "ntru_params.h"
    -#include "ntru_poly.h"
    -#include "ntru_poly_ascii.h"
    -#include "ntru_string.h"
    -#include <string.h>
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_encrypt.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - -

    -Functions

    void ntru_encrypt_poly (const fmpz_poly_t msg_bin, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params)
     
    stringntru_encrypt_string (const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params)
     
    -

    Detailed Description

    -

    NTRU encryption.

    -

    This file handles the NTRU encryption algorithm.

    - -

    Definition in file ntru_encrypt.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ntru_encrypt_poly (const fmpz_poly_t msg_tern,
    const fmpz_poly_t pub_key,
    const fmpz_poly_t rnd,
    fmpz_poly_t out,
    const ntru_paramsparams 
    )
    -
    -

    encrypt the msg, using the math: e = (h ∗ r) + m (mod q)

    -

    e = the encrypted poly

    -

    h = the public key

    -

    r = the random poly

    -

    m = the message poly

    -

    q = large mod

    -
    Parameters
    - - - - - - -
    msg_ternthe message to encrypt, in ternary format
    pub_keythe public key
    rndthe random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1})
    outthe output poly which is in the range {0, q-1} (not ternary!) [out]
    paramsntru_params the ntru context
    -
    -
    - -

    Definition at line 46 of file ntru_encrypt.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    string* ntru_encrypt_string (const stringmsg,
    const fmpz_poly_t pub_key,
    const fmpz_poly_t rnd,
    const ntru_paramsparams 
    )
    -
    -

    Encrypt a message in the form of a null-terminated char array and return a string.

    -
    Parameters
    - - - - - -
    msgthe message
    pub_keythe public key
    rndthe random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1})
    paramsntru_params the ntru context
    -
    -
    -
    Returns
    the newly allocated encrypted string
    - -

    Definition at line 74 of file ntru_encrypt.c.

    - -
    -
    -
    - - - - diff --git a/ntru__encrypt_8c__incl.map b/ntru__encrypt_8c__incl.map deleted file mode 100644 index f6e8043..0000000 --- a/ntru__encrypt_8c__incl.map +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ntru__encrypt_8c__incl.md5 b/ntru__encrypt_8c__incl.md5 deleted file mode 100644 index 18ccea7..0000000 --- a/ntru__encrypt_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -7c1c6abc6b2d58a64859dd38bfb8acdb \ No newline at end of file diff --git a/ntru__encrypt_8c__incl.png b/ntru__encrypt_8c__incl.png deleted file mode 100644 index e3da775..0000000 Binary files a/ntru__encrypt_8c__incl.png and /dev/null differ diff --git a/ntru__encrypt_8c_source.html b/ntru__encrypt_8c_source.html deleted file mode 100644 index f43597d..0000000 --- a/ntru__encrypt_8c_source.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_encrypt.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_encrypt.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_ascii_poly.h"
    -
    30 #include "ntru_encrypt.h"
    -
    31 #include "ntru_mem.h"
    -
    32 #include "ntru_params.h"
    -
    33 #include "ntru_poly.h"
    -
    34 #include "ntru_poly_ascii.h"
    -
    35 #include "ntru_string.h"
    -
    36 
    -
    37 #include <string.h>
    -
    38 
    -
    39 #include <fmpz_poly.h>
    -
    40 #include <fmpz.h>
    -
    41 
    -
    42 
    -
    43 /*------------------------------------------------------------------------*/
    -
    44 
    -
    45 void
    - -
    47  const fmpz_poly_t msg_bin,
    -
    48  const fmpz_poly_t pub_key,
    -
    49  const fmpz_poly_t rnd,
    -
    50  fmpz_poly_t out,
    -
    51  const ntru_params *params)
    -
    52 {
    -
    53  fmpz_poly_t tmp_poly_msg;
    -
    54 
    -
    55  if (!msg_bin || !pub_key || !rnd || !out || !params)
    -
    56  NTRU_ABORT_DEBUG("Unexpected NULL parameters");
    -
    57 
    -
    58  /* allow aliasing */
    -
    59  fmpz_poly_init(tmp_poly_msg);
    -
    60  fmpz_poly_set(tmp_poly_msg, msg_bin);
    -
    61 
    -
    62  fmpz_poly_zero(out);
    -
    63  poly_starmultiply(pub_key, rnd, out, params, params->q);
    -
    64 
    -
    65  fmpz_poly_add(out, out, tmp_poly_msg);
    -
    66  fmpz_poly_mod_unsigned(out, params->q);
    -
    67 
    -
    68  fmpz_poly_clear(tmp_poly_msg);
    -
    69 }
    -
    70 
    -
    71 /*------------------------------------------------------------------------*/
    -
    72 
    -
    73 string *
    - -
    75  const string *msg,
    -
    76  const fmpz_poly_t pub_key,
    -
    77  const fmpz_poly_t rnd,
    -
    78  const ntru_params *params)
    -
    79 {
    -
    80  uint32_t i = 0;
    -
    81  string *enc_msg;
    -
    82  fmpz_poly_t **poly_array;
    -
    83 
    -
    84  if (!msg || !msg->len)
    -
    85  NTRU_ABORT_DEBUG("Unexpected NULL parameters");
    -
    86 
    -
    87  poly_array = ascii_to_bin_poly_arr(msg, params);
    -
    88 
    -
    89  while (*poly_array[i]) {
    -
    90  ntru_encrypt_poly(*poly_array[i],
    -
    91  pub_key,
    -
    92  rnd,
    -
    93  *poly_array[i],
    -
    94  params);
    -
    95  i++;
    -
    96  }
    -
    97 
    -
    98  enc_msg = poly_arr_to_base64((const fmpz_poly_t **)poly_array,
    -
    99  i, params);
    -
    100 
    -
    101  poly_delete_array(poly_array);
    -
    102 
    -
    103  return enc_msg;
    -
    104 }
    -
    105 
    -
    106 /*------------------------------------------------------------------------*/
    -
    fmpz_poly_t ** ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params)
    -
    size_t len
    Definition: ntru_string.h:53
    -
    void ntru_encrypt_poly(const fmpz_poly_t msg_bin, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params)
    Definition: ntru_encrypt.c:46
    -
    string * poly_arr_to_base64(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
    -
    void fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:166
    -
    #define NTRU_ABORT_DEBUG(...)
    Definition: ntru_err.h:39
    - -
    header for encrypt.c
    -
    header for ntru_mem.c
    -
    header for ntru_poly_ascii.c
    -
    NTRU parameters.
    -
    string * ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params)
    Definition: ntru_encrypt.c:74
    -
    void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
    Definition: ntru_poly.c:239
    -
    void poly_delete_array(fmpz_poly_t **poly_array)
    Definition: ntru_poly.c:131
    -
    uint32_t q
    Definition: ntru_params.h:52
    -
    header for ntru_string.c
    -
    header for ntru_poly.c
    -
    header for ntru_ascii_poly.c
    -
    - - - - diff --git a/ntru__encrypt_8h.html b/ntru__encrypt_8h.html deleted file mode 100644 index 3381549..0000000 --- a/ntru__encrypt_8h.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_encrypt.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_encrypt.h File Reference
    -
    -
    - -

    header for encrypt.c -More...

    -
    #include "ntru_params.h"
    -#include "ntru_poly.h"
    -#include "ntru_string.h"
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_encrypt.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - -

    -Functions

    void ntru_encrypt_poly (const fmpz_poly_t msg_tern, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params)
     
    stringntru_encrypt_string (const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params)
     
    -

    Detailed Description

    -

    header for encrypt.c

    -

    Header for the internal API of ntru_encrypt.c.

    - -

    Definition in file ntru_encrypt.h.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ntru_encrypt_poly (const fmpz_poly_t msg_tern,
    const fmpz_poly_t pub_key,
    const fmpz_poly_t rnd,
    fmpz_poly_t out,
    const ntru_paramsparams 
    )
    -
    -

    encrypt the msg, using the math: e = (h ∗ r) + m (mod q)

    -

    e = the encrypted poly

    -

    h = the public key

    -

    r = the random poly

    -

    m = the message poly

    -

    q = large mod

    -
    Parameters
    - - - - - - -
    msg_ternthe message to encrypt, in ternary format
    pub_keythe public key
    rndthe random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1})
    outthe output poly which is in the range {0, q-1} (not ternary!) [out]
    paramsntru_params the ntru context
    -
    -
    - -

    Definition at line 46 of file ntru_encrypt.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    string* ntru_encrypt_string (const stringmsg,
    const fmpz_poly_t pub_key,
    const fmpz_poly_t rnd,
    const ntru_paramsparams 
    )
    -
    -

    Encrypt a message in the form of a null-terminated char array and return a string.

    -
    Parameters
    - - - - - -
    msgthe message
    pub_keythe public key
    rndthe random poly (should have relatively small coefficients, but not restricted to {-1, 0, 1})
    paramsntru_params the ntru context
    -
    -
    -
    Returns
    the newly allocated encrypted string
    - -

    Definition at line 74 of file ntru_encrypt.c.

    - -
    -
    -
    - - - - diff --git a/ntru__encrypt_8h__incl.map b/ntru__encrypt_8h__incl.map deleted file mode 100644 index e38d25d..0000000 --- a/ntru__encrypt_8h__incl.map +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ntru__encrypt_8h__incl.md5 b/ntru__encrypt_8h__incl.md5 deleted file mode 100644 index 4c117eb..0000000 --- a/ntru__encrypt_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -e4e4917898c572685b6a0d48ebcb9834 \ No newline at end of file diff --git a/ntru__encrypt_8h__incl.png b/ntru__encrypt_8h__incl.png deleted file mode 100644 index 0bb520d..0000000 Binary files a/ntru__encrypt_8h__incl.png and /dev/null differ diff --git a/ntru__encrypt_8h_source.html b/ntru__encrypt_8h_source.html deleted file mode 100644 index 0f6a65d..0000000 --- a/ntru__encrypt_8h_source.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_encrypt.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_encrypt.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef PQC_ENCRYPT_H
    -
    29 #define PQC_ENCRYPT_H
    -
    30 
    -
    31 
    -
    32 #include "ntru_params.h"
    -
    33 #include "ntru_poly.h"
    -
    34 #include "ntru_string.h"
    -
    35 
    -
    36 #include <fmpz_poly.h>
    -
    37 #include <fmpz.h>
    -
    38 
    -
    39 
    -
    62 void
    - -
    64  const fmpz_poly_t msg_tern,
    -
    65  const fmpz_poly_t pub_key,
    -
    66  const fmpz_poly_t rnd,
    -
    67  fmpz_poly_t out,
    -
    68  const ntru_params *params);
    -
    69 
    -
    81 string *
    - -
    83  const string *msg,
    -
    84  const fmpz_poly_t pub_key,
    -
    85  const fmpz_poly_t rnd,
    -
    86  const ntru_params *params);
    -
    87 
    -
    88 
    -
    89 #endif /* PQC_ENCRYPT_H */
    - -
    NTRU parameters.
    -
    header for ntru_string.c
    -
    void ntru_encrypt_poly(const fmpz_poly_t msg_tern, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params)
    Definition: ntru_encrypt.c:46
    -
    string * ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params)
    Definition: ntru_encrypt.c:74
    -
    header for ntru_poly.c
    -
    - - - - diff --git a/ntru__err_8h.html b/ntru__err_8h.html deleted file mode 100644 index e00ff0a..0000000 --- a/ntru__err_8h.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_err.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_err.h File Reference
    -
    -
    - -

    error handling -More...

    - -

    Go to the source code of this file.

    - - - - - - - - - - -

    -Macros

    #define NTRU_ABORT(...)
     
    #define NTRU_ABORT_DEBUG(...)
     
    #define NTRU_WARN(...)
     
    #define NTRU_WARN_DEBUG(...)
     
    -

    Detailed Description

    -

    error handling

    -

    This file provides error macros and functions for the NTRU cryptosystem.

    - -

    Definition in file ntru_err.h.

    -

    Macro Definition Documentation

    - -
    -
    - - - - - - - - -
    #define NTRU_ABORT( ...)
    -
    -Value:
    { \
    -
    fprintf(stderr, __VA_ARGS__); \
    -
    abort(); \
    -
    }
    -
    -

    Definition at line 33 of file ntru_err.h.

    - -
    -
    - -
    -
    - - - - - - - - -
    #define NTRU_ABORT_DEBUG( ...)
    -
    -Value:
    { \
    -
    fprintf(stderr, __VA_ARGS__); \
    -
    fprintf(stderr, " [file %s, line %d]:\n", \
    -
    __FILE__, __LINE__); \
    -
    abort(); \
    -
    }
    -
    -

    Definition at line 39 of file ntru_err.h.

    - -
    -
    - -
    -
    - - - - - - - - -
    #define NTRU_WARN( ...)
    -
    -Value:
    { \
    -
    fprintf(stderr, __VA_ARGS__); \
    -
    }
    -
    -

    Definition at line 47 of file ntru_err.h.

    - -
    -
    - -
    -
    - - - - - - - - -
    #define NTRU_WARN_DEBUG( ...)
    -
    -Value:
    { \
    -
    fprintf(stderr, __VA_ARGS__); \
    -
    fprintf(stderr, " [file %s, line %d]:\n", \
    -
    __FILE__, __LINE__); \
    -
    }
    -
    -

    Definition at line 52 of file ntru_err.h.

    - -
    -
    -
    - - - - diff --git a/ntru__err_8h_source.html b/ntru__err_8h_source.html deleted file mode 100644 index 0fdd678..0000000 --- a/ntru__err_8h_source.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_err.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_err.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #ifndef NTRU_ERR_H
    -
    30 #define NTRU_ERR_H
    -
    31 
    -
    32 
    -
    33 #define NTRU_ABORT(...) \
    -
    34 { \
    -
    35  fprintf(stderr, __VA_ARGS__); \
    -
    36  abort(); \
    -
    37 }
    -
    38 
    -
    39 #define NTRU_ABORT_DEBUG(...) \
    -
    40 { \
    -
    41  fprintf(stderr, __VA_ARGS__); \
    -
    42  fprintf(stderr, " [file %s, line %d]:\n", \
    -
    43  __FILE__, __LINE__); \
    -
    44  abort(); \
    -
    45 }
    -
    46 
    -
    47 #define NTRU_WARN(...) \
    -
    48 { \
    -
    49  fprintf(stderr, __VA_ARGS__); \
    -
    50 }
    -
    51 
    -
    52 #define NTRU_WARN_DEBUG(...) \
    -
    53 { \
    -
    54  fprintf(stderr, __VA_ARGS__); \
    -
    55  fprintf(stderr, " [file %s, line %d]:\n", \
    -
    56  __FILE__, __LINE__); \
    -
    57 }
    -
    58 
    -
    59 
    -
    60 #endif /* NTRU_ERR_H */
    -
    - - - - diff --git a/ntru__file_8c.html b/ntru__file_8c.html deleted file mode 100644 index e325e82..0000000 --- a/ntru__file_8c.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_file.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_file.c File Reference
    -
    -
    - -

    file operations -More...

    -
    #include "ntru_common.h"
    -#include "ntru_err.h"
    -#include "ntru_mem.h"
    -#include "ntru_string.h"
    -#include <fcntl.h>
    -#include <stdbool.h>
    -#include <stdint.h>
    -#include <stdio.h>
    -#include <stdlib.h>
    -#include <string.h>
    -#include <sys/stat.h>
    -#include <sys/types.h>
    -#include <unistd.h>
    -
    -Include dependency graph for ntru_file.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - -

    -Macros

    #define STD_FILE_BUF   4096
     
    - - - - - -

    -Functions

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

    Detailed Description

    -

    file operations

    -

    Allows operations on files, such as reading and writing.

    - -

    Definition in file ntru_file.c.

    -

    Macro Definition Documentation

    - -
    -
    - - - - -
    #define STD_FILE_BUF   4096
    -
    - -

    Definition at line 44 of file ntru_file.c.

    - -
    -
    -

    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.

    - -
    -
    -
    - - - - diff --git a/ntru__file_8c__incl.map b/ntru__file_8c__incl.map deleted file mode 100644 index eca79f9..0000000 --- a/ntru__file_8c__incl.map +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ntru__file_8c__incl.md5 b/ntru__file_8c__incl.md5 deleted file mode 100644 index 3840828..0000000 --- a/ntru__file_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -14fe5052b4997663bc758bcb68f81974 \ No newline at end of file diff --git a/ntru__file_8c__incl.png b/ntru__file_8c__incl.png deleted file mode 100644 index 5b96710..0000000 Binary files a/ntru__file_8c__incl.png and /dev/null differ diff --git a/ntru__file_8c_source.html b/ntru__file_8c_source.html deleted file mode 100644 index 6e41528..0000000 --- a/ntru__file_8c_source.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_file.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_file.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_common.h"
    -
    30 #include "ntru_err.h"
    -
    31 #include "ntru_mem.h"
    -
    32 #include "ntru_string.h"
    -
    33 
    -
    34 #include <fcntl.h>
    -
    35 #include <stdbool.h>
    -
    36 #include <stdint.h>
    -
    37 #include <stdio.h>
    -
    38 #include <stdlib.h>
    -
    39 #include <string.h>
    -
    40 #include <sys/stat.h>
    -
    41 #include <sys/types.h>
    -
    42 #include <unistd.h>
    -
    43 
    -
    44 #define STD_FILE_BUF 4096
    -
    45 
    -
    46 
    -
    47 /*------------------------------------------------------------------------*/
    -
    48 
    -
    49 string *
    -
    50 read_file(char const * const filename)
    -
    51 {
    -
    52  char buf[STD_FILE_BUF],
    -
    53  *cstring = NULL;
    -
    54  int fd = 0;
    -
    55  size_t str_size = 0;
    -
    56  ssize_t n;
    -
    57  size_t file_length = 0;
    -
    58  string *result_string;
    -
    59 
    -
    60  fd = open(filename, O_RDONLY);
    -
    61  file_length = lseek(fd, 0, SEEK_END) + 1;
    -
    62  lseek(fd, 0, SEEK_SET);
    -
    63 
    -
    64  cstring = malloc(sizeof(char) * file_length);
    -
    65 
    -
    66  if (fd != -1) {
    -
    67  /* read and copy chunks */
    -
    68  while ((n = read(fd, buf, STD_FILE_BUF)) != 0) {
    -
    69 
    -
    70  if (n == -1) {
    -
    71  NTRU_WARN_DEBUG("Failed while reading file descriptor %d",
    -
    72  fd);
    -
    73  goto failure_cleanup;
    -
    74  }
    -
    75 
    -
    76  str_size += n; /* count total bytes read */
    -
    77 
    -
    78  /* append buffer to string */
    -
    79  memcpy(cstring + (str_size - n), buf, (size_t)n);
    -
    80  }
    -
    81  /* add trailing NULL byte */
    -
    82  cstring[str_size] = '\0';
    -
    83 
    -
    84  if (close(fd)) {
    -
    85  NTRU_WARN_DEBUG("Failed to close file descripter %d\n", fd);
    -
    86  goto failure_cleanup;
    -
    87  }
    -
    88 
    -
    89  result_string = ntru_malloc(sizeof(*result_string));
    -
    90  result_string->ptr = cstring;
    -
    91  result_string->len = str_size;
    -
    92 
    -
    93  return result_string;
    -
    94 
    -
    95  } else {
    -
    96  return NULL;
    -
    97  }
    -
    98 
    -
    99 failure_cleanup:
    -
    100  free(cstring);
    -
    101  return NULL;
    -
    102 }
    -
    103 
    -
    104 /*------------------------------------------------------------------------*/
    -
    105 
    -
    106 bool
    -
    107 write_file(string const *wstring, char const * const filename)
    -
    108 {
    -
    109  FILE *fp;
    -
    110 
    -
    111  fp = fopen(filename, "w");
    -
    112 
    -
    113  if (!fp) {
    -
    114  NTRU_WARN_DEBUG("Failed while creating file\n");
    -
    115  return false;
    -
    116  }
    -
    117 
    -
    118  for (uint32_t i = 0; i < wstring->len; i++)
    -
    119  fprintf(fp, "%c", wstring->ptr[i]);
    -
    120 
    -
    121  if (fclose(fp)) {
    -
    122  NTRU_WARN_DEBUG("Failed to close file descripter\n");
    -
    123  return false;
    -
    124  }
    -
    125 
    -
    126  return true;
    -
    127 }
    -
    128 
    -
    129 /*------------------------------------------------------------------------*/
    -
    size_t len
    Definition: ntru_string.h:53
    -
    bool write_file(string const *wstring, char const *const filename)
    Definition: ntru_file.c:107
    -
    header for ntru_mem.c
    -
    #define STD_FILE_BUF
    Definition: ntru_file.c:44
    -
    string * read_file(char const *const filename)
    Definition: ntru_file.c:50
    -
    common macros/functions
    -
    #define NTRU_WARN_DEBUG(...)
    Definition: ntru_err.h:52
    -
    error handling
    -
    void * ntru_malloc(size_t size)
    Definition: ntru_mem.c:38
    -
    header for ntru_string.c
    -
    char * ptr
    Definition: ntru_string.h:49
    -
    - - - - diff --git a/ntru__file_8h.html b/ntru__file_8h.html deleted file mode 100644 index a39f753..0000000 --- a/ntru__file_8h.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_file.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    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.

    - -
    -
    -
    - - - - diff --git a/ntru__file_8h__incl.map b/ntru__file_8h__incl.map deleted file mode 100644 index a66551a..0000000 --- a/ntru__file_8h__incl.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ntru__file_8h__incl.md5 b/ntru__file_8h__incl.md5 deleted file mode 100644 index 63d3bef..0000000 --- a/ntru__file_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -6777d5bfce02261879638e31ca068e7d \ No newline at end of file diff --git a/ntru__file_8h__incl.png b/ntru__file_8h__incl.png deleted file mode 100644 index 53d1cc5..0000000 Binary files a/ntru__file_8h__incl.png and /dev/null differ diff --git a/ntru__file_8h_source.html b/ntru__file_8h_source.html deleted file mode 100644 index d28e03d..0000000 --- a/ntru__file_8h_source.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_file.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_file.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_FILE_H
    -
    29 #define NTRU_FILE_H
    -
    30 
    -
    31 
    -
    32 #include "ntru_common.h"
    -
    33 #include "ntru_string.h"
    -
    34 
    -
    35 #include <stdbool.h>
    -
    36 
    -
    37 
    -
    45 string *
    -
    46 read_file(char const * const filename);
    -
    47 
    -
    56 bool
    -
    57 write_file(string const *wstring, char const * const filename);
    -
    58 
    -
    59 
    -
    60 #endif /* NTRU_FILE_H */
    -
    bool write_file(string const *wstring, char const *const filename)
    Definition: ntru_file.c:107
    -
    string * read_file(char const *const filename)
    Definition: ntru_file.c:50
    -
    common macros/functions
    -
    header for ntru_string.c
    -
    - - - - diff --git a/ntru__keypair_8c.html b/ntru__keypair_8c.html deleted file mode 100644 index 8ff7848..0000000 --- a/ntru__keypair_8c.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_keypair.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_keypair.c File Reference
    -
    -
    - -

    key creation and operations -More...

    -
    #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 <fmpz_poly.h>
    -#include <fmpz.h>
    -#include <stdbool.h>
    -#include <string.h>
    -
    -Include dependency graph for ntru_keypair.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - -

    -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)
     
    -

    Detailed Description

    -

    key creation and operations

    -

    This file handles the creation of the key pair and possibly common operations on them.

    - -

    Definition in file ntru_keypair.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void export_priv_key (char const *const filename,
    fmpz_poly_t priv,
    ntru_paramsparams 
    )
    -
    -

    Export the private key to a file.

    -
    Parameters
    - - - - -
    filenamethe file to save the private key into
    privthe private key
    paramsthe NTRU context
    -
    -
    - -

    Definition at line 111 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void export_public_key (char const *const filename,
    fmpz_poly_t pub,
    ntru_paramsparams 
    )
    -
    -

    Export the public key to a file.

    -
    Parameters
    - - - - -
    filenamethe file to save the public key into
    pubthe public key
    paramsthe 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_paramsparams 
    )
    -
    -

    Import the private key from a file and store him along with his inverse.

    -
    Parameters
    - - - - - -
    filenamethe file to get the private key from
    privwhere to save the private key [out]
    priv_invwhere to save the inverse of the private key [out]
    paramsthe NTRU context
    -
    -
    - -

    Definition at line 157 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void import_public_key (char const *const filename,
    fmpz_poly_t pub,
    ntru_paramsparams 
    )
    -
    -

    Import the public key from a file.

    Parameters
    - - - - -
    filenamethe file to get the public key from
    pubwhere to save the public key [out]
    paramsthe NTRU context
    -
    -
    - -

    Definition at line 132 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    bool ntru_create_keypair (fmpz_poly_t f,
    fmpz_poly_t g,
    keypairpair,
    ntru_paramsparams 
    )
    -
    -

    Creates an NTRU key pair, consisting of public and private components.

    -
    Parameters
    - - - - - -
    fa random polynomial
    ga random polynomial
    pairstore private and public components here [out]
    paramsthe NTRU context
    -
    -
    -
    Returns
    true for success, false if f or g are not invertible (then the caller hast to try different ones)
    - -

    Definition at line 47 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void ntru_delete_keypair (keypairpair)
    -
    -

    Used to free the inner structure of a keypair. This will not call free() on the pair itself.

    -
    Parameters
    - - -
    pairthe pair to free the inner structure of
    -
    -
    - -

    Definition at line 197 of file ntru_keypair.c.

    - -
    -
    -
    - - - - diff --git a/ntru__keypair_8c__incl.map b/ntru__keypair_8c__incl.map deleted file mode 100644 index 6176746..0000000 --- a/ntru__keypair_8c__incl.map +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/ntru__keypair_8c__incl.md5 b/ntru__keypair_8c__incl.md5 deleted file mode 100644 index ae02036..0000000 --- a/ntru__keypair_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -4d32fd169409284b568269543f3add8f \ No newline at end of file diff --git a/ntru__keypair_8c__incl.png b/ntru__keypair_8c__incl.png deleted file mode 100644 index 1e4d761..0000000 Binary files a/ntru__keypair_8c__incl.png and /dev/null differ diff --git a/ntru__keypair_8c_source.html b/ntru__keypair_8c_source.html deleted file mode 100644 index d9a4d52..0000000 --- a/ntru__keypair_8c_source.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_keypair.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_keypair.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_ascii_poly.h"
    -
    30 #include "ntru_file.h"
    -
    31 #include "ntru_keypair.h"
    -
    32 #include "ntru_params.h"
    -
    33 #include "ntru_poly.h"
    -
    34 #include "ntru_poly_ascii.h"
    -
    35 #include "ntru_string.h"
    -
    36 
    -
    37 #include <fmpz_poly.h>
    -
    38 #include <fmpz.h>
    -
    39 
    -
    40 #include <stdbool.h>
    -
    41 #include <string.h>
    -
    42 
    -
    43 
    -
    44 /*------------------------------------------------------------------------*/
    -
    45 
    -
    46 bool
    - -
    48  fmpz_poly_t f,
    -
    49  fmpz_poly_t g,
    -
    50  keypair *pair,
    -
    51  ntru_params *params)
    -
    52 {
    -
    53  bool retval = false;
    -
    54  fmpz_poly_t Fq,
    -
    55  Fp,
    -
    56  pub;
    -
    57 
    -
    58  if (!f || !g || !params)
    -
    59  goto _return;
    -
    60 
    -
    61  fmpz_poly_init(Fq);
    -
    62  fmpz_poly_init(Fp);
    -
    63  fmpz_poly_init(pub);
    -
    64 
    -
    65  if (!poly_inverse_poly_q(f, Fq, params))
    -
    66  goto _cleanup;
    -
    67 
    -
    68  if (!poly_inverse_poly_p(f, Fp, params))
    -
    69  goto _cleanup;
    -
    70 
    -
    71  poly_starmultiply(Fq, g, pub, params, params->q);
    -
    72  fmpz_poly_scalar_mul_ui(pub, pub, params->p);
    -
    73  fmpz_poly_mod_unsigned(pub, params->q);
    -
    74 
    -
    75  fmpz_poly_init(pair->priv);
    -
    76  fmpz_poly_init(pair->priv_inv);
    -
    77  fmpz_poly_init(pair->pub);
    -
    78 
    -
    79  fmpz_poly_set(pair->priv, f);
    -
    80  fmpz_poly_set(pair->priv_inv, Fp);
    -
    81  fmpz_poly_set(pair->pub, pub);
    -
    82 
    -
    83  retval = true;
    -
    84 
    -
    85 _cleanup:
    -
    86  fmpz_poly_clear(Fq);
    -
    87  fmpz_poly_clear(Fp);
    -
    88  fmpz_poly_clear(pub);
    -
    89 _return:
    -
    90  return retval;
    -
    91 }
    -
    92 
    -
    93 /*------------------------------------------------------------------------*/
    -
    94 
    -
    95 void
    -
    96 export_public_key(char const * const filename,
    -
    97  fmpz_poly_t pub,
    -
    98  ntru_params *params)
    -
    99 {
    -
    100  string *pub_string;
    -
    101 
    -
    102  pub_string = poly_to_base64(pub, params);
    -
    103  write_file(pub_string, filename);
    -
    104 
    -
    105  string_delete(pub_string);
    -
    106 }
    -
    107 
    -
    108 /*------------------------------------------------------------------------*/
    -
    109 
    -
    110 void
    -
    111 export_priv_key(char const * const filename,
    -
    112  fmpz_poly_t priv,
    -
    113  ntru_params *params)
    -
    114 {
    -
    115  string *priv_string;
    -
    116  fmpz_poly_t priv_u;
    -
    117 
    -
    118  fmpz_poly_init(priv_u);
    -
    119  fmpz_poly_set(priv_u, priv);
    -
    120  fmpz_poly_mod_unsigned(priv_u, params->p);
    -
    121 
    -
    122  priv_string = poly_to_base64(priv_u, params);
    -
    123  write_file(priv_string, filename);
    -
    124 
    -
    125  fmpz_poly_clear(priv_u);
    -
    126  string_delete(priv_string);
    -
    127 }
    -
    128 
    -
    129 /*------------------------------------------------------------------------*/
    -
    130 
    -
    131 void
    -
    132 import_public_key(char const * const filename,
    -
    133  fmpz_poly_t pub,
    -
    134  ntru_params *params)
    -
    135 {
    -
    136  string *pub_string;
    -
    137  fmpz_poly_t **imported;
    -
    138 
    -
    139  pub_string = read_file(filename);
    -
    140  imported = base64_to_poly_arr(pub_string, params);
    -
    141 
    -
    142  /* if the array exceeds one element, then something
    -
    143  * went horribly wrong */
    -
    144  if (*imported[1])
    -
    145  NTRU_ABORT_DEBUG("Failed importing public key!");
    -
    146 
    -
    147  fmpz_poly_set(pub, **imported);
    -
    148 
    -
    149  string_delete(pub_string);
    -
    150  poly_delete_array(imported);
    -
    151  free(imported);
    -
    152 }
    -
    153 
    -
    154 /*------------------------------------------------------------------------*/
    -
    155 
    -
    156 void
    -
    157 import_priv_key(char const * const filename,
    -
    158  fmpz_poly_t priv,
    -
    159  fmpz_poly_t priv_inv,
    -
    160  ntru_params *params)
    -
    161 {
    -
    162  string *pub_string;
    -
    163  fmpz_poly_t **imported,
    -
    164  Fp;
    -
    165 
    -
    166  fmpz_poly_init(Fp);
    -
    167 
    -
    168  pub_string = read_file(filename);
    -
    169 
    -
    170  imported = base64_to_poly_arr(pub_string, params);
    -
    171  fmpz_poly_mod(**imported, params->p);
    -
    172 
    -
    173  /* if the array exceeds one element, then something
    -
    174  * went horribly wrong */
    -
    175  if (*imported[1])
    -
    176  NTRU_ABORT_DEBUG("Failed importing private key!");
    -
    177 
    -
    178  fmpz_poly_set(priv, **imported);
    -
    179 
    -
    180  if (!poly_inverse_poly_p(priv, Fp, params))
    -
    181  goto cleanup;
    -
    182 
    -
    183  fmpz_poly_mod(Fp, params->p);
    -
    184 
    -
    185  fmpz_poly_set(priv_inv, Fp);
    -
    186  fmpz_poly_clear(Fp);
    -
    187 
    -
    188 cleanup:
    -
    189  string_delete(pub_string);
    -
    190  poly_delete_array(imported);
    -
    191  free(imported);
    -
    192 }
    -
    193 
    -
    194 /*------------------------------------------------------------------------*/
    -
    195 
    -
    196 void
    - -
    198 {
    -
    199  fmpz_poly_clear(pair->priv_inv);
    -
    200  fmpz_poly_clear(pair->priv);
    -
    201  fmpz_poly_clear(pair->pub);
    -
    202 }
    -
    203 
    -
    204 /*------------------------------------------------------------------------*/
    -
    bool poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
    Definition: ntru_poly.c:297
    -
    void string_delete(string *del_string)
    Definition: ntru_string.c:47
    -
    header for ntru_keypair.c
    -
    void ntru_delete_keypair(keypair *pair)
    Definition: ntru_keypair.c:197
    -
    void fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:166
    -
    bool write_file(string const *wstring, char const *const filename)
    Definition: ntru_file.c:107
    -
    void fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:182
    -
    #define NTRU_ABORT_DEBUG(...)
    Definition: ntru_err.h:39
    -
    uint32_t p
    Definition: ntru_params.h:56
    -
    bool poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params)
    Definition: ntru_poly.c:409
    -
    fmpz_poly_t ** base64_to_poly_arr(const string *to_poly, const ntru_params *params)
    - -
    header for ntru_file.c
    -
    fmpz_poly_t priv_inv
    Definition: ntru_keypair.h:56
    -
    header for ntru_poly_ascii.c
    -
    NTRU parameters.
    -
    string * read_file(char const *const filename)
    Definition: ntru_file.c:50
    -
    void export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    Definition: ntru_keypair.c:96
    -
    fmpz_poly_t pub
    Definition: ntru_keypair.h:61
    -
    void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
    Definition: ntru_poly.c:239
    -
    string * poly_to_base64(const fmpz_poly_t poly, const ntru_params *params)
    -
    void poly_delete_array(fmpz_poly_t **poly_array)
    Definition: ntru_poly.c:131
    -
    fmpz_poly_t priv
    Definition: ntru_keypair.h:51
    - -
    uint32_t q
    Definition: ntru_params.h:52
    -
    header for ntru_string.c
    -
    bool ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params)
    Definition: ntru_keypair.c:47
    -
    void export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params)
    Definition: ntru_keypair.c:111
    -
    void import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    Definition: ntru_keypair.c:132
    -
    void import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params)
    Definition: ntru_keypair.c:157
    -
    header for ntru_poly.c
    -
    header for ntru_ascii_poly.c
    -
    - - - - diff --git a/ntru__keypair_8h.html b/ntru__keypair_8h.html deleted file mode 100644 index a33d02d..0000000 --- a/ntru__keypair_8h.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_keypair.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_keypair.h File Reference
    -
    -
    - -

    header for ntru_keypair.c -More...

    -
    #include "ntru_params.h"
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -#include <stdbool.h>
    -
    -Include dependency graph for ntru_keypair.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)
     
    -

    Detailed Description

    -

    header for ntru_keypair.c

    -

    Header for internal API of ntru_keypair.c.

    - -

    Definition in file ntru_keypair.h.

    -

    Typedef Documentation

    - -
    -
    - - - - -
    typedef struct keypair keypair
    -
    - -

    Definition at line 39 of file ntru_keypair.h.

    - -
    -
    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void export_priv_key (char const *const filename,
    fmpz_poly_t priv,
    ntru_paramsparams 
    )
    -
    -

    Export the private key to a file.

    -
    Parameters
    - - - - -
    filenamethe file to save the private key into
    privthe private key
    paramsthe NTRU context
    -
    -
    - -

    Definition at line 111 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void export_public_key (char const *const filename,
    fmpz_poly_t pub,
    ntru_paramsparams 
    )
    -
    -

    Export the public key to a file.

    -
    Parameters
    - - - - -
    filenamethe file to save the public key into
    pubthe public key
    paramsthe 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_paramsparams 
    )
    -
    -

    Import the private key from a file and store him along with his inverse.

    -
    Parameters
    - - - - - -
    filenamethe file to get the private key from
    privwhere to save the private key [out]
    priv_invwhere to save the inverse of the private key [out]
    paramsthe NTRU context
    -
    -
    - -

    Definition at line 157 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void import_public_key (char const *const filename,
    fmpz_poly_t pub,
    ntru_paramsparams 
    )
    -
    -

    Import the public key from a file.

    Parameters
    - - - - -
    filenamethe file to get the public key from
    pubwhere to save the public key [out]
    paramsthe NTRU context
    -
    -
    - -

    Definition at line 132 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    bool ntru_create_keypair (fmpz_poly_t f,
    fmpz_poly_t g,
    keypairpair,
    ntru_paramsparams 
    )
    -
    -

    Creates an NTRU key pair, consisting of public and private components.

    -
    Parameters
    - - - - - -
    fa random polynomial
    ga random polynomial
    pairstore private and public components here [out]
    paramsthe NTRU context
    -
    -
    -
    Returns
    true for success, false if f or g are not invertible (then the caller hast to try different ones)
    - -

    Definition at line 47 of file ntru_keypair.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void ntru_delete_keypair (keypairpair)
    -
    -

    Used to free the inner structure of a keypair. This will not call free() on the pair itself.

    -
    Parameters
    - - -
    pairthe pair to free the inner structure of
    -
    -
    - -

    Definition at line 197 of file ntru_keypair.c.

    - -
    -
    -
    - - - - diff --git a/ntru__keypair_8h__incl.map b/ntru__keypair_8h__incl.map deleted file mode 100644 index 84e294d..0000000 --- a/ntru__keypair_8h__incl.map +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ntru__keypair_8h__incl.md5 b/ntru__keypair_8h__incl.md5 deleted file mode 100644 index 61a3c27..0000000 --- a/ntru__keypair_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -2d001a5467f4de2d56cacf708d06d2f1 \ No newline at end of file diff --git a/ntru__keypair_8h__incl.png b/ntru__keypair_8h__incl.png deleted file mode 100644 index 5cdecfc..0000000 Binary files a/ntru__keypair_8h__incl.png and /dev/null differ diff --git a/ntru__keypair_8h_source.html b/ntru__keypair_8h_source.html deleted file mode 100644 index 6f3ec0c..0000000 --- a/ntru__keypair_8h_source.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_keypair.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_keypair.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_KEYPAIR_H
    -
    29 #define NTRU_KEYPAIR_H
    -
    30 
    -
    31 
    -
    32 #include "ntru_params.h"
    -
    33 
    -
    34 #include <fmpz_poly.h>
    -
    35 #include <fmpz.h>
    -
    36 #include <stdbool.h>
    -
    37 
    -
    38 
    -
    39 typedef struct keypair keypair;
    -
    40 
    -
    41 
    -
    46 struct keypair {
    -
    51  fmpz_poly_t priv;
    -
    56  fmpz_poly_t priv_inv;
    -
    61  fmpz_poly_t pub;
    -
    62 };
    -
    63 
    -
    64 
    -
    77 bool
    - -
    79  fmpz_poly_t f,
    -
    80  fmpz_poly_t g,
    -
    81  keypair *pair,
    -
    82  ntru_params *params);
    -
    83 
    -
    91 void
    -
    92 export_public_key(char const * const filename,
    -
    93  fmpz_poly_t pub,
    -
    94  ntru_params *params);
    -
    95 
    -
    103 void
    -
    104 export_priv_key(char const * const filename,
    -
    105  fmpz_poly_t priv,
    -
    106  ntru_params *params);
    -
    107 
    -
    114 void
    -
    115 import_public_key(char const * const filename,
    -
    116  fmpz_poly_t pub,
    -
    117  ntru_params *params);
    -
    118 
    -
    128 void
    -
    129 import_priv_key(char const * const filename,
    -
    130  fmpz_poly_t priv,
    -
    131  fmpz_poly_t priv_inv,
    -
    132  ntru_params *params);
    -
    133 
    -
    141 void
    - -
    143 
    -
    144 
    -
    145 #endif /* NTRU_KEYPAIR_H */
    -
    void export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    Definition: ntru_keypair.c:96
    -
    void import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params)
    Definition: ntru_keypair.c:157
    -
    bool ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params)
    Definition: ntru_keypair.c:47
    - -
    fmpz_poly_t priv_inv
    Definition: ntru_keypair.h:56
    -
    NTRU parameters.
    -
    void import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
    Definition: ntru_keypair.c:132
    -
    fmpz_poly_t pub
    Definition: ntru_keypair.h:61
    -
    fmpz_poly_t priv
    Definition: ntru_keypair.h:51
    - -
    void ntru_delete_keypair(keypair *pair)
    Definition: ntru_keypair.c:197
    -
    void export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params)
    Definition: ntru_keypair.c:111
    -
    - - - - diff --git a/ntru__mem_8c.html b/ntru__mem_8c.html deleted file mode 100644 index 3a6b54d..0000000 --- a/ntru__mem_8c.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_mem.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_mem.c File Reference
    -
    -
    - -

    memory management -More...

    -
    #include "ntru_mem.h"
    -#include <stdio.h>
    -#include <stdlib.h>
    -
    -Include dependency graph for ntru_mem.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - -

    -Functions

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

    Detailed Description

    -

    memory management

    -

    This file provides functions for memory management.

    - -

    Definition in file ntru_mem.c.

    -

    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.

    - -
    -
    -
    - - - - diff --git a/ntru__mem_8c__incl.map b/ntru__mem_8c__incl.map deleted file mode 100644 index 7ed5466..0000000 --- a/ntru__mem_8c__incl.map +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ntru__mem_8c__incl.md5 b/ntru__mem_8c__incl.md5 deleted file mode 100644 index d49ae0c..0000000 --- a/ntru__mem_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -8ef578098811e3b509f862e2e72452c4 \ No newline at end of file diff --git a/ntru__mem_8c__incl.png b/ntru__mem_8c__incl.png deleted file mode 100644 index 6a5a577..0000000 Binary files a/ntru__mem_8c__incl.png and /dev/null differ diff --git a/ntru__mem_8c_source.html b/ntru__mem_8c_source.html deleted file mode 100644 index 682de49..0000000 --- a/ntru__mem_8c_source.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_mem.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_mem.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_mem.h"
    -
    30 
    -
    31 #include <stdio.h>
    -
    32 #include <stdlib.h>
    -
    33 
    -
    34 
    -
    35 /*------------------------------------------------------------------------*/
    -
    36 
    -
    37 void *
    -
    38 ntru_malloc(size_t size)
    -
    39 {
    -
    40  void *ptr;
    -
    41 
    -
    42  ptr = malloc(size);
    -
    43 
    -
    44  if (size)
    -
    45  if (!ptr) {
    -
    46  fprintf(stderr, "failed to allocate memory, aborting!");
    -
    47  abort();
    -
    48  }
    -
    49 
    -
    50  return ptr;
    -
    51 }
    -
    52 
    -
    53 /*------------------------------------------------------------------------*/
    -
    54 
    -
    55 void *
    -
    56 ntru_calloc(size_t nmemb, size_t size)
    -
    57 {
    -
    58  void *ptr;
    -
    59 
    -
    60  ptr = calloc(nmemb, size);
    -
    61 
    -
    62  if (size)
    -
    63  if (!ptr) {
    -
    64  fprintf(stderr, "failed to allocate memory, aborting!");
    -
    65  abort();
    -
    66  }
    -
    67 
    -
    68  return ptr;
    -
    69 }
    -
    70 
    -
    71 /*------------------------------------------------------------------------*/
    -
    void * ntru_calloc(size_t nmemb, size_t size)
    Definition: ntru_mem.c:56
    -
    header for ntru_mem.c
    -
    void * ntru_malloc(size_t size)
    Definition: ntru_mem.c:38
    -
    - - - - diff --git a/ntru__mem_8h.html b/ntru__mem_8h.html deleted file mode 100644 index 398903e..0000000 --- a/ntru__mem_8h.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_mem.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    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.

    - -
    -
    -
    - - - - diff --git a/ntru__mem_8h__incl.map b/ntru__mem_8h__incl.map deleted file mode 100644 index 1244895..0000000 --- a/ntru__mem_8h__incl.map +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/ntru__mem_8h__incl.md5 b/ntru__mem_8h__incl.md5 deleted file mode 100644 index cd81dd2..0000000 --- a/ntru__mem_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -7b40cab38c353d2d0cc4551da628811b \ No newline at end of file diff --git a/ntru__mem_8h__incl.png b/ntru__mem_8h__incl.png deleted file mode 100644 index 50b3d58..0000000 Binary files a/ntru__mem_8h__incl.png and /dev/null differ diff --git a/ntru__mem_8h_source.html b/ntru__mem_8h_source.html deleted file mode 100644 index e5526ed..0000000 --- a/ntru__mem_8h_source.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_mem.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_mem.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_MEM_H
    -
    29 #define NTRU_MEM_H
    -
    30 
    -
    31 #include <stdlib.h>
    -
    32 
    -
    33 
    -
    38 #define REALLOC(ptr, size) \
    -
    39 { \
    -
    40  void *tmp_ptr = NULL; \
    -
    41  tmp_ptr = realloc(ptr, size); \
    -
    42  if (tmp_ptr == NULL) { \
    -
    43  fprintf(stderr,"NULL Pointer in %s [%d]",__FILE__,__LINE__); \
    -
    44  abort(); \
    -
    45  } \
    -
    46  ptr = tmp_ptr; \
    -
    47 }
    -
    48 
    -
    49 
    -
    57 void *
    -
    58 ntru_malloc(size_t size);
    -
    59 
    -
    68 void *
    -
    69 ntru_calloc(size_t nmemb, size_t size);
    -
    70 
    -
    71 
    -
    72 #endif /* NTRU_MEM_H */
    -
    void * ntru_malloc(size_t size)
    Definition: ntru_mem.c:38
    -
    void * ntru_calloc(size_t nmemb, size_t size)
    Definition: ntru_mem.c:56
    -
    - - - - diff --git a/ntru__params_8h.html b/ntru__params_8h.html deleted file mode 100644 index edaa2d0..0000000 --- a/ntru__params_8h.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_params.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_params.h File Reference
    -
    -
    - -

    NTRU parameters. -More...

    -
    #include <stdint.h>
    -
    -Include dependency graph for ntru_params.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - -

    -Data Structures

    struct  ntru_params
     
    - - - -

    -Typedefs

    typedef struct ntru_params ntru_params
     
    -

    Detailed Description

    -

    NTRU parameters.

    -

    This file defines the ntru_params and related data types.

    - -

    Definition in file ntru_params.h.

    -

    Typedef Documentation

    - -
    -
    - - - - -
    typedef struct ntru_params ntru_params
    -
    - -

    Definition at line 36 of file ntru_params.h.

    - -
    -
    -
    - - - - diff --git a/ntru__params_8h__incl.map b/ntru__params_8h__incl.map deleted file mode 100644 index c299e87..0000000 --- a/ntru__params_8h__incl.map +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/ntru__params_8h__incl.md5 b/ntru__params_8h__incl.md5 deleted file mode 100644 index 50f53c3..0000000 --- a/ntru__params_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -d511064a1708f422ff965c0b9b68a095 \ No newline at end of file diff --git a/ntru__params_8h__incl.png b/ntru__params_8h__incl.png deleted file mode 100644 index f7f3696..0000000 Binary files a/ntru__params_8h__incl.png and /dev/null differ diff --git a/ntru__params_8h_source.html b/ntru__params_8h_source.html deleted file mode 100644 index b4c0d49..0000000 --- a/ntru__params_8h_source.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_params.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_params.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #ifndef NTRU_PARAMS_H
    -
    30 #define NTRU_PARAMS_H
    -
    31 
    -
    32 
    -
    33 #include <stdint.h>
    -
    34 
    -
    35 
    -
    36 typedef struct ntru_params ntru_params;
    -
    37 
    -
    38 
    -
    43 struct ntru_params {
    -
    48  uint32_t N;
    -
    52  uint32_t q;
    -
    56  uint32_t p;
    -
    57 };
    -
    58 
    -
    59 
    -
    60 #endif /* NTRU_PARAMS_H */
    -
    uint32_t N
    Definition: ntru_params.h:48
    -
    uint32_t p
    Definition: ntru_params.h:56
    - -
    uint32_t q
    Definition: ntru_params.h:52
    -
    - - - - diff --git a/ntru__poly_8c.html b/ntru__poly_8c.html deleted file mode 100644 index b5fac24..0000000 --- a/ntru__poly_8c.html +++ /dev/null @@ -1,778 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_poly.c File Reference
    -
    -
    - -

    operations on polynomials -More...

    -
    #include "ntru_err.h"
    -#include "ntru_mem.h"
    -#include "ntru_params.h"
    -#include "ntru_poly.h"
    -#include <stdarg.h>
    -#include <stdbool.h>
    -#include <stdint.h>
    -#include <stdio.h>
    -#include <stdlib.h>
    -#include <sys/types.h>
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_poly.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    static void poly_mod2_to_modq (const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
     
    int fmpz_cmp_si_n (const fmpz_t f, slong g)
     
    void poly_new (fmpz_poly_t new_poly, int const *const c, const size_t len)
     
    void poly_delete (fmpz_poly_t poly)
     
    void poly_delete_array (fmpz_poly_t **poly_array)
     
    void poly_delete_all (fmpz_poly_t poly,...)
     
    void fmpz_poly_mod_unsigned (fmpz_poly_t a, const uint32_t mod)
     
    void fmpz_poly_mod (fmpz_poly_t a, const uint32_t mod)
     
    void fmpz_poly_set_coeff_fmpz_n (fmpz_poly_t poly, slong n, const fmpz_t x)
     
    int fmpz_invmod_ui (fmpz_t f, const fmpz_t g, const uint32_t mod)
     
    void fmpz_add_n (fmpz_t f, const fmpz_t g, const fmpz_t h)
     
    void poly_starmultiply (const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
     
    bool poly_inverse_poly_q (const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
     
    bool poly_inverse_poly_p (const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params)
     
    void poly_draw (const fmpz_poly_t poly)
     
    void poly_draw_pretty (const fmpz_poly_t poly)
     
    -

    Detailed Description

    -

    operations on polynomials

    -

    This files purpose is to handle polynomials in general, allowing modification, arithmetic and common algorithms like inverting them.

    - -

    Definition in file ntru_poly.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void fmpz_add_n (fmpz_t f,
    const fmpz_t g,
    const fmpz_t h 
    )
    -
    -

    The same as fmpz_add() except that it handles NULL pointer for g and h.

    - -

    Definition at line 222 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    int fmpz_cmp_si_n (const fmpz_t f,
    slong g 
    )
    -
    -

    The same as fmpz_cmp_si except that it will interpret f as a 0-coefficient if it is a NULL pointer.

    -
    Parameters
    - - - -
    fthe fmpz value to use for comparison
    gthe signed long integer to use for comparison
    -
    -
    -
    Returns
    negative value if f < g, positiv evalue if g < f, otherwise 0
    - -

    Definition at line 93 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    int fmpz_invmod_ui (fmpz_t f,
    const fmpz_t g,
    const uint32_t mod 
    )
    -
    -

    Wrapper around fmpz_invmod() where we convert mod to an fmpz_t implicitly.

    -
    Parameters
    - - - - -
    fresult [out]
    gthe inverse
    modthe modulo
    -
    -
    - -

    Definition at line 210 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void fmpz_poly_mod (fmpz_poly_t a,
    const uint32_t mod 
    )
    -
    -

    Calls fmpz_poly_get_nmod_poly() and fmpz_poly_set_nmod_poly() in a row, so we don't have to deal with the intermediate nmod_poly_t type if we don't need it.

    -

    This also normalises the coefficients to the interval -m/2 <= r < m/2.

    -
    Parameters
    - - - -
    athe polynom to apply the modulus to
    modthe modulus
    -
    -
    - -

    Definition at line 182 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void fmpz_poly_mod_unsigned (fmpz_poly_t a,
    const uint32_t mod 
    )
    -
    -

    Calls fmpz_poly_get_nmod_poly() and fmpz_poly_set_nmod_poly_unsigned() in a row, so we don't have to deal with the intermediate nmod_poly_t type if we don't need it.

    -

    This also normalises the coefficients to the interval 0 <= r < m.

    -
    Parameters
    - - - -
    athe polynom to apply the modulus to
    modthe modulus
    -
    -
    - -

    Definition at line 166 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void fmpz_poly_set_coeff_fmpz_n (fmpz_poly_t poly,
    slong n,
    const fmpz_t x 
    )
    -
    -

    The same as fmpz_poly_set_coeff_fmpz() except that it will take care of null-pointer coefficients and use fmpz_poly_set_coeff_si() in that case.

    -
    Parameters
    - - - - -
    polythe polynom we want to change a coefficient of
    nthe coefficient we want to set
    xthe value to assign to the coefficient
    -
    -
    - -

    Definition at line 198 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_delete (fmpz_poly_t poly)
    -
    -

    This deletes the internal structure of a polynomial, and frees the pointer.

    -
    Parameters
    - - -
    polythe polynomial to delete
    -
    -
    - -

    Definition at line 123 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void poly_delete_all (fmpz_poly_t poly,
     ... 
    )
    -
    -

    This deletes the internal structure of all polynomials, and frees the pointers. You must call this with NULL as last argument!

    -
    Parameters
    - - - -
    polythe polynomial to delete
    ...follow up polynomials
    -
    -
    - -

    Definition at line 149 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_delete_array (fmpz_poly_t ** poly_array)
    -
    -

    Delete the internal structure of a polynomial array which must be NULL terminated. It is expected that poly_array is not on the stack and was obtained by a function like ascii_to_poly().

    -
    Parameters
    - - -
    poly_arraythe polynomial array
    -
    -
    - -

    Definition at line 131 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_draw (const fmpz_poly_t poly)
    -
    -

    Draws a polynomial to stdout.

    -
    Parameters
    - - -
    polydraw this
    -
    -
    - -

    Definition at line 574 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_draw_pretty (const fmpz_poly_t poly)
    -
    -

    Draws a polynomial to stdout, in pretty format.

    -
    Parameters
    - - -
    polydraw this
    -
    -
    - -

    Definition at line 583 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool poly_inverse_poly_p (const fmpz_poly_t a,
    fmpz_poly_t Fp,
    const ntru_paramsparams 
    )
    -
    -

    Compute the inverse of a polynomial in (Z/pZ)[X]/(X^N - 1). See NTRU Cryptosystems Tech Report #014 "Almost Inverses -and Fast NTRU Key Creation."

    -
    Parameters
    - - - - -
    apolynomial to invert
    Fppolynomial [out]
    paramsNTRU parameters
    -
    -
    -
    Returns
    true if invertible, false if not
    - -

    Definition at line 409 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool poly_inverse_poly_q (const fmpz_poly_t a,
    fmpz_poly_t Fq,
    const ntru_paramsparams 
    )
    -
    -

    Compute the inverse of a polynomial in modulo a power of 2, which is q. This is based off the pseudo-code for "Inversion -in (Z/2Z)[X](X^N - 1)" and "Inversion in (Z/p^r Z)[X](X^N - 1)". See NTRU Cryptosystems Tech Report #014 "Almost Inverses -and Fast NTRU Key Creation."

    -
    Parameters
    - - - - -
    apolynomial to invert (is allowed to be the same as param Fq)
    Fqpolynomial [out]
    paramsNTRU parameters
    -
    -
    -
    Returns
    true if invertible, false if not
    - -

    Definition at line 297 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static void poly_mod2_to_modq (const fmpz_poly_t a,
    fmpz_poly_t Fq,
    const ntru_paramsparams 
    )
    -
    -static
    -
    -

    Find the inverse polynomial modulo a power of 2, which is q.

    -
    Parameters
    - - - - -
    apolynomial to invert
    Fqpolynomial [out]
    paramsNTRU parameters
    -
    -
    - -

    Definition at line 63 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void poly_new (fmpz_poly_t new_poly,
    int const *const c,
    const size_t len 
    )
    -
    -

    Initializes and builds a polynomial with the coefficient values of c[] of size len within NTRU parameters and returns a newly allocated polynomial. For an empty polynom, both c and len can be NULL/0.

    -
    Parameters
    - - - - -
    new_polythe polynomial to initialize and fill with coefficients [out]
    carray of polynomial coefficients, can be NULL
    lensize of the coefficient array, can be 0
    -
    -
    -
    Returns
    newly allocated polynomial pointer, must be freed with fmpz_poly_clear()
    - -

    Definition at line 110 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void poly_starmultiply (const fmpz_poly_t a,
    const fmpz_poly_t b,
    fmpz_poly_t c,
    const ntru_paramsparams,
    uint32_t modulus 
    )
    -
    -

    Starmultiplication, as follows: c = a * b mod (x^N − 1)

    -
    Parameters
    - - - - - - -
    apolynom to multiply (can be the same as c)
    bpolynom to multiply
    cpolynom [out]
    paramsNTRU parameters
    moduluswhether we use p or q
    -
    -
    - -

    Definition at line 239 of file ntru_poly.c.

    - -
    -
    -
    - - - - diff --git a/ntru__poly_8c__incl.map b/ntru__poly_8c__incl.map deleted file mode 100644 index 321dc34..0000000 --- a/ntru__poly_8c__incl.map +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ntru__poly_8c__incl.md5 b/ntru__poly_8c__incl.md5 deleted file mode 100644 index b18f49e..0000000 --- a/ntru__poly_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -09a30adc8579de2bd9491c9e1363cf87 \ No newline at end of file diff --git a/ntru__poly_8c__incl.png b/ntru__poly_8c__incl.png deleted file mode 100644 index dfb0851..0000000 Binary files a/ntru__poly_8c__incl.png and /dev/null differ diff --git a/ntru__poly_8c_source.html b/ntru__poly_8c_source.html deleted file mode 100644 index e5e7d61..0000000 --- a/ntru__poly_8c_source.html +++ /dev/null @@ -1,696 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_poly.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    30 #include "ntru_err.h"
    -
    31 #include "ntru_mem.h"
    -
    32 #include "ntru_params.h"
    -
    33 #include "ntru_poly.h"
    -
    34 
    -
    35 #include <stdarg.h>
    -
    36 #include <stdbool.h>
    -
    37 #include <stdint.h>
    -
    38 #include <stdio.h>
    -
    39 #include <stdlib.h>
    -
    40 #include <sys/types.h>
    -
    41 
    -
    42 #include <fmpz_poly.h>
    -
    43 #include <fmpz.h>
    -
    44 
    -
    45 
    -
    54 static
    -
    55 void poly_mod2_to_modq(const fmpz_poly_t a,
    -
    56  fmpz_poly_t Fq,
    -
    57  const ntru_params *params);
    -
    58 
    -
    59 
    -
    60 /*------------------------------------------------------------------------*/
    -
    61 
    -
    62 static void
    -
    63 poly_mod2_to_modq(const fmpz_poly_t a,
    -
    64  fmpz_poly_t Fq,
    -
    65  const ntru_params *params)
    -
    66 {
    -
    67  int v = 2;
    -
    68  fmpz_poly_t poly_tmp, two;
    -
    69 
    -
    70  fmpz_poly_init(poly_tmp);
    -
    71  fmpz_poly_zero(poly_tmp);
    -
    72  fmpz_poly_init(two);
    -
    73  fmpz_poly_set_coeff_ui(two, 0, 2);
    -
    74 
    -
    75  while (v < (int)(params->q)) {
    -
    76  v = v * 2;
    -
    77 
    -
    78  poly_starmultiply(a, Fq, poly_tmp, params, v);
    -
    79  fmpz_poly_sub(poly_tmp, two, poly_tmp);
    -
    80  fmpz_poly_mod_unsigned(poly_tmp, v);
    -
    81  poly_starmultiply(Fq, poly_tmp, Fq, params, v);
    -
    82 
    -
    83  }
    -
    84 
    -
    85  fmpz_poly_clear(poly_tmp);
    -
    86  fmpz_poly_clear(two);
    -
    87 
    -
    88 }
    -
    89 
    -
    90 /*------------------------------------------------------------------------*/
    -
    91 
    -
    92 int
    -
    93 fmpz_cmp_si_n(const fmpz_t f, slong g)
    -
    94 {
    -
    95  fmpz_t f_cmp;
    -
    96 
    -
    97  fmpz_init(f_cmp);
    -
    98 
    -
    99  if (f)
    -
    100  fmpz_set(f_cmp, f);
    -
    101  else
    -
    102  fmpz_set_si(f_cmp, 0);
    -
    103 
    -
    104  return fmpz_cmp_si(f_cmp, g);
    -
    105 }
    -
    106 
    -
    107 /*------------------------------------------------------------------------*/
    -
    108 
    -
    109 void
    -
    110 poly_new(fmpz_poly_t new_poly,
    -
    111  int const * const c,
    -
    112  const size_t len)
    -
    113 {
    -
    114  fmpz_poly_init(new_poly);
    -
    115 
    -
    116  for (uint32_t i = 0; i < len; i++)
    -
    117  fmpz_poly_set_coeff_si(new_poly, i, c[i]);
    -
    118 }
    -
    119 
    -
    120 /*------------------------------------------------------------------------*/
    -
    121 
    -
    122 void
    -
    123 poly_delete(fmpz_poly_t poly)
    -
    124 {
    -
    125  fmpz_poly_clear(poly);
    -
    126 }
    -
    127 
    -
    128 /*------------------------------------------------------------------------*/
    -
    129 
    -
    130 void
    -
    131 poly_delete_array(fmpz_poly_t **poly_array)
    -
    132 {
    -
    133  uint32_t i = 0;
    -
    134 
    -
    135  while(poly_array[i]) {
    -
    136  poly_delete(*(poly_array[i]));
    -
    137  free(poly_array[i]);
    -
    138  i++;
    -
    139  }
    -
    140 
    -
    141  /* avoid double free */
    -
    142  if (i > 1)
    -
    143  free(poly_array);
    -
    144 }
    -
    145 
    -
    146 /*------------------------------------------------------------------------*/
    -
    147 
    -
    148 void
    -
    149 poly_delete_all(fmpz_poly_t poly, ...)
    -
    150 {
    -
    151  fmpz_poly_struct *next_poly;
    -
    152  va_list args;
    -
    153 
    -
    154  next_poly = poly;
    -
    155  va_start(args, poly);
    -
    156  while (next_poly != NULL) {
    -
    157  poly_delete(next_poly);
    -
    158  next_poly = va_arg(args, fmpz_poly_struct*);
    -
    159  }
    -
    160  va_end(args);
    -
    161 }
    -
    162 
    -
    163 /*------------------------------------------------------------------------*/
    -
    164 
    -
    165 void
    - -
    167  const uint32_t mod)
    -
    168 {
    -
    169  nmod_poly_t nmod_tmp;
    -
    170 
    -
    171  nmod_poly_init(nmod_tmp, mod);
    -
    172 
    -
    173  fmpz_poly_get_nmod_poly(nmod_tmp, a);
    -
    174  fmpz_poly_set_nmod_poly_unsigned(a, nmod_tmp);
    -
    175 
    -
    176  nmod_poly_clear(nmod_tmp);
    -
    177 }
    -
    178 
    -
    179 /*------------------------------------------------------------------------*/
    -
    180 
    -
    181 void
    -
    182 fmpz_poly_mod(fmpz_poly_t a,
    -
    183  const uint32_t mod)
    -
    184 {
    -
    185  nmod_poly_t nmod_tmp;
    -
    186 
    -
    187  nmod_poly_init(nmod_tmp, mod);
    -
    188 
    -
    189  fmpz_poly_get_nmod_poly(nmod_tmp, a);
    -
    190  fmpz_poly_set_nmod_poly(a, nmod_tmp);
    -
    191 
    -
    192  nmod_poly_clear(nmod_tmp);
    -
    193 }
    -
    194 
    -
    195 /*------------------------------------------------------------------------*/
    -
    196 
    -
    197 void
    -
    198 fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n,
    -
    199  const fmpz_t x)
    -
    200 {
    -
    201  if (x)
    -
    202  fmpz_poly_set_coeff_fmpz(poly, n, x);
    -
    203  else
    -
    204  fmpz_poly_set_coeff_si(poly, n, 0);
    -
    205 }
    -
    206 
    -
    207 /*------------------------------------------------------------------------*/
    -
    208 
    -
    209 int
    -
    210 fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod)
    -
    211 {
    -
    212  fmpz_t modulus;
    -
    213 
    -
    214  fmpz_init_set_ui(modulus, mod);
    -
    215 
    -
    216  return fmpz_invmod(f, g, modulus);
    -
    217 }
    -
    218 
    -
    219 /*------------------------------------------------------------------------*/
    -
    220 
    -
    221 void
    -
    222 fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h)
    -
    223 {
    -
    224  if (!g && !h) {
    -
    225  fmpz_zero(f);
    -
    226  } else {
    -
    227  if (!g && h)
    -
    228  fmpz_add_ui(f, h, 0);
    -
    229  else if (g && !h)
    -
    230  fmpz_add_ui(f, g, 0);
    -
    231  else
    -
    232  fmpz_add(f, g, h);
    -
    233  }
    -
    234 }
    -
    235 
    -
    236 /*------------------------------------------------------------------------*/
    -
    237 
    -
    238 void
    -
    239 poly_starmultiply(const fmpz_poly_t a,
    -
    240  const fmpz_poly_t b,
    -
    241  fmpz_poly_t c,
    -
    242  const ntru_params *params,
    -
    243  uint32_t modulus)
    -
    244 {
    -
    245  fmpz_poly_t a_tmp;
    -
    246  fmpz_t c_coeff_k;
    -
    247 
    -
    248  fmpz_poly_init(a_tmp);
    -
    249  fmpz_init(c_coeff_k);
    -
    250 
    -
    251  /* avoid side effects */
    -
    252  fmpz_poly_set(a_tmp, a);
    -
    253  fmpz_poly_zero(c);
    -
    254 
    -
    255  for (int k = params->N - 1; k >= 0; k--) {
    -
    256  int j;
    -
    257 
    -
    258  j = k + 1;
    -
    259 
    -
    260  fmpz_set_si(c_coeff_k, 0);
    -
    261 
    -
    262  for (int i = params->N - 1; i >= 0; i--) {
    -
    263  fmpz *a_tmp_coeff_i,
    -
    264  *b_coeff_j;
    -
    265 
    -
    266  if (j == (int)(params->N))
    -
    267  j = 0;
    -
    268 
    -
    269  a_tmp_coeff_i = fmpz_poly_get_coeff_ptr(a_tmp, i);
    -
    270  b_coeff_j = fmpz_poly_get_coeff_ptr(b, j);
    -
    271 
    -
    272  if (fmpz_cmp_si_n(a_tmp_coeff_i, 0) &&
    -
    273  fmpz_cmp_si_n(b_coeff_j, 0)) {
    -
    274  fmpz_t fmpz_tmp;
    -
    275 
    -
    276  fmpz_init(fmpz_tmp);
    -
    277 
    -
    278  fmpz_mul(fmpz_tmp, a_tmp_coeff_i, b_coeff_j);
    -
    279  fmpz_add(fmpz_tmp, fmpz_tmp, c_coeff_k);
    -
    280  fmpz_mod_ui(c_coeff_k, fmpz_tmp, modulus);
    -
    281 
    -
    282  fmpz_poly_set_coeff_fmpz(c, k, c_coeff_k);
    -
    283 
    -
    284  fmpz_clear(fmpz_tmp);
    -
    285  }
    -
    286  j++;
    -
    287  }
    -
    288  fmpz_clear(c_coeff_k);
    -
    289  }
    -
    290 
    -
    291  fmpz_poly_clear(a_tmp);
    -
    292 }
    -
    293 
    -
    294 /*------------------------------------------------------------------------*/
    -
    295 
    -
    296 bool
    -
    297 poly_inverse_poly_q(const fmpz_poly_t a,
    -
    298  fmpz_poly_t Fq,
    -
    299  const ntru_params *params)
    -
    300 {
    -
    301  bool retval = false;
    -
    302  int k = 0,
    -
    303  j = 0;
    -
    304  fmpz *b_last;
    -
    305  fmpz_poly_t a_tmp,
    -
    306  b,
    -
    307  c,
    -
    308  f,
    -
    309  g;
    -
    310 
    -
    311  /* general initialization of temp variables */
    -
    312  fmpz_poly_init(b);
    -
    313  fmpz_poly_set_coeff_ui(b, 0, 1);
    -
    314  fmpz_poly_init(c);
    -
    315  fmpz_poly_init(f);
    -
    316  fmpz_poly_set(f, a);
    -
    317 
    -
    318  /* set g(x) = x^N − 1 */
    -
    319  fmpz_poly_init(g);
    -
    320  fmpz_poly_set_coeff_si(g, 0, -1);
    -
    321  fmpz_poly_set_coeff_si(g, params->N, 1);
    -
    322 
    -
    323  /* avoid side effects */
    -
    324  fmpz_poly_init(a_tmp);
    -
    325  fmpz_poly_set(a_tmp, a);
    -
    326  fmpz_poly_zero(Fq);
    -
    327 
    -
    328  while (1) {
    -
    329  while (fmpz_is_zero(fmpz_poly_get_coeff_ptr(f, 0))) {
    -
    330  for (uint32_t i = 1; i <= params->N; i++) {
    -
    331  fmpz *f_coeff = fmpz_poly_get_coeff_ptr(f, i);
    -
    332  fmpz *c_coeff = fmpz_poly_get_coeff_ptr(c, params->N - i);
    -
    333 
    -
    334  /* f(x) = f(x) / x */
    - -
    336  f_coeff);
    -
    337 
    -
    338  /* c(x) = c(x) * x */
    -
    339  fmpz_poly_set_coeff_fmpz_n(c, params->N + 1 - i,
    -
    340  c_coeff);
    -
    341  }
    -
    342 
    -
    343  fmpz_poly_set_coeff_si(f, params->N, 0);
    -
    344  fmpz_poly_set_coeff_si(c, 0, 0);
    -
    345 
    -
    346  k++;
    -
    347 
    -
    348  if (fmpz_poly_degree(f) == -1)
    -
    349  goto _cleanup;
    -
    350  }
    -
    351 
    -
    352  if (fmpz_poly_degree(f) == 0)
    -
    353  break;
    -
    354 
    -
    355  if (fmpz_poly_degree(f) < fmpz_poly_degree(g)) {
    -
    356  fmpz_poly_swap(f, g);
    -
    357  fmpz_poly_swap(b, c);
    -
    358  }
    -
    359 
    -
    360  fmpz_poly_add(f, g, f);
    - -
    362 
    -
    363  fmpz_poly_add(b, c, b);
    - -
    365  }
    -
    366 
    -
    367  k = k % params->N;
    -
    368 
    -
    369  b_last = fmpz_poly_get_coeff_ptr(b, params->N);
    -
    370  if (fmpz_cmp_si_n(b_last, 0))
    -
    371  goto _cleanup;
    -
    372 
    -
    373  /* Fq(x) = x^(N-k) * b(x) */
    -
    374  for (int i = params->N - 1; i >= 0; i--) {
    -
    375  fmpz *b_i;
    -
    376 
    -
    377  j = i - k;
    -
    378 
    -
    379  if (j < 0)
    -
    380  j = j + params->N;
    -
    381 
    -
    382  b_i = fmpz_poly_get_coeff_ptr(b, i);
    -
    383  fmpz_poly_set_coeff_fmpz_n(Fq, j, b_i);
    -
    384  }
    -
    385 
    -
    386  poly_mod2_to_modq(a_tmp, Fq, params);
    -
    387 
    -
    388  /* check if the f * Fq = 1 (mod p) condition holds true */
    -
    389  fmpz_poly_set(a_tmp, a);
    -
    390  poly_starmultiply(a_tmp, Fq, a_tmp, params, params->q);
    -
    391  if (fmpz_poly_is_one(a_tmp))
    -
    392  retval = true;
    -
    393  else
    -
    394  fmpz_poly_zero(Fq);
    -
    395 
    -
    396 _cleanup:
    -
    397  fmpz_poly_clear(a_tmp);
    -
    398  fmpz_poly_clear(b);
    -
    399  fmpz_poly_clear(c);
    -
    400  fmpz_poly_clear(f);
    -
    401  fmpz_poly_clear(g);
    -
    402 
    -
    403  return retval;
    -
    404 }
    -
    405 
    -
    406 /*------------------------------------------------------------------------*/
    -
    407 
    -
    408 bool
    -
    409 poly_inverse_poly_p(const fmpz_poly_t a,
    -
    410  fmpz_poly_t Fp,
    -
    411  const ntru_params *params)
    -
    412 {
    -
    413  bool retval = false;
    -
    414  int k = 0,
    -
    415  j = 0;
    -
    416  fmpz *b_last;
    -
    417  fmpz_poly_t a_tmp,
    -
    418  b,
    -
    419  c,
    -
    420  f,
    -
    421  g;
    -
    422 
    -
    423  /* general initialization of temp variables */
    -
    424  fmpz_poly_init(b);
    -
    425  fmpz_poly_set_coeff_ui(b, 0, 1);
    -
    426  fmpz_poly_init(c);
    -
    427  fmpz_poly_init(f);
    -
    428  fmpz_poly_set(f, a);
    -
    429 
    -
    430  /* set g(x) = x^N − 1 */
    -
    431  fmpz_poly_init(g);
    -
    432  fmpz_poly_set_coeff_si(g, 0, -1);
    -
    433  fmpz_poly_set_coeff_si(g, params->N, 1);
    -
    434 
    -
    435  /* avoid side effects */
    -
    436  fmpz_poly_init(a_tmp);
    -
    437  fmpz_poly_set(a_tmp, a);
    -
    438  fmpz_poly_zero(Fp);
    -
    439 
    -
    440  while (1) {
    -
    441  while (fmpz_is_zero(fmpz_poly_get_coeff_ptr(f, 0))) {
    -
    442  for (uint32_t i = 1; i <= params->N; i++) {
    -
    443  fmpz *f_coeff = fmpz_poly_get_coeff_ptr(f, i);
    -
    444  fmpz *c_coeff = fmpz_poly_get_coeff_ptr(c, params->N - i);
    -
    445 
    -
    446  /* f(x) = f(x) / x */
    - -
    448  f_coeff);
    -
    449 
    -
    450  /* c(x) = c(x) * x */
    -
    451  fmpz_poly_set_coeff_fmpz_n(c, params->N + 1 - i,
    -
    452  c_coeff);
    -
    453  }
    -
    454 
    -
    455  fmpz_poly_set_coeff_si(f, params->N, 0);
    -
    456  fmpz_poly_set_coeff_si(c, 0, 0);
    -
    457 
    -
    458  k++;
    -
    459 
    -
    460  if (fmpz_poly_degree(f) == -1)
    -
    461  goto cleanup;
    -
    462  }
    -
    463 
    -
    464  if (fmpz_poly_degree(f) == 0)
    -
    465  break;
    -
    466 
    -
    467  if (fmpz_poly_degree(f) < fmpz_poly_degree(g)) {
    -
    468  /* exchange f and g and exchange b and c */
    -
    469  fmpz_poly_swap(f, g);
    -
    470  fmpz_poly_swap(b, c);
    -
    471  }
    -
    472 
    -
    473  {
    -
    474  fmpz_poly_t c_tmp,
    -
    475  g_tmp;
    -
    476  fmpz_t u,
    -
    477  mp_tmp;
    -
    478 
    -
    479  fmpz_init(u);
    -
    480  fmpz_zero(u);
    -
    481 
    -
    482  fmpz_init_set(mp_tmp, fmpz_poly_get_coeff_ptr(f, 0));
    -
    483 
    -
    484  fmpz_poly_init(g_tmp);
    -
    485  fmpz_poly_set(g_tmp, g);
    -
    486 
    -
    487  fmpz_poly_init(c_tmp);
    -
    488  fmpz_poly_set(c_tmp, c);
    -
    489 
    -
    490  /* u = f[0] * g[0]^(-1) mod p */
    -
    491  /* = (f[0] mod p) * (g[0] inverse mod p) mod p */
    -
    492  fmpz_invmod_ui(u,
    -
    493  fmpz_poly_get_coeff_ptr(g, 0),
    -
    494  params->p);
    -
    495  fmpz_mod_ui(mp_tmp, mp_tmp, params->p);
    -
    496  fmpz_mul(u, mp_tmp, u);
    -
    497  fmpz_mod_ui(u, u, params->p);
    -
    498 
    -
    499  /* f = f - u * g mod p */
    -
    500  fmpz_poly_scalar_mul_fmpz(g_tmp, g_tmp, u);
    -
    501  fmpz_poly_sub(f, g_tmp, f);
    -
    502  fmpz_poly_mod_unsigned(f, params->p);
    -
    503 
    -
    504  /* b = b - u * c mod p */
    -
    505  fmpz_poly_scalar_mul_fmpz(c_tmp, c_tmp, u);
    -
    506  fmpz_poly_sub(b, c_tmp, b);
    -
    507  fmpz_poly_mod_unsigned(b, params->p);
    -
    508 
    -
    509  fmpz_clear(u);
    -
    510  fmpz_poly_clear(g_tmp);
    -
    511  fmpz_poly_clear(c_tmp);
    -
    512  }
    -
    513  }
    -
    514 
    -
    515  k = k % params->N;
    -
    516 
    -
    517  b_last = fmpz_poly_get_coeff_ptr(b, params->N);
    -
    518  if (fmpz_cmp_si_n(b_last, 0))
    -
    519  goto cleanup;
    -
    520 
    -
    521  /* Fp(x) = x^(N-k) * b(x) */
    -
    522  for (int i = params->N - 1; i >= 0; i--) {
    -
    523  fmpz *b_i;
    -
    524 
    -
    525  /* b(X) = f[0]^(-1) * b(X) (mod p) */
    -
    526  {
    -
    527  fmpz_t mp_tmp;
    -
    528 
    -
    529  fmpz_init(mp_tmp);
    -
    530 
    -
    531  fmpz_invmod_ui(mp_tmp,
    -
    532  fmpz_poly_get_coeff_ptr(f, 0),
    -
    533  params->p);
    -
    534 
    -
    535  if (fmpz_poly_get_coeff_ptr(b, i)) {
    -
    536  fmpz_mul(fmpz_poly_get_coeff_ptr(b, i),
    -
    537  fmpz_poly_get_coeff_ptr(b, i),
    -
    538  mp_tmp);
    -
    539  fmpz_mod_ui(fmpz_poly_get_coeff_ptr(b, i),
    -
    540  fmpz_poly_get_coeff_ptr(b, i),
    -
    541  params->p);
    -
    542  }
    -
    543  }
    -
    544 
    -
    545  j = i - k;
    -
    546  if (j < 0)
    -
    547  j = j + params->N;
    -
    548 
    -
    549  b_i = fmpz_poly_get_coeff_ptr(b, i);
    -
    550  fmpz_poly_set_coeff_fmpz_n(Fp, j, b_i);
    -
    551  }
    -
    552 
    -
    553  /* check if the f * Fp = 1 (mod p) condition holds true */
    -
    554  fmpz_poly_set(a_tmp, a);
    -
    555  poly_starmultiply(a_tmp, Fp, a_tmp, params, params->p);
    -
    556  if (fmpz_poly_is_one(a_tmp))
    -
    557  retval = true;
    -
    558  else
    -
    559  fmpz_poly_zero(Fp);
    -
    560 
    -
    561 cleanup:
    -
    562  fmpz_poly_clear(a_tmp);
    -
    563  fmpz_poly_clear(b);
    -
    564  fmpz_poly_clear(c);
    -
    565  fmpz_poly_clear(f);
    -
    566  fmpz_poly_clear(g);
    -
    567 
    -
    568  return retval;
    -
    569 }
    -
    570 
    -
    571 /*------------------------------------------------------------------------*/
    -
    572 
    -
    573 void
    -
    574 poly_draw(const fmpz_poly_t poly)
    -
    575 {
    -
    576  fmpz_poly_print(poly);
    -
    577  flint_printf("\n");
    -
    578 }
    -
    579 
    -
    580 /*------------------------------------------------------------------------*/
    -
    581 
    -
    582 void
    -
    583 poly_draw_pretty(const fmpz_poly_t poly)
    -
    584 {
    -
    585  fmpz_poly_print_pretty(poly, "x");
    -
    586  flint_printf("\n");
    -
    587 }
    -
    588 
    -
    589 /*------------------------------------------------------------------------*/
    -
    bool poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
    Definition: ntru_poly.c:297
    -
    uint32_t N
    Definition: ntru_params.h:48
    -
    void fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:166
    -
    void fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:182
    -
    uint32_t p
    Definition: ntru_params.h:56
    -
    bool poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params)
    Definition: ntru_poly.c:409
    - -
    header for ntru_mem.c
    -
    int fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod)
    Definition: ntru_poly.c:210
    -
    void poly_draw(const fmpz_poly_t poly)
    Definition: ntru_poly.c:574
    -
    NTRU parameters.
    -
    void fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n, const fmpz_t x)
    Definition: ntru_poly.c:198
    -
    void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
    Definition: ntru_poly.c:239
    -
    void poly_delete(fmpz_poly_t poly)
    Definition: ntru_poly.c:123
    -
    void poly_delete_all(fmpz_poly_t poly,...)
    Definition: ntru_poly.c:149
    -
    error handling
    -
    void poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len)
    Definition: ntru_poly.c:110
    -
    void poly_delete_array(fmpz_poly_t **poly_array)
    Definition: ntru_poly.c:131
    -
    void fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h)
    Definition: ntru_poly.c:222
    -
    uint32_t q
    Definition: ntru_params.h:52
    -
    int fmpz_cmp_si_n(const fmpz_t f, slong g)
    Definition: ntru_poly.c:93
    -
    void poly_draw_pretty(const fmpz_poly_t poly)
    Definition: ntru_poly.c:583
    -
    header for ntru_poly.c
    -
    static void poly_mod2_to_modq(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
    Definition: ntru_poly.c:63
    -
    - - - - diff --git a/ntru__poly_8h.html b/ntru__poly_8h.html deleted file mode 100644 index d64d639..0000000 --- a/ntru__poly_8h.html +++ /dev/null @@ -1,720 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_poly.h File Reference
    -
    -
    - -

    header for ntru_poly.c -More...

    -
    #include "ntru_err.h"
    -#include "ntru_params.h"
    -#include <stdarg.h>
    -#include <stdbool.h>
    -#include <stdint.h>
    -#include <stdlib.h>
    -#include <fmpz_poly.h>
    -
    -Include dependency graph for ntru_poly.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    int fmpz_cmp_si_n (const fmpz_t f, slong g)
     
    void poly_new (fmpz_poly_t new_poly, int const *const c, const size_t len)
     
    void poly_delete (fmpz_poly_t poly)
     
    void poly_delete_array (fmpz_poly_t **poly_array)
     
    void poly_delete_all (fmpz_poly_t poly,...)
     
    void fmpz_poly_mod_unsigned (fmpz_poly_t a, const uint32_t mod)
     
    void fmpz_poly_mod (fmpz_poly_t a, const uint32_t mod)
     
    void fmpz_poly_set_coeff_fmpz_n (fmpz_poly_t poly, slong n, const fmpz_t x)
     
    int fmpz_invmod_ui (fmpz_t f, const fmpz_t g, const uint32_t mod)
     
    void fmpz_add_n (fmpz_t f, const fmpz_t g, const fmpz_t h)
     
    void poly_starmultiply (const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
     
    bool poly_inverse_poly_q (const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
     
    bool poly_inverse_poly_p (const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params)
     
    void poly_draw (const fmpz_poly_t poly)
     
    void poly_draw_pretty (const fmpz_poly_t poly)
     
    -

    Detailed Description

    -

    header for ntru_poly.c

    -

    Header for the internal API of ntru_poly.c.

    - -

    Definition in file ntru_poly.h.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void fmpz_add_n (fmpz_t f,
    const fmpz_t g,
    const fmpz_t h 
    )
    -
    -

    The same as fmpz_add() except that it handles NULL pointer for g and h.

    - -

    Definition at line 222 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    int fmpz_cmp_si_n (const fmpz_t f,
    slong g 
    )
    -
    -

    The same as fmpz_cmp_si except that it will interpret f as a 0-coefficient if it is a NULL pointer.

    -
    Parameters
    - - - -
    fthe fmpz value to use for comparison
    gthe signed long integer to use for comparison
    -
    -
    -
    Returns
    negative value if f < g, positiv evalue if g < f, otherwise 0
    - -

    Definition at line 93 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    int fmpz_invmod_ui (fmpz_t f,
    const fmpz_t g,
    const uint32_t mod 
    )
    -
    -

    Wrapper around fmpz_invmod() where we convert mod to an fmpz_t implicitly.

    -
    Parameters
    - - - - -
    fresult [out]
    gthe inverse
    modthe modulo
    -
    -
    - -

    Definition at line 210 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void fmpz_poly_mod (fmpz_poly_t a,
    const uint32_t mod 
    )
    -
    -

    Calls fmpz_poly_get_nmod_poly() and fmpz_poly_set_nmod_poly() in a row, so we don't have to deal with the intermediate nmod_poly_t type if we don't need it.

    -

    This also normalises the coefficients to the interval -m/2 <= r < m/2.

    -
    Parameters
    - - - -
    athe polynom to apply the modulus to
    modthe modulus
    -
    -
    - -

    Definition at line 182 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void fmpz_poly_mod_unsigned (fmpz_poly_t a,
    const uint32_t mod 
    )
    -
    -

    Calls fmpz_poly_get_nmod_poly() and fmpz_poly_set_nmod_poly_unsigned() in a row, so we don't have to deal with the intermediate nmod_poly_t type if we don't need it.

    -

    This also normalises the coefficients to the interval 0 <= r < m.

    -
    Parameters
    - - - -
    athe polynom to apply the modulus to
    modthe modulus
    -
    -
    - -

    Definition at line 166 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void fmpz_poly_set_coeff_fmpz_n (fmpz_poly_t poly,
    slong n,
    const fmpz_t x 
    )
    -
    -

    The same as fmpz_poly_set_coeff_fmpz() except that it will take care of null-pointer coefficients and use fmpz_poly_set_coeff_si() in that case.

    -
    Parameters
    - - - - -
    polythe polynom we want to change a coefficient of
    nthe coefficient we want to set
    xthe value to assign to the coefficient
    -
    -
    - -

    Definition at line 198 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_delete (fmpz_poly_t poly)
    -
    -

    This deletes the internal structure of a polynomial, and frees the pointer.

    -
    Parameters
    - - -
    polythe polynomial to delete
    -
    -
    - -

    Definition at line 123 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void poly_delete_all (fmpz_poly_t poly,
     ... 
    )
    -
    -

    This deletes the internal structure of all polynomials, and frees the pointers. You must call this with NULL as last argument!

    -
    Parameters
    - - - -
    polythe polynomial to delete
    ...follow up polynomials
    -
    -
    - -

    Definition at line 149 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_delete_array (fmpz_poly_t ** poly_array)
    -
    -

    Delete the internal structure of a polynomial array which must be NULL terminated. It is expected that poly_array is not on the stack and was obtained by a function like ascii_to_poly().

    -
    Parameters
    - - -
    poly_arraythe polynomial array
    -
    -
    - -

    Definition at line 131 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_draw (const fmpz_poly_t poly)
    -
    -

    Draws a polynomial to stdout.

    -
    Parameters
    - - -
    polydraw this
    -
    -
    - -

    Definition at line 574 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void poly_draw_pretty (const fmpz_poly_t poly)
    -
    -

    Draws a polynomial to stdout, in pretty format.

    -
    Parameters
    - - -
    polydraw this
    -
    -
    - -

    Definition at line 583 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool poly_inverse_poly_p (const fmpz_poly_t a,
    fmpz_poly_t Fp,
    const ntru_paramsparams 
    )
    -
    -

    Compute the inverse of a polynomial in (Z/pZ)[X]/(X^N - 1). See NTRU Cryptosystems Tech Report #014 "Almost Inverses -and Fast NTRU Key Creation."

    -
    Parameters
    - - - - -
    apolynomial to invert
    Fppolynomial [out]
    paramsNTRU parameters
    -
    -
    -
    Returns
    true if invertible, false if not
    - -

    Definition at line 409 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool poly_inverse_poly_q (const fmpz_poly_t a,
    fmpz_poly_t Fq,
    const ntru_paramsparams 
    )
    -
    -

    Compute the inverse of a polynomial in modulo a power of 2, which is q. This is based off the pseudo-code for "Inversion -in (Z/2Z)[X](X^N - 1)" and "Inversion in (Z/p^r Z)[X](X^N - 1)". See NTRU Cryptosystems Tech Report #014 "Almost Inverses -and Fast NTRU Key Creation."

    -
    Parameters
    - - - - -
    apolynomial to invert (is allowed to be the same as param Fq)
    Fqpolynomial [out]
    paramsNTRU parameters
    -
    -
    -
    Returns
    true if invertible, false if not
    - -

    Definition at line 297 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void poly_new (fmpz_poly_t new_poly,
    int const *const c,
    const size_t len 
    )
    -
    -

    Initializes and builds a polynomial with the coefficient values of c[] of size len within NTRU parameters and returns a newly allocated polynomial. For an empty polynom, both c and len can be NULL/0.

    -
    Parameters
    - - - - -
    new_polythe polynomial to initialize and fill with coefficients [out]
    carray of polynomial coefficients, can be NULL
    lensize of the coefficient array, can be 0
    -
    -
    -
    Returns
    newly allocated polynomial pointer, must be freed with fmpz_poly_clear()
    - -

    Definition at line 110 of file ntru_poly.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void poly_starmultiply (const fmpz_poly_t a,
    const fmpz_poly_t b,
    fmpz_poly_t c,
    const ntru_paramsparams,
    uint32_t modulus 
    )
    -
    -

    Starmultiplication, as follows: c = a * b mod (x^N − 1)

    -
    Parameters
    - - - - - - -
    apolynom to multiply (can be the same as c)
    bpolynom to multiply
    cpolynom [out]
    paramsNTRU parameters
    moduluswhether we use p or q
    -
    -
    - -

    Definition at line 239 of file ntru_poly.c.

    - -
    -
    -
    - - - - diff --git a/ntru__poly_8h__incl.map b/ntru__poly_8h__incl.map deleted file mode 100644 index 563424f..0000000 --- a/ntru__poly_8h__incl.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ntru__poly_8h__incl.md5 b/ntru__poly_8h__incl.md5 deleted file mode 100644 index 1d9f111..0000000 --- a/ntru__poly_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -a5c08d5b8da9117d09078846c5a2687e \ No newline at end of file diff --git a/ntru__poly_8h__incl.png b/ntru__poly_8h__incl.png deleted file mode 100644 index db01507..0000000 Binary files a/ntru__poly_8h__incl.png and /dev/null differ diff --git a/ntru__poly_8h_source.html b/ntru__poly_8h_source.html deleted file mode 100644 index b13669a..0000000 --- a/ntru__poly_8h_source.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_poly.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_POLY_H
    -
    29 #define NTRU_POLY_H
    -
    30 
    -
    31 #include "ntru_err.h"
    -
    32 #include "ntru_params.h"
    -
    33 
    -
    34 #include <stdarg.h>
    -
    35 #include <stdbool.h>
    -
    36 #include <stdint.h>
    -
    37 #include <stdlib.h>
    -
    38 
    -
    39 #include <fmpz_poly.h>
    -
    40 
    -
    41 
    -
    50 int
    -
    51 fmpz_cmp_si_n(const fmpz_t f, slong g);
    -
    52 
    -
    66 void
    -
    67 poly_new(fmpz_poly_t new_poly,
    -
    68  int const * const c,
    -
    69  const size_t len);
    -
    70 
    -
    77 void
    -
    78 poly_delete(fmpz_poly_t poly);
    -
    79 
    -
    88 void
    -
    89 poly_delete_array(fmpz_poly_t **poly_array);
    -
    90 
    -
    99 void
    -
    100 poly_delete_all(fmpz_poly_t poly, ...);
    -
    101 
    -
    114 void
    -
    115 fmpz_poly_mod_unsigned(fmpz_poly_t a,
    -
    116  const uint32_t mod);
    -
    117 
    -
    130 void
    -
    131 fmpz_poly_mod(fmpz_poly_t a,
    -
    132  const uint32_t mod);
    -
    133 
    -
    143 void
    -
    144 fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly,
    -
    145  slong n,
    -
    146  const fmpz_t x);
    -
    147 
    -
    156 int
    -
    157 fmpz_invmod_ui(fmpz_t f,
    -
    158  const fmpz_t g,
    -
    159  const uint32_t mod);
    -
    160 
    -
    165 void
    -
    166 fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h);
    -
    167 
    -
    178 void
    -
    179 poly_starmultiply(const fmpz_poly_t a,
    -
    180  const fmpz_poly_t b,
    -
    181  fmpz_poly_t c,
    -
    182  const ntru_params *params,
    -
    183  uint32_t modulus);
    -
    184 
    -
    197 bool
    -
    198 poly_inverse_poly_q(const fmpz_poly_t a,
    -
    199  fmpz_poly_t Fq,
    -
    200  const ntru_params *params);
    -
    201 
    -
    212 bool
    -
    213 poly_inverse_poly_p(const fmpz_poly_t a,
    -
    214  fmpz_poly_t Fp,
    -
    215  const ntru_params *params);
    -
    216 
    -
    222 void
    -
    223 poly_draw(const fmpz_poly_t poly);
    -
    224 
    -
    231 void
    -
    232 poly_draw_pretty(const fmpz_poly_t poly);
    -
    233 
    -
    234 
    -
    235 #endif /* NTRU_POLY_H */
    -
    void poly_delete_all(fmpz_poly_t poly,...)
    Definition: ntru_poly.c:149
    -
    void fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n, const fmpz_t x)
    Definition: ntru_poly.c:198
    -
    int fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod)
    Definition: ntru_poly.c:210
    -
    void poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len)
    Definition: ntru_poly.c:110
    -
    void poly_draw(const fmpz_poly_t poly)
    Definition: ntru_poly.c:574
    - -
    NTRU parameters.
    -
    void fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:182
    -
    void poly_draw_pretty(const fmpz_poly_t poly)
    Definition: ntru_poly.c:583
    -
    bool poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params)
    Definition: ntru_poly.c:409
    -
    void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
    Definition: ntru_poly.c:239
    -
    void poly_delete_array(fmpz_poly_t **poly_array)
    Definition: ntru_poly.c:131
    -
    void fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h)
    Definition: ntru_poly.c:222
    -
    bool poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
    Definition: ntru_poly.c:297
    -
    void poly_delete(fmpz_poly_t poly)
    Definition: ntru_poly.c:123
    -
    error handling
    -
    void fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod)
    Definition: ntru_poly.c:166
    -
    int fmpz_cmp_si_n(const fmpz_t f, slong g)
    Definition: ntru_poly.c:93
    -
    - - - - diff --git a/ntru__poly__ascii_8c.html b/ntru__poly__ascii_8c.html deleted file mode 100644 index 55af04b..0000000 --- a/ntru__poly__ascii_8c.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly_ascii.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_poly_ascii.c File Reference
    -
    -
    - -

    polynomials to acii -More...

    -
    #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 <glib.h>
    -#include <stdint.h>
    -#include <stdlib.h>
    -#include <string.h>
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_poly_ascii.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - -

    -Functions

    static stringget_bin_arr_to_ascii (const char *binary_rep)
     
    stringbin_poly_to_ascii (const fmpz_poly_t poly, const ntru_params *params)
     
    stringbin_poly_arr_to_ascii (const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params)
     
    stringpoly_to_ascii (const fmpz_poly_t poly, const ntru_params *params)
     
    stringpoly_arr_to_ascii (const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
     
    stringpoly_to_base64 (const fmpz_poly_t poly, const ntru_params *params)
     
    stringpoly_arr_to_base64 (const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
     
    -

    Detailed Description

    -

    polynomials to acii

    -

    This file allows to convert polynomials to ascii strings, including base64 encoded.

    - -

    Definition in file ntru_poly_ascii.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    string* bin_poly_arr_to_ascii (const fmpz_poly_t ** bin_poly_arr,
    const uint32_t poly_c,
    const ntru_paramsparams 
    )
    -
    -

    Convert an array of binary polynomials back to a real string. The polynomial coefficients represent a binary format of the ascii string with the following mapping:

    -

    1 => 1

    -

    -1 => 0

    -

    2 => 0

    -

    The 2's are only used for filling up the last polynomial, so they will just end up as '\0's at the end of the string and will not confuse the result.

    -
    Parameters
    - - - - -
    bin_poly_arrthe array of polynomials
    poly_cthe amount of polynomials in bin_poly_arr
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 143 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    string* bin_poly_to_ascii (const fmpz_poly_t poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a single binary polynomial back to a real string. The polynomial coefficients represent a binary format of the ascii string with the following mapping:

    -

    1 => 1

    -

    -1 => 0

    -

    2 => 0

    -

    The 2's are only used for filling up the rest of the polynomial, so they will just end up as '\0's at the end of the string and will not confuse the result.

    -
    Parameters
    - - - -
    polythe binary polynomial to convert
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 114 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - -
    - - - - - - - - -
    static string * get_bin_arr_to_ascii (const char * binary_rep)
    -
    -static
    -
    -

    Converts a binary representation of multiple concatenated integers to the corresponding array of ascii chars, which is NULL-terminated.

    -

    It reads in 8bit chunks, as in:

    -

    10110101|00111100|01011001 => 90|60|89 => "Z<Y"

    -

    Chunks that are 00000000 are stripped from the result.

    -
    Parameters
    - - -
    binary_repthe binary representation of multiple integers concatenated
    -
    -
    -
    Returns
    string of corresponding ascii-chars, newly allocated
    - -

    Definition at line 69 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    string* poly_arr_to_ascii (const fmpz_poly_t ** poly_array,
    const uint32_t poly_c,
    const ntru_paramsparams 
    )
    -
    -

    Convert an array of polynomials back to a real string. The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - - -
    poly_arraythe array of polynomials
    poly_cthe amount of polynomials in poly_arr
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 203 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    string* poly_arr_to_base64 (const fmpz_poly_t ** poly_arr,
    const uint32_t poly_c,
    const ntru_paramsparams 
    )
    -
    -

    Convert an array of polynomials back to a real string which is base64 encoded. The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - - -
    poly_arrthe array of polynomials
    poly_cthe amount of polynomials in poly_arr
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 264 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    string* poly_to_ascii (const fmpz_poly_t poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a single polynom back to a real string which is ascii encoded (full 256 C char spectrum). The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - -
    polythe polynomial to convert
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 180 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    string* poly_to_base64 (const fmpz_poly_t poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a single polynom back to a real string which is base64 encoded. The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - -
    polythe polynomial to convert
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 237 of file ntru_poly_ascii.c.

    - -
    -
    -
    - - - - diff --git a/ntru__poly__ascii_8c__incl.map b/ntru__poly__ascii_8c__incl.map deleted file mode 100644 index 0369b78..0000000 --- a/ntru__poly__ascii_8c__incl.map +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ntru__poly__ascii_8c__incl.md5 b/ntru__poly__ascii_8c__incl.md5 deleted file mode 100644 index b714945..0000000 --- a/ntru__poly__ascii_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -48c92a3995035281292b591ebc928bc1 \ No newline at end of file diff --git a/ntru__poly__ascii_8c__incl.png b/ntru__poly__ascii_8c__incl.png deleted file mode 100644 index 10c75e7..0000000 Binary files a/ntru__poly__ascii_8c__incl.png and /dev/null differ diff --git a/ntru__poly__ascii_8c_source.html b/ntru__poly__ascii_8c_source.html deleted file mode 100644 index 61bdcd2..0000000 --- a/ntru__poly__ascii_8c_source.html +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly_ascii.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_poly_ascii.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_poly_ascii.h"
    -
    30 #include "ntru_common.h"
    -
    31 #include "ntru_mem.h"
    -
    32 #include "ntru_params.h"
    -
    33 #include "ntru_poly.h"
    -
    34 #include "ntru_string.h"
    -
    35 
    -
    36 #include <glib.h>
    -
    37 
    -
    38 #include <stdint.h>
    -
    39 #include <stdlib.h>
    -
    40 #include <string.h>
    -
    41 
    -
    42 #include <fmpz_poly.h>
    -
    43 #include <fmpz.h>
    -
    44 
    -
    45 
    -
    62 static string *
    -
    63 get_bin_arr_to_ascii(const char *binary_rep);
    -
    64 
    -
    65 
    -
    66 /*------------------------------------------------------------------------*/
    -
    67 
    -
    68 static string *
    -
    69 get_bin_arr_to_ascii(const char *binary_rep)
    -
    70 {
    -
    71  size_t int_arr_size = 0;
    -
    72  uint8_t *int_arr = NULL;
    -
    73  uint32_t i = 0;
    -
    74  char *int_string = NULL;
    -
    75  string *result = ntru_malloc(sizeof(*result));
    -
    76 
    -
    77  if (!binary_rep || !*binary_rep)
    -
    78  return NULL;
    -
    79 
    -
    80  int_arr_size = strlen(binary_rep) / ASCII_BITS + 1;
    -
    81  int_arr = ntru_malloc(sizeof(*int_arr) * int_arr_size);
    -
    82 
    -
    83  while (*binary_rep) {
    -
    84  int_arr[i] = 0;
    -
    85 
    -
    86  /* convert one binary integer to real integer */
    -
    87  for (uint32_t j = 0; j < ASCII_BITS && *binary_rep; j++) {
    -
    88  if (*binary_rep == '1')
    -
    89  int_arr[i] = int_arr[i] * 2 + 1;
    -
    90  else if (*binary_rep == '0')
    -
    91  int_arr[i] *= 2;
    -
    92  binary_rep++;
    -
    93  }
    -
    94 
    -
    95  i++; /* amount of real integers */
    -
    96  }
    -
    97 
    -
    98  int_string = ntru_malloc(CHAR_SIZE * (i + 1));
    -
    99 
    -
    100  for (uint32_t j = 0; j < i; j++)
    -
    101  int_string[j] = (char) int_arr[j];
    -
    102 
    -
    103  result->ptr = int_string;
    -
    104  result->len = i;
    -
    105 
    -
    106  free(int_arr);
    -
    107 
    -
    108  return result;
    -
    109 }
    -
    110 
    -
    111 /*------------------------------------------------------------------------*/
    -
    112 
    -
    113 string *
    -
    114 bin_poly_to_ascii(const fmpz_poly_t poly,
    -
    115  const ntru_params *params)
    -
    116 {
    -
    117  string *result_string = ntru_malloc(sizeof(*result_string));
    -
    118  char *binary_rep = ntru_malloc(CHAR_SIZE * (params->N));
    -
    119  uint32_t i = 0;
    -
    120 
    -
    121  for (i = 0; i < params->N; i++) {
    -
    122  fmpz *coeff = fmpz_poly_get_coeff_ptr(poly, i);
    -
    123 
    -
    124  if (coeff) {
    -
    125  if (!fmpz_cmp_si(coeff, 1))
    -
    126  binary_rep[i] = '1';
    -
    127  else if (!fmpz_cmp_si(coeff, -1))
    -
    128  binary_rep[i] = '0';
    -
    129  } else {
    -
    130  break;
    -
    131  }
    -
    132  }
    -
    133 
    -
    134  result_string->ptr = binary_rep;
    -
    135  result_string->len = i;
    -
    136 
    -
    137  return result_string;
    -
    138 }
    -
    139 
    -
    140 /*------------------------------------------------------------------------*/
    -
    141 
    -
    142 string *
    -
    143 bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr,
    -
    144  const uint32_t poly_c,
    -
    145  const ntru_params *params)
    -
    146 {
    -
    147  char *binary_rep = NULL;
    -
    148  size_t string_len = 0;
    -
    149  string *ascii_string = NULL;
    -
    150 
    -
    151  /*
    -
    152  * parse the polynomial coefficients into a string
    -
    153  */
    -
    154  binary_rep = ntru_malloc(CHAR_SIZE * (params->N * poly_c + 1));
    -
    155  for (uint32_t i = 0; i < poly_c; i++) {
    -
    156  string *single_poly_string = NULL;
    -
    157 
    -
    158  single_poly_string = bin_poly_to_ascii(*bin_poly_arr[i], params);
    -
    159 
    -
    160  memcpy(binary_rep + string_len,
    -
    161  single_poly_string->ptr,
    -
    162  single_poly_string->len);
    -
    163 
    -
    164  string_len += single_poly_string->len;
    -
    165 
    -
    166  string_delete(single_poly_string);
    -
    167  }
    -
    168  binary_rep[string_len] = '\0';
    -
    169 
    -
    170  ascii_string = get_bin_arr_to_ascii(binary_rep);
    -
    171 
    -
    172  free(binary_rep);
    -
    173 
    -
    174  return ascii_string;
    -
    175 }
    -
    176 
    -
    177 /*------------------------------------------------------------------------*/
    -
    178 
    -
    179 string *
    -
    180 poly_to_ascii(const fmpz_poly_t poly,
    -
    181  const ntru_params *params)
    -
    182 {
    -
    183  string *result_string = ntru_malloc(sizeof(*result_string));
    -
    184  char *string_rep = ntru_malloc(CHAR_SIZE * (params->N));
    -
    185 
    -
    186  for (uint32_t j = 0; j < params->N; j++) {
    -
    187  uint8_t coeff = fmpz_poly_get_coeff_ui(poly, j);
    -
    188  if (coeff == params->q)
    -
    189  string_rep[j] = '\0';
    -
    190  else
    -
    191  string_rep[j] = (char)coeff;
    -
    192  }
    -
    193 
    -
    194  result_string->ptr = string_rep;
    -
    195  result_string->len = params->N;
    -
    196 
    -
    197  return result_string;
    -
    198 }
    -
    199 
    -
    200 /*------------------------------------------------------------------------*/
    -
    201 
    -
    202 string *
    -
    203 poly_arr_to_ascii(const fmpz_poly_t **poly_array,
    -
    204  const uint32_t poly_c,
    -
    205  const ntru_params *params)
    -
    206 {
    -
    207  char *string_rep = NULL;
    -
    208  size_t string_len = 0;
    -
    209  string *result_string = ntru_malloc(sizeof(*result_string));
    -
    210 
    -
    211  /*
    -
    212  * parse the polynomial coefficients into a string
    -
    213  */
    -
    214  string_rep = ntru_malloc(CHAR_SIZE * (params->N * poly_c + 1));
    -
    215  for (uint32_t i = 0; i < poly_c; i++) {
    -
    216  string *poly_str;
    -
    217 
    -
    218  poly_str = poly_to_ascii(*poly_array[i], params);
    -
    219 
    -
    220  memcpy(string_rep + string_len,
    -
    221  poly_str->ptr,
    -
    222  poly_str->len);
    -
    223  string_len += poly_str->len;
    -
    224 
    -
    225  string_delete(poly_str);
    -
    226  }
    -
    227 
    -
    228  result_string->ptr = string_rep;
    -
    229  result_string->len = string_len;
    -
    230 
    -
    231  return result_string;
    -
    232 }
    -
    233 
    -
    234 /*------------------------------------------------------------------------*/
    -
    235 
    -
    236 string *
    -
    237 poly_to_base64(const fmpz_poly_t poly,
    -
    238  const ntru_params *params)
    -
    239 {
    -
    240  string *result_string = ntru_malloc(sizeof(*result_string));
    -
    241  string *string_rep = NULL;
    -
    242  gchar *base64_string = NULL,
    -
    243  *tmp = NULL;
    -
    244 
    -
    245  string_rep = poly_to_ascii(poly, params);
    -
    246 
    -
    247  tmp = g_base64_encode((const guchar *)string_rep->ptr,
    -
    248  string_rep->len);
    -
    249  base64_string = g_base64_encode((const guchar *)tmp,
    -
    250  strlen(tmp));
    -
    251 
    -
    252  result_string->ptr = base64_string;
    -
    253  result_string->len = strlen(base64_string);
    -
    254 
    -
    255  string_delete(string_rep);
    -
    256  free(tmp);
    -
    257 
    -
    258  return result_string;
    -
    259 }
    -
    260 
    -
    261 /*------------------------------------------------------------------------*/
    -
    262 
    -
    263 string *
    -
    264 poly_arr_to_base64(const fmpz_poly_t **poly_array,
    -
    265  const uint32_t poly_c,
    -
    266  const ntru_params *params)
    -
    267 {
    -
    268  string *string_rep;
    -
    269  string *result_string = ntru_malloc(sizeof(*result_string));
    -
    270 
    -
    271  gchar *base64_string = NULL,
    -
    272  *tmp = NULL;
    -
    273 
    -
    274  string_rep = poly_arr_to_ascii(poly_array, poly_c, params);
    -
    275 
    -
    276  tmp = g_base64_encode((const guchar *)string_rep->ptr, string_rep->len);
    -
    277  base64_string = g_base64_encode((const guchar *)tmp,
    -
    278  strlen(tmp));
    -
    279 
    -
    280  result_string->ptr = base64_string;
    -
    281  result_string->len = strlen(base64_string);
    -
    282 
    -
    283  string_delete(string_rep);
    -
    284  free(tmp);
    -
    285 
    -
    286  return result_string;
    -
    287 }
    -
    288 
    -
    289 /*------------------------------------------------------------------------*/
    -
    #define ASCII_BITS
    Definition: ntru_common.h:38
    -
    void string_delete(string *del_string)
    Definition: ntru_string.c:47
    -
    size_t len
    Definition: ntru_string.h:53
    -
    uint32_t N
    Definition: ntru_params.h:48
    -
    string * poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params)
    -
    string * poly_arr_to_base64(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
    - -
    header for ntru_mem.c
    -
    static string * get_bin_arr_to_ascii(const char *binary_rep)
    -
    header for ntru_poly_ascii.c
    -
    NTRU parameters.
    -
    common macros/functions
    -
    string * poly_to_base64(const fmpz_poly_t poly, const ntru_params *params)
    -
    string * bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params)
    -
    string * bin_poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params)
    -
    void * ntru_malloc(size_t size)
    Definition: ntru_mem.c:38
    -
    uint32_t q
    Definition: ntru_params.h:52
    -
    string * poly_arr_to_ascii(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
    -
    header for ntru_string.c
    -
    #define CHAR_SIZE
    Definition: ntru_common.h:37
    -
    char * ptr
    Definition: ntru_string.h:49
    -
    header for ntru_poly.c
    -
    - - - - diff --git a/ntru__poly__ascii_8h.html b/ntru__poly__ascii_8h.html deleted file mode 100644 index 9bff0ad..0000000 --- a/ntru__poly__ascii_8h.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly_ascii.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_poly_ascii.h File Reference
    -
    -
    - -

    header for ntru_poly_ascii.c -More...

    -
    #include "ntru_common.h"
    -#include "ntru_params.h"
    -#include "ntru_string.h"
    -#include <fmpz_poly.h>
    -#include <fmpz.h>
    -
    -Include dependency graph for ntru_poly_ascii.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - -

    -Functions

    stringbin_poly_to_ascii (const fmpz_poly_t poly, const ntru_params *params)
     
    stringbin_poly_arr_to_ascii (const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params)
     
    stringpoly_to_ascii (const fmpz_poly_t poly, const ntru_params *params)
     
    stringpoly_arr_to_ascii (const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
     
    stringpoly_to_base64 (const fmpz_poly_t poly, const ntru_params *params)
     
    stringpoly_arr_to_base64 (const fmpz_poly_t **poly_arr, const uint32_t poly_c, const ntru_params *params)
     
    -

    Detailed Description

    -

    header for ntru_poly_ascii.c

    -

    Header for the internal API of ntru_poly_ascii.c.

    - -

    Definition in file ntru_poly_ascii.h.

    -

    Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    string* bin_poly_arr_to_ascii (const fmpz_poly_t ** bin_poly_arr,
    const uint32_t poly_c,
    const ntru_paramsparams 
    )
    -
    -

    Convert an array of binary polynomials back to a real string. The polynomial coefficients represent a binary format of the ascii string with the following mapping:

    -

    1 => 1

    -

    -1 => 0

    -

    2 => 0

    -

    The 2's are only used for filling up the last polynomial, so they will just end up as '\0's at the end of the string and will not confuse the result.

    -
    Parameters
    - - - - -
    bin_poly_arrthe array of polynomials
    poly_cthe amount of polynomials in bin_poly_arr
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 143 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    string* bin_poly_to_ascii (const fmpz_poly_t poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a single binary polynomial back to a real string. The polynomial coefficients represent a binary format of the ascii string with the following mapping:

    -

    1 => 1

    -

    -1 => 0

    -

    2 => 0

    -

    The 2's are only used for filling up the rest of the polynomial, so they will just end up as '\0's at the end of the string and will not confuse the result.

    -
    Parameters
    - - - -
    polythe binary polynomial to convert
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 114 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    string* poly_arr_to_ascii (const fmpz_poly_t ** poly_array,
    const uint32_t poly_c,
    const ntru_paramsparams 
    )
    -
    -

    Convert an array of polynomials back to a real string. The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - - -
    poly_arraythe array of polynomials
    poly_cthe amount of polynomials in poly_arr
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 203 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    string* poly_arr_to_base64 (const fmpz_poly_t ** poly_arr,
    const uint32_t poly_c,
    const ntru_paramsparams 
    )
    -
    -

    Convert an array of polynomials back to a real string which is base64 encoded. The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - - -
    poly_arrthe array of polynomials
    poly_cthe amount of polynomials in poly_arr
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 264 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    string* poly_to_ascii (const fmpz_poly_t poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a single polynom back to a real string which is ascii encoded (full 256 C char spectrum). The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - -
    polythe polynomial to convert
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 180 of file ntru_poly_ascii.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    string* poly_to_base64 (const fmpz_poly_t poly,
    const ntru_paramsparams 
    )
    -
    -

    Convert a single polynom back to a real string which is base64 encoded. The polynomial coefficients are expected to be in the range [0, q-1] and will be casted back to chars without any mapping.

    -

    Trailing q coefficients are only used for filling up the rest of a polynomial with '\0', so they will not confuse the result.

    -
    Parameters
    - - - -
    polythe polynomial to convert
    paramsthe NTRU parameters
    -
    -
    -
    Returns
    the real string, newly allocated
    - -

    Definition at line 237 of file ntru_poly_ascii.c.

    - -
    -
    -
    - - - - diff --git a/ntru__poly__ascii_8h__incl.map b/ntru__poly__ascii_8h__incl.map deleted file mode 100644 index ad7ccab..0000000 --- a/ntru__poly__ascii_8h__incl.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/ntru__poly__ascii_8h__incl.md5 b/ntru__poly__ascii_8h__incl.md5 deleted file mode 100644 index 063cf39..0000000 --- a/ntru__poly__ascii_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -e81ad785da148a0aac52ca08f927fae9 \ No newline at end of file diff --git a/ntru__poly__ascii_8h__incl.png b/ntru__poly__ascii_8h__incl.png deleted file mode 100644 index da26707..0000000 Binary files a/ntru__poly__ascii_8h__incl.png and /dev/null differ diff --git a/ntru__poly__ascii_8h_source.html b/ntru__poly__ascii_8h_source.html deleted file mode 100644 index fd0b56d..0000000 --- a/ntru__poly__ascii_8h_source.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly_ascii.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_poly_ascii.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_POLY_ASCII_H_
    -
    29 #define NTRU_POLY_ASCII_H_
    -
    30 
    -
    31 
    -
    32 #include "ntru_common.h"
    -
    33 #include "ntru_params.h"
    -
    34 #include "ntru_string.h"
    -
    35 
    -
    36 #include <fmpz_poly.h>
    -
    37 #include <fmpz.h>
    -
    38 
    -
    39 
    -
    59 string *
    -
    60 bin_poly_to_ascii(const fmpz_poly_t poly,
    -
    61  const ntru_params *params);
    -
    62 
    -
    83 string *
    -
    84 bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr,
    -
    85  const uint32_t poly_c,
    -
    86  const ntru_params *params);
    -
    87 
    -
    101 string *
    -
    102 poly_to_ascii(const fmpz_poly_t poly,
    -
    103  const ntru_params *params);
    -
    104 
    -
    118 string *
    -
    119 poly_arr_to_ascii(const fmpz_poly_t **poly_array,
    -
    120  const uint32_t poly_c,
    -
    121  const ntru_params *params);
    -
    122 
    -
    136 string *
    -
    137 poly_to_base64(const fmpz_poly_t poly,
    -
    138  const ntru_params *params);
    -
    139 
    -
    154 string *
    -
    155 poly_arr_to_base64(const fmpz_poly_t **poly_arr,
    -
    156  const uint32_t poly_c,
    -
    157  const ntru_params *params);
    -
    158 
    -
    159 
    -
    160 #endif /* NTRU_POLY_ASCII_H_ */
    -
    string * poly_to_base64(const fmpz_poly_t poly, const ntru_params *params)
    -
    string * poly_arr_to_ascii(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
    -
    string * bin_poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params)
    - -
    string * bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params)
    -
    NTRU parameters.
    -
    string * poly_arr_to_base64(const fmpz_poly_t **poly_arr, const uint32_t poly_c, const ntru_params *params)
    -
    common macros/functions
    -
    header for ntru_string.c
    -
    string * poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params)
    -
    - - - - diff --git a/ntru__rnd_8c.html b/ntru__rnd_8c.html deleted file mode 100644 index a0a82b8..0000000 --- a/ntru__rnd_8c.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_rnd.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_rnd.c File Reference
    -
    -
    - -

    random polynomials -More...

    -
    #include "math.h"
    -#include "ntru_err.h"
    -#include "ntru_params.h"
    -#include "ntru_poly.h"
    -#include <fmpz_poly.h>
    -#include <fcntl.h>
    -#include <stdlib.h>
    -#include <unistd.h>
    -
    -Include dependency graph for ntru_rnd.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - -

    -Functions

    int get_rnd_int (void)
     
    int get_urnd_int (void)
     
    void ntru_get_rnd_tern_poly_num (fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void))
     
    -

    Detailed Description

    -

    random polynomials

    -

    This file allows generation of random polynomials.

    - -

    Definition in file ntru_rnd.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - -
    int get_rnd_int (void )
    -
    -

    Get a random integer from /dev/random.

    -
    Returns
    random integer
    - -

    Definition at line 42 of file ntru_rnd.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    int get_urnd_int (void )
    -
    -

    Get a pseudo random integer from /dev/urandom.

    -
    Returns
    pseudo-random integer.
    - -

    Definition at line 66 of file ntru_rnd.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ntru_get_rnd_tern_poly_num (fmpz_poly_t poly,
    const ntru_paramsparams,
    uint32_t num_ones,
    uint32_t num_neg_ones,
    int(*)(void) rnd_int 
    )
    -
    -

    Get a random ternary polynomial with specified numbers of 1 coefficients and -1 coefficients.

    -
    Parameters
    - - - - - - -
    polythe resulting random polynomial [out]
    paramsthe NTRU context
    num_onesthe number of 1 coefficients
    num_neg_onesthe number of -1 coefficients
    rnd_intfunction callback which should return a random integer
    -
    -
    - -

    Definition at line 86 of file ntru_rnd.c.

    - -
    -
    -
    - - - - diff --git a/ntru__rnd_8c__incl.map b/ntru__rnd_8c__incl.map deleted file mode 100644 index 0ce1626..0000000 --- a/ntru__rnd_8c__incl.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/ntru__rnd_8c__incl.md5 b/ntru__rnd_8c__incl.md5 deleted file mode 100644 index 1dea86c..0000000 --- a/ntru__rnd_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -3ad977b7ca7c1e7da55a601aad629baa \ No newline at end of file diff --git a/ntru__rnd_8c__incl.png b/ntru__rnd_8c__incl.png deleted file mode 100644 index e8dd745..0000000 Binary files a/ntru__rnd_8c__incl.png and /dev/null differ diff --git a/ntru__rnd_8c_source.html b/ntru__rnd_8c_source.html deleted file mode 100644 index cee545c..0000000 --- a/ntru__rnd_8c_source.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_rnd.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_rnd.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #include "math.h"
    -
    29 #include "ntru_err.h"
    -
    30 #include "ntru_params.h"
    -
    31 #include "ntru_poly.h"
    -
    32 
    -
    33 #include <fmpz_poly.h>
    -
    34 #include <fcntl.h>
    -
    35 #include <stdlib.h>
    -
    36 #include <unistd.h>
    -
    37 
    -
    38 
    -
    39 /*------------------------------------------------------------------------*/
    -
    40 
    -
    41 int
    - -
    43 {
    -
    44  int rnd_data = open("/dev/random", O_RDONLY);
    -
    45  int rnd_int;
    -
    46  size_t rnd_len = 0;
    -
    47 
    -
    48  while (rnd_len < sizeof(rnd_int)) {
    -
    49  ssize_t result = read(rnd_data, ((char*)&rnd_int) + rnd_len,
    -
    50  sizeof(rnd_int) - rnd_len);
    -
    51 
    -
    52  if (result < 0)
    -
    53  NTRU_ABORT("Unable to read /dev/random!\n");
    -
    54 
    -
    55  rnd_len += result;
    -
    56  }
    -
    57 
    -
    58  close(rnd_data);
    -
    59 
    -
    60  return rnd_int;
    -
    61 }
    -
    62 
    -
    63 /*------------------------------------------------------------------------*/
    -
    64 
    -
    65 int
    - -
    67 {
    -
    68  int rnd_data = open("/dev/urandom", O_RDONLY);
    -
    69  int rnd_int;
    -
    70  ssize_t result;
    -
    71 
    -
    72  result = read(rnd_data, ((char*)&rnd_int),
    -
    73  sizeof(rnd_int));
    -
    74 
    -
    75  if (result < 0)
    -
    76  NTRU_ABORT("Unable to read /dev/urandom!\n");
    -
    77 
    -
    78  close(rnd_data);
    -
    79 
    -
    80  return rnd_int;
    -
    81 }
    -
    82 
    -
    83 /*------------------------------------------------------------------------*/
    -
    84 
    -
    85 void
    -
    86 ntru_get_rnd_tern_poly_num(fmpz_poly_t poly,
    -
    87  const ntru_params *params,
    -
    88  uint32_t num_ones,
    -
    89  uint32_t num_neg_ones,
    -
    90  int (*rnd_int)(void))
    -
    91 {
    -
    92  if (!poly || ! params)
    -
    93  NTRU_ABORT_DEBUG("unexpected NULL parameters");
    -
    94 
    -
    95  fmpz_poly_zero(poly);
    -
    96 
    -
    97  while (num_ones != 0 || num_neg_ones != 0) {
    -
    98  int32_t pos = rnd_int() % params->N;
    -
    99 
    -
    100  if (!fmpz_cmp_si_n(fmpz_poly_get_coeff_ptr(poly, pos), 0)) {
    -
    101  if (num_ones > 0) {
    -
    102  fmpz_poly_set_coeff_si(poly, pos, 1);
    -
    103  num_ones--;
    -
    104  } else if (num_neg_ones > 0) {
    -
    105  fmpz_poly_set_coeff_si(poly, pos, -1);
    -
    106  num_neg_ones--;
    -
    107  }
    -
    108  }
    -
    109  }
    -
    110 }
    -
    111 
    -
    112 /*------------------------------------------------------------------------*/
    -
    uint32_t N
    Definition: ntru_params.h:48
    -
    int get_urnd_int(void)
    Definition: ntru_rnd.c:66
    -
    #define NTRU_ABORT_DEBUG(...)
    Definition: ntru_err.h:39
    -
    int get_rnd_int(void)
    Definition: ntru_rnd.c:42
    - -
    NTRU parameters.
    -
    void ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void))
    Definition: ntru_rnd.c:86
    -
    error handling
    -
    int fmpz_cmp_si_n(const fmpz_t f, slong g)
    Definition: ntru_poly.c:93
    -
    header for ntru_poly.c
    -
    #define NTRU_ABORT(...)
    Definition: ntru_err.h:33
    -
    - - - - diff --git a/ntru__rnd_8h.html b/ntru__rnd_8h.html deleted file mode 100644 index ed7c92e..0000000 --- a/ntru__rnd_8h.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_rnd.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_rnd.h File Reference
    -
    -
    - -

    header for ntru_rnd.c -More...

    -
    #include "ntru_params.h"
    -#include <stdlib.h>
    -#include <fmpz_poly.h>
    -
    -Include dependency graph for ntru_rnd.h:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - - - -

    -Functions

    int get_rnd_int (void)
     
    int get_urnd_int (void)
     
    void ntru_get_rnd_tern_poly_num (fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void))
     
    -

    Detailed Description

    -

    header for ntru_rnd.c

    -

    Header for the internal API of ntru_rnd.c.

    - -

    Definition in file ntru_rnd.h.

    -

    Function Documentation

    - -
    -
    - - - - - - - - -
    int get_rnd_int (void )
    -
    -

    Get a random integer from /dev/random.

    -
    Returns
    random integer
    - -

    Definition at line 42 of file ntru_rnd.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    int get_urnd_int (void )
    -
    -

    Get a pseudo random integer from /dev/urandom.

    -
    Returns
    pseudo-random integer.
    - -

    Definition at line 66 of file ntru_rnd.c.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void ntru_get_rnd_tern_poly_num (fmpz_poly_t poly,
    const ntru_paramsparams,
    uint32_t num_ones,
    uint32_t num_neg_ones,
    int(*)(void) rnd_int 
    )
    -
    -

    Get a random ternary polynomial with specified numbers of 1 coefficients and -1 coefficients.

    -
    Parameters
    - - - - - - -
    polythe resulting random polynomial [out]
    paramsthe NTRU context
    num_onesthe number of 1 coefficients
    num_neg_onesthe number of -1 coefficients
    rnd_intfunction callback which should return a random integer
    -
    -
    - -

    Definition at line 86 of file ntru_rnd.c.

    - -
    -
    -
    - - - - diff --git a/ntru__rnd_8h__incl.map b/ntru__rnd_8h__incl.map deleted file mode 100644 index f140a7e..0000000 --- a/ntru__rnd_8h__incl.map +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ntru__rnd_8h__incl.md5 b/ntru__rnd_8h__incl.md5 deleted file mode 100644 index a8bb33f..0000000 --- a/ntru__rnd_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -42152b091f3c78295f2ca4f7f556c63a \ No newline at end of file diff --git a/ntru__rnd_8h__incl.png b/ntru__rnd_8h__incl.png deleted file mode 100644 index c28addd..0000000 Binary files a/ntru__rnd_8h__incl.png and /dev/null differ diff --git a/ntru__rnd_8h_source.html b/ntru__rnd_8h_source.html deleted file mode 100644 index 83851b7..0000000 --- a/ntru__rnd_8h_source.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_rnd.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_rnd.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_RND_H
    -
    29 #define NTRU_RND_H
    -
    30 
    -
    31 #include "ntru_params.h"
    -
    32 
    -
    33 #include <stdlib.h>
    -
    34 
    -
    35 #include <fmpz_poly.h>
    -
    36 
    -
    37 
    -
    43 int
    -
    44 get_rnd_int(void);
    -
    45 
    -
    51 int
    -
    52 get_urnd_int(void);
    -
    53 
    -
    65 void
    -
    66 ntru_get_rnd_tern_poly_num(fmpz_poly_t poly,
    -
    67  const ntru_params *params,
    -
    68  uint32_t num_ones,
    -
    69  uint32_t num_neg_ones,
    -
    70  int (*rnd_int)(void));
    -
    71 
    -
    72 
    -
    73 #endif /* NTRU_RND_H */
    -
    int get_urnd_int(void)
    Definition: ntru_rnd.c:66
    - -
    NTRU parameters.
    -
    void ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void))
    Definition: ntru_rnd.c:86
    -
    int get_rnd_int(void)
    Definition: ntru_rnd.c:42
    -
    - - - - diff --git a/ntru__string_8c.html b/ntru__string_8c.html deleted file mode 100644 index fa3abd9..0000000 --- a/ntru__string_8c.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_string.c File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_string.c File Reference
    -
    -
    - -

    string type and operations -More...

    -
    #include "ntru_string.h"
    -#include <stdio.h>
    -
    -Include dependency graph for ntru_string.c:
    -
    -
    - - -
    -
    -

    Go to the source code of this file.

    - - - - - - -

    -Functions

    void prints (const string *print_string)
     
    void string_delete (string *del_string)
     
    -

    Detailed Description

    -

    string type and operations

    -

    Sets up a string type that does not suck like C strings and provides operations on it.

    - -

    Definition in file ntru_string.c.

    -

    Function Documentation

    - -
    -
    - - - - - - - - -
    void prints (const stringprint_string)
    -
    -

    Prints the given string to stdout.

    -
    Parameters
    - - -
    print_stringthe print to string
    -
    -
    - -

    Definition at line 37 of file ntru_string.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void string_delete (stringdel_string)
    -
    -

    Delete the inner structure of the string and frees the string itself from the heap. Must not be called on stack variables.

    -
    Parameters
    - - -
    del_stringthe string to delete
    -
    -
    - -

    Definition at line 47 of file ntru_string.c.

    - -
    -
    -
    - - - - diff --git a/ntru__string_8c__incl.map b/ntru__string_8c__incl.map deleted file mode 100644 index 02ef7fa..0000000 --- a/ntru__string_8c__incl.map +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ntru__string_8c__incl.md5 b/ntru__string_8c__incl.md5 deleted file mode 100644 index 0f1cf58..0000000 --- a/ntru__string_8c__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -d1d454c868f196cbf04d1c0fffb79e19 \ No newline at end of file diff --git a/ntru__string_8c__incl.png b/ntru__string_8c__incl.png deleted file mode 100644 index f179094..0000000 Binary files a/ntru__string_8c__incl.png and /dev/null differ diff --git a/ntru__string_8c_source.html b/ntru__string_8c_source.html deleted file mode 100644 index db6fefa..0000000 --- a/ntru__string_8c_source.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_string.c Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_string.c
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    29 #include "ntru_string.h"
    -
    30 
    -
    31 #include <stdio.h>
    -
    32 
    -
    33 
    -
    34 /*------------------------------------------------------------------------*/
    -
    35 
    -
    36 void
    -
    37 prints(const string *print_string)
    -
    38 {
    -
    39  for (size_t i = 0; i < print_string->len; i++)
    -
    40  printf("%c", print_string->ptr[i]);
    -
    41 }
    -
    42 
    -
    43 
    -
    44 /*------------------------------------------------------------------------*/
    -
    45 
    -
    46 void
    -
    47 string_delete(string *del_string)
    -
    48 {
    -
    49  free(del_string->ptr);
    -
    50  free(del_string);
    -
    51 }
    -
    52 
    -
    53 /*------------------------------------------------------------------------*/
    -
    void string_delete(string *del_string)
    Definition: ntru_string.c:47
    -
    size_t len
    Definition: ntru_string.h:53
    -
    void prints(const string *print_string)
    Definition: ntru_string.c:37
    -
    header for ntru_string.c
    -
    char * ptr
    Definition: ntru_string.h:49
    -
    - - - - diff --git a/ntru__string_8h.html b/ntru__string_8h.html deleted file mode 100644 index 077eae5..0000000 --- a/ntru__string_8h.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_string.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    ntru_string.h File Reference
    -
    -
    - -

    header for ntru_string.c -More...

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

    Go to the source code of this file.

    - - - - -

    -Data Structures

    struct  string
     
    - - - -

    -Typedefs

    typedef struct string string
     
    - - - - - -

    -Functions

    void prints (const string *print_string)
     
    void string_delete (string *del_string)
     
    -

    Detailed Description

    -

    header for ntru_string.c

    -

    Header for the external API of ntru_string.c.

    - -

    Definition in file ntru_string.h.

    -

    Typedef Documentation

    - -
    -
    - - - - -
    typedef struct string string
    -
    - -

    Definition at line 35 of file ntru_string.h.

    - -
    -
    -

    Function Documentation

    - -
    -
    - - - - - - - - -
    void prints (const stringprint_string)
    -
    -

    Prints the given string to stdout.

    -
    Parameters
    - - -
    print_stringthe print to string
    -
    -
    - -

    Definition at line 37 of file ntru_string.c.

    - -
    -
    - -
    -
    - - - - - - - - -
    void string_delete (stringdel_string)
    -
    -

    Delete the inner structure of the string and frees the string itself from the heap. Must not be called on stack variables.

    -
    Parameters
    - - -
    del_stringthe string to delete
    -
    -
    - -

    Definition at line 47 of file ntru_string.c.

    - -
    -
    -
    - - - - diff --git a/ntru__string_8h__incl.map b/ntru__string_8h__incl.map deleted file mode 100644 index c2f567a..0000000 --- a/ntru__string_8h__incl.map +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/ntru__string_8h__incl.md5 b/ntru__string_8h__incl.md5 deleted file mode 100644 index a735341..0000000 --- a/ntru__string_8h__incl.md5 +++ /dev/null @@ -1 +0,0 @@ -ea5922f2b2050a1d27ead16c0d1a817b \ No newline at end of file diff --git a/ntru__string_8h__incl.png b/ntru__string_8h__incl.png deleted file mode 100644 index 651e47b..0000000 Binary files a/ntru__string_8h__incl.png and /dev/null differ diff --git a/ntru__string_8h_source.html b/ntru__string_8h_source.html deleted file mode 100644 index 6d287ad..0000000 --- a/ntru__string_8h_source.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - -post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_string.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    post quantum cryptography -
    -
    Highly optimized implementation of the NTRUEncrypt algorithm
    -
    -
    - - - - - - - - - -
    - -
    - - -
    -
    -
    -
    ntru_string.h
    -
    -
    -Go to the documentation of this file.
    1 /*
    -
    2  * Copyright (C) 2014 FH Bielefeld
    -
    3  *
    -
    4  * This file is part of a FH Bielefeld project.
    -
    5  *
    -
    6  * This library is free software; you can redistribute it and/or
    -
    7  * modify it under the terms of the GNU Lesser General Public
    -
    8  * License as published by the Free Software Foundation; either
    -
    9  * version 2.1 of the License, or (at your option) any later version.
    -
    10  *
    -
    11  * This library is distributed in the hope that it will be useful,
    -
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    -
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -
    14  * Lesser General Public License for more details.
    -
    15  *
    -
    16  * You should have received a copy of the GNU Lesser General Public
    -
    17  * License along with this library; if not, write to the Free Software
    -
    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    -
    19  * MA 02110-1301 USA
    -
    20  */
    -
    21 
    -
    28 #ifndef NTRU_STRING_H
    -
    29 #define NTRU_STRING_H
    -
    30 
    -
    31 
    -
    32 #include <stdlib.h>
    -
    33 
    -
    34 
    -
    35 typedef struct string string;
    -
    36 
    -
    37 
    -
    41 struct string {
    -
    49  char *ptr;
    -
    53  size_t len;
    -
    54 };
    -
    55 
    -
    56 
    -
    62 void
    -
    63 prints(const string *print_string);
    -
    64 
    -
    73 void
    -
    74 string_delete(string *del_string);
    -
    75 
    -
    76 
    -
    77 #endif /* NTRU_STRING_H */
    -
    size_t len
    Definition: ntru_string.h:53
    -
    void string_delete(string *del_string)
    Definition: ntru_string.c:47
    -
    void prints(const string *print_string)
    Definition: ntru_string.c:37
    - -
    char * ptr
    Definition: ntru_string.h:49
    -
    - - - - diff --git a/rnd_8h.html b/rnd_8h.html index f3b0946..1416347 100644 --- a/rnd_8h.html +++ b/rnd_8h.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/rnd.h File Reference +post quantum cryptography: rnd.h File Reference @@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,10 +78,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -
    @@ -100,9 +96,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Include dependency graph for rnd.h:
    -
    - - +
    + +

    Go to the source code of this file.

    @@ -138,8 +134,6 @@ Functions

    Get a random integer from /dev/random.

    Returns
    random integer
    -

    Definition at line 42 of file ntru_rnd.c.

    -
    @@ -158,8 +152,6 @@ Functions

    Get a pseudo random integer from /dev/urandom.

    Returns
    pseudo-random integer.
    -

    Definition at line 66 of file ntru_rnd.c.

    - @@ -215,14 +207,12 @@ Functions -

    Definition at line 86 of file ntru_rnd.c.

    - diff --git a/rnd_8h__incl.map b/rnd_8h__incl.map index 779c7ae..59fa5d5 100644 --- a/rnd_8h__incl.map +++ b/rnd_8h__incl.map @@ -1,3 +1,3 @@ - - + + diff --git a/rnd_8h__incl.md5 b/rnd_8h__incl.md5 index 10ce7ba..1d1431f 100644 --- a/rnd_8h__incl.md5 +++ b/rnd_8h__incl.md5 @@ -1 +1 @@ -a2cb2322f4b55bf813f88333ff6b7900 \ No newline at end of file +bad1842102c236bd1032bb3a5cf400d0 \ No newline at end of file diff --git a/rnd_8h__incl.png b/rnd_8h__incl.png index c65b787..696f74a 100644 Binary files a/rnd_8h__incl.png and b/rnd_8h__incl.png differ diff --git a/rnd_8h_source.html b/rnd_8h_source.html index bd10ec9..608f253 100644 --- a/rnd_8h_source.html +++ b/rnd_8h_source.html @@ -4,7 +4,7 @@ -post quantum cryptography: /home/travis/build/hasufell/pqc/include/rnd.h Source File +post quantum cryptography: rnd.h Source File @@ -64,12 +64,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Globals
  • + + All Data Structures Files Functions Variables Typedefs Pages
    @@ -78,11 +79,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - -
    rnd.h
    @@ -136,14 +132,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    76 
    77 #endif /* PUBLIC_NTRU_RND_H_ */
    public API, basic data types
    - -
    int get_urnd_int(void)
    Definition: ntru_rnd.c:66
    -
    int get_rnd_int(void)
    Definition: ntru_rnd.c:42
    -
    void ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void))
    Definition: ntru_rnd.c:86
    + +
    int get_urnd_int(void)
    +
    int get_rnd_int(void)
    +
    void ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void))
    diff --git a/search/all_0.js b/search/all_0.js index 342804e..609a56f 100644 --- a/search/all_0.js +++ b/search/all_0.js @@ -1,6 +1,5 @@ var searchData= [ - ['ascii_5fbin_5fto_5fbin_5fpoly',['ascii_bin_to_bin_poly',['../ntru__ascii__poly_8c.html#aa5d0d4abdb2ce837a0a3b6e478c8f1a9',1,'ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params): ntru_ascii_poly.c'],['../ntru__ascii__poly_8h.html#aa5d0d4abdb2ce837a0a3b6e478c8f1a9',1,'ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params): ntru_ascii_poly.c']]], - ['ascii_5fbits',['ASCII_BITS',['../ntru__common_8h.html#a8d370c21bcf662e586397e764aba95e1',1,'ntru_common.h']]], - ['ascii_5fto_5fbin_5fpoly_5farr',['ascii_to_bin_poly_arr',['../ntru__ascii__poly_8c.html#a3237071bca2489c3b2efd46e674e0805',1,'ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c'],['../ntru__ascii__poly_8h.html#a3237071bca2489c3b2efd46e674e0805',1,'ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c']]] + ['decrypt_2eh',['decrypt.h',['../decrypt_8h.html',1,'']]], + ['doxygen_2edox',['doxygen.dox',['../doxygen_8dox.html',1,'']]] ]; diff --git a/search/all_1.js b/search/all_1.js index fcb635e..a6ea981 100644 --- a/search/all_1.js +++ b/search/all_1.js @@ -1,6 +1,6 @@ var searchData= [ - ['base64_5fto_5fpoly_5farr',['base64_to_poly_arr',['../ntru__ascii__poly_8c.html#a8460cd27ad4562f560bb304609a3e06d',1,'base64_to_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c'],['../ntru__ascii__poly_8h.html#a8460cd27ad4562f560bb304609a3e06d',1,'base64_to_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c']]], - ['bin_5fpoly_5farr_5fto_5fascii',['bin_poly_arr_to_ascii',['../ntru__poly__ascii_8c.html#ab9464c96c3ebec6ee716c604fdc4ad21',1,'bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#ab9464c96c3ebec6ee716c604fdc4ad21',1,'bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c']]], - ['bin_5fpoly_5fto_5fascii',['bin_poly_to_ascii',['../ntru__poly__ascii_8c.html#a0d86ab2dede39b332d4149e16b2046b8',1,'bin_poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#a0d86ab2dede39b332d4149e16b2046b8',1,'bin_poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c']]] + ['encrypt_2eh',['encrypt.h',['../encrypt_8h.html',1,'']]], + ['export_5fpriv_5fkey',['export_priv_key',['../keypair_8h.html#afa29f14a14486d3f6b979ee900d7e738',1,'keypair.h']]], + ['export_5fpublic_5fkey',['export_public_key',['../keypair_8h.html#a41741ed660cb806c47335f66055e1bdd',1,'keypair.h']]] ]; diff --git a/search/all_2.js b/search/all_2.js index dbb85e2..0147ba9 100644 --- a/search/all_2.js +++ b/search/all_2.js @@ -1,4 +1,5 @@ var searchData= [ - ['char_5fsize',['CHAR_SIZE',['../ntru__common_8h.html#a22c7f61c2f0fa6b1943548e838055cec',1,'ntru_common.h']]] + ['get_5frnd_5fint',['get_rnd_int',['../rnd_8h.html#ad85ebfb1cb4b4942942213b750812cf0',1,'rnd.h']]], + ['get_5furnd_5fint',['get_urnd_int',['../rnd_8h.html#a99e4820cab7157eb1e16109e21dac81f',1,'rnd.h']]] ]; diff --git a/search/all_3.js b/search/all_3.js index 609a56f..bbc960d 100644 --- a/search/all_3.js +++ b/search/all_3.js @@ -1,5 +1,6 @@ var searchData= [ - ['decrypt_2eh',['decrypt.h',['../decrypt_8h.html',1,'']]], - ['doxygen_2edox',['doxygen.dox',['../doxygen_8dox.html',1,'']]] + ['import_5fpriv_5fkey',['import_priv_key',['../keypair_8h.html#a1f917ea6ef5302826c888e5c88e0869e',1,'keypair.h']]], + ['import_5fpublic_5fkey',['import_public_key',['../keypair_8h.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'keypair.h']]], + ['index_20page',['Index Page',['../index.html',1,'']]] ]; diff --git a/search/all_4.js b/search/all_4.js index d222bc6..74eaee4 100644 --- a/search/all_4.js +++ b/search/all_4.js @@ -1,6 +1,5 @@ var searchData= [ - ['encrypt_2eh',['encrypt.h',['../encrypt_8h.html',1,'']]], - ['export_5fpriv_5fkey',['export_priv_key',['../ntru__keypair_8c.html#afa29f14a14486d3f6b979ee900d7e738',1,'export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#afa29f14a14486d3f6b979ee900d7e738',1,'export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#afa29f14a14486d3f6b979ee900d7e738',1,'export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params): ntru_keypair.c']]], - ['export_5fpublic_5fkey',['export_public_key',['../ntru__keypair_8c.html#a41741ed660cb806c47335f66055e1bdd',1,'export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a41741ed660cb806c47335f66055e1bdd',1,'export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a41741ed660cb806c47335f66055e1bdd',1,'export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c']]] + ['keypair',['keypair',['../structkeypair.html',1,'keypair'],['../keypair_8h.html#aacfc9254c7939584924ab9d27ba6f504',1,'keypair(): keypair.h']]], + ['keypair_2eh',['keypair.h',['../keypair_8h.html',1,'']]] ]; diff --git a/search/all_5.js b/search/all_5.js index dfec881..097a1e6 100644 --- a/search/all_5.js +++ b/search/all_5.js @@ -1,9 +1,4 @@ var searchData= [ - ['fmpz_5fadd_5fn',['fmpz_add_n',['../ntru__poly_8c.html#ad2a11e832808ef1cfee0eed1cc02f4b9',1,'fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h): ntru_poly.c'],['../ntru__poly_8h.html#ad2a11e832808ef1cfee0eed1cc02f4b9',1,'fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h): ntru_poly.c']]], - ['fmpz_5fcmp_5fsi_5fn',['fmpz_cmp_si_n',['../ntru__poly_8c.html#aaaac83ec72414aa208832442657c3520',1,'fmpz_cmp_si_n(const fmpz_t f, slong g): ntru_poly.c'],['../ntru__poly_8h.html#aaaac83ec72414aa208832442657c3520',1,'fmpz_cmp_si_n(const fmpz_t f, slong g): ntru_poly.c']]], - ['fmpz_5finvmod_5fui',['fmpz_invmod_ui',['../ntru__poly_8c.html#a59da1b7962829af8f18d58c05f588606',1,'fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod): ntru_poly.c'],['../ntru__poly_8h.html#a59da1b7962829af8f18d58c05f588606',1,'fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod): ntru_poly.c']]], - ['fmpz_5fpoly_5fmod',['fmpz_poly_mod',['../ntru__poly_8c.html#a7c4f5e96355518dc97a23da8f34b661a',1,'fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod): ntru_poly.c'],['../ntru__poly_8h.html#a7c4f5e96355518dc97a23da8f34b661a',1,'fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod): ntru_poly.c']]], - ['fmpz_5fpoly_5fmod_5funsigned',['fmpz_poly_mod_unsigned',['../ntru__poly_8c.html#ae7d0d8364dba689df3fb4904610634cc',1,'fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod): ntru_poly.c'],['../ntru__poly_8h.html#ae7d0d8364dba689df3fb4904610634cc',1,'fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod): ntru_poly.c']]], - ['fmpz_5fpoly_5fset_5fcoeff_5ffmpz_5fn',['fmpz_poly_set_coeff_fmpz_n',['../ntru__poly_8c.html#ab1f966fe680d1ce7c19c8c812d1932a7',1,'fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n, const fmpz_t x): ntru_poly.c'],['../ntru__poly_8h.html#ab1f966fe680d1ce7c19c8c812d1932a7',1,'fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n, const fmpz_t x): ntru_poly.c']]] + ['len',['len',['../structstring.html#aa6bcf0353fd5cf2f374a9b1dd0e4a73a',1,'string']]] ]; diff --git a/search/all_6.js b/search/all_6.js index ae0b615..67354c3 100644 --- a/search/all_6.js +++ b/search/all_6.js @@ -1,7 +1,11 @@ var searchData= [ - ['get_5fbin_5farr_5fto_5fascii',['get_bin_arr_to_ascii',['../ntru__poly__ascii_8c.html#afd3f036287b4f62846c1a236426d73e1',1,'ntru_poly_ascii.c']]], - ['get_5fint_5fto_5fbin_5fstr',['get_int_to_bin_str',['../ntru__ascii__poly_8c.html#a2d2f760b6a98bd87248c1d3e120a665b',1,'ntru_ascii_poly.c']]], - ['get_5frnd_5fint',['get_rnd_int',['../ntru__rnd_8c.html#ad85ebfb1cb4b4942942213b750812cf0',1,'get_rnd_int(void): ntru_rnd.c'],['../ntru__rnd_8h.html#ad85ebfb1cb4b4942942213b750812cf0',1,'get_rnd_int(void): ntru_rnd.c'],['../rnd_8h.html#ad85ebfb1cb4b4942942213b750812cf0',1,'get_rnd_int(void): ntru_rnd.c']]], - ['get_5furnd_5fint',['get_urnd_int',['../ntru__rnd_8c.html#a99e4820cab7157eb1e16109e21dac81f',1,'get_urnd_int(void): ntru_rnd.c'],['../ntru__rnd_8h.html#a99e4820cab7157eb1e16109e21dac81f',1,'get_urnd_int(void): ntru_rnd.c'],['../rnd_8h.html#a99e4820cab7157eb1e16109e21dac81f',1,'get_urnd_int(void): ntru_rnd.c']]] + ['n',['N',['../structntru__params.html#afb8425ee3db2b917b3c4e8d9b75bd3ff',1,'ntru_params']]], + ['ntru_2eh',['ntru.h',['../ntru_8h.html',1,'']]], + ['ntru_5fcreate_5fkeypair',['ntru_create_keypair',['../keypair_8h.html#a6873d41211a92c4f6b0074ef34ae1743',1,'keypair.h']]], + ['ntru_5fdecrypt_5fstring',['ntru_decrypt_string',['../decrypt_8h.html#aa9cc61eec0c119e48762f6078a14527b',1,'decrypt.h']]], + ['ntru_5fdelete_5fkeypair',['ntru_delete_keypair',['../keypair_8h.html#a5279c4990bc22bb9e735fe36372a6786',1,'keypair.h']]], + ['ntru_5fencrypt_5fstring',['ntru_encrypt_string',['../encrypt_8h.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'encrypt.h']]], + ['ntru_5fget_5frnd_5ftern_5fpoly_5fnum',['ntru_get_rnd_tern_poly_num',['../rnd_8h.html#a916a55c609c172ae4e48896032b36e47',1,'rnd.h']]], + ['ntru_5fparams',['ntru_params',['../structntru__params.html',1,'ntru_params'],['../ntru_8h.html#a2f326c88fc033eca78a47ee8d387c592',1,'ntru_params(): ntru.h']]] ]; diff --git a/search/all_7.js b/search/all_7.js index 2c0ea97..7e72976 100644 --- a/search/all_7.js +++ b/search/all_7.js @@ -1,6 +1,15 @@ var searchData= [ - ['import_5fpriv_5fkey',['import_priv_key',['../ntru__keypair_8c.html#a1f917ea6ef5302826c888e5c88e0869e',1,'import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a1f917ea6ef5302826c888e5c88e0869e',1,'import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a1f917ea6ef5302826c888e5c88e0869e',1,'import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params): ntru_keypair.c']]], - ['import_5fpublic_5fkey',['import_public_key',['../ntru__keypair_8c.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c']]], - ['index_20page',['Index Page',['../index.html',1,'']]] + ['p',['p',['../structntru__params.html#a41b368825e1eb126604e13e8f549ec8f',1,'ntru_params']]], + ['poly_5fdelete',['poly_delete',['../ntru_8h.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'ntru.h']]], + ['poly_5fdelete_5fall',['poly_delete_all',['../ntru_8h.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'ntru.h']]], + ['poly_5fdelete_5farray',['poly_delete_array',['../ntru_8h.html#a3f53c63383ff301b20dcede0783869a7',1,'ntru.h']]], + ['poly_5fdraw',['poly_draw',['../ntru_8h.html#a80a8ce0f2944bc3df94291ef2f781498',1,'ntru.h']]], + ['poly_5fdraw_5fpretty',['poly_draw_pretty',['../ntru_8h.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'ntru.h']]], + ['poly_5fnew',['poly_new',['../ntru_8h.html#a20f86085d5eb5372fd25dc270069d38c',1,'ntru.h']]], + ['prints',['prints',['../ntru_8h.html#a55d4ce182c335ff6cca360909a7be395',1,'ntru.h']]], + ['priv',['priv',['../structkeypair.html#a9e9805ad001216da53f2c57accb288e1',1,'keypair']]], + ['priv_5finv',['priv_inv',['../structkeypair.html#a9e63f1d275b91c9d9716fb4069461799',1,'keypair']]], + ['ptr',['ptr',['../structstring.html#aa1b2f3a2ddd1ed38245b8d4590aadf93',1,'string']]], + ['pub',['pub',['../structkeypair.html#afa635c70f233d0b7449b4a17513646c4',1,'keypair']]] ]; diff --git a/search/all_8.js b/search/all_8.js index d6f0d75..0dbc610 100644 --- a/search/all_8.js +++ b/search/all_8.js @@ -1,5 +1,4 @@ var searchData= [ - ['keypair',['keypair',['../structkeypair.html',1,'keypair'],['../ntru__keypair_8h.html#aacfc9254c7939584924ab9d27ba6f504',1,'keypair(): ntru_keypair.h'],['../keypair_8h.html#aacfc9254c7939584924ab9d27ba6f504',1,'keypair(): keypair.h']]], - ['keypair_2eh',['keypair.h',['../keypair_8h.html',1,'']]] + ['q',['q',['../structntru__params.html#a29680750bda49dc93e61a752b2f2a0f7',1,'ntru_params']]] ]; diff --git a/search/all_9.js b/search/all_9.js index 097a1e6..6c0a4ef 100644 --- a/search/all_9.js +++ b/search/all_9.js @@ -1,4 +1,5 @@ var searchData= [ - ['len',['len',['../structstring.html#aa6bcf0353fd5cf2f374a9b1dd0e4a73a',1,'string']]] + ['read_5ffile',['read_file',['../ntru_8h.html#a348c2a56837571f410d44631abc09dc4',1,'ntru.h']]], + ['rnd_2eh',['rnd.h',['../rnd_8h.html',1,'']]] ]; diff --git a/search/all_a.js b/search/all_a.js index d860054..7764879 100644 --- a/search/all_a.js +++ b/search/all_a.js @@ -1,42 +1,5 @@ var searchData= [ - ['n',['N',['../structntru__params.html#afb8425ee3db2b917b3c4e8d9b75bd3ff',1,'ntru_params']]], - ['ntru_2eh',['ntru.h',['../ntru_8h.html',1,'']]], - ['ntru_5fabort',['NTRU_ABORT',['../ntru__err_8h.html#ab0f71521e9bc99beab8ece52bb00341a',1,'ntru_err.h']]], - ['ntru_5fabort_5fdebug',['NTRU_ABORT_DEBUG',['../ntru__err_8h.html#a5d4dd1c1539c408c0dcd915750e8f224',1,'ntru_err.h']]], - ['ntru_5fascii_5fpoly_2ec',['ntru_ascii_poly.c',['../ntru__ascii__poly_8c.html',1,'']]], - ['ntru_5fascii_5fpoly_2eh',['ntru_ascii_poly.h',['../ntru__ascii__poly_8h.html',1,'']]], - ['ntru_5fcalloc',['ntru_calloc',['../ntru__mem_8c.html#a37e0be4fd8d0b677a41c8287ef47885c',1,'ntru_calloc(size_t nmemb, size_t size): ntru_mem.c'],['../ntru__mem_8h.html#a37e0be4fd8d0b677a41c8287ef47885c',1,'ntru_calloc(size_t nmemb, size_t size): ntru_mem.c']]], - ['ntru_5fcommon_2eh',['ntru_common.h',['../ntru__common_8h.html',1,'']]], - ['ntru_5fcreate_5fkeypair',['ntru_create_keypair',['../ntru__keypair_8c.html#a6873d41211a92c4f6b0074ef34ae1743',1,'ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a6873d41211a92c4f6b0074ef34ae1743',1,'ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a6873d41211a92c4f6b0074ef34ae1743',1,'ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params): ntru_keypair.c']]], - ['ntru_5fdecrypt_2ec',['ntru_decrypt.c',['../ntru__decrypt_8c.html',1,'']]], - ['ntru_5fdecrypt_2eh',['ntru_decrypt.h',['../ntru__decrypt_8h.html',1,'']]], - ['ntru_5fdecrypt_5fpoly',['ntru_decrypt_poly',['../ntru__decrypt_8c.html#a41c72f59e37a3c6ef6790eb909555d76',1,'ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_bin, const ntru_params *params): ntru_decrypt.c'],['../ntru__decrypt_8h.html#a8108219b815b18d63672bbc45e76ca31',1,'ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_tern, const ntru_params *params): ntru_decrypt.c']]], - ['ntru_5fdecrypt_5fstring',['ntru_decrypt_string',['../ntru__decrypt_8c.html#aa9cc61eec0c119e48762f6078a14527b',1,'ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params): ntru_decrypt.c'],['../ntru__decrypt_8h.html#aa9cc61eec0c119e48762f6078a14527b',1,'ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params): ntru_decrypt.c'],['../decrypt_8h.html#aa9cc61eec0c119e48762f6078a14527b',1,'ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params): ntru_decrypt.c']]], - ['ntru_5fdelete_5fkeypair',['ntru_delete_keypair',['../ntru__keypair_8c.html#a5279c4990bc22bb9e735fe36372a6786',1,'ntru_delete_keypair(keypair *pair): ntru_keypair.c'],['../ntru__keypair_8h.html#a5279c4990bc22bb9e735fe36372a6786',1,'ntru_delete_keypair(keypair *pair): ntru_keypair.c'],['../keypair_8h.html#a5279c4990bc22bb9e735fe36372a6786',1,'ntru_delete_keypair(keypair *pair): ntru_keypair.c']]], - ['ntru_5fencrypt_2ec',['ntru_encrypt.c',['../ntru__encrypt_8c.html',1,'']]], - ['ntru_5fencrypt_2eh',['ntru_encrypt.h',['../ntru__encrypt_8h.html',1,'']]], - ['ntru_5fencrypt_5fpoly',['ntru_encrypt_poly',['../ntru__encrypt_8c.html#a0156453c7cab7cf3da259beb1daf914b',1,'ntru_encrypt_poly(const fmpz_poly_t msg_bin, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params): ntru_encrypt.c'],['../ntru__encrypt_8h.html#a9063450af4b523d202c7628dbac70e68',1,'ntru_encrypt_poly(const fmpz_poly_t msg_tern, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params): ntru_encrypt.c']]], - ['ntru_5fencrypt_5fstring',['ntru_encrypt_string',['../ntru__encrypt_8c.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params): ntru_encrypt.c'],['../ntru__encrypt_8h.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params): ntru_encrypt.c'],['../encrypt_8h.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params): ntru_encrypt.c']]], - ['ntru_5ferr_2eh',['ntru_err.h',['../ntru__err_8h.html',1,'']]], - ['ntru_5ffile_2ec',['ntru_file.c',['../ntru__file_8c.html',1,'']]], - ['ntru_5ffile_2eh',['ntru_file.h',['../ntru__file_8h.html',1,'']]], - ['ntru_5fget_5frnd_5ftern_5fpoly_5fnum',['ntru_get_rnd_tern_poly_num',['../ntru__rnd_8c.html#a916a55c609c172ae4e48896032b36e47',1,'ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)): ntru_rnd.c'],['../ntru__rnd_8h.html#a916a55c609c172ae4e48896032b36e47',1,'ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)): ntru_rnd.c'],['../rnd_8h.html#a916a55c609c172ae4e48896032b36e47',1,'ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)): ntru_rnd.c']]], - ['ntru_5fkeypair_2ec',['ntru_keypair.c',['../ntru__keypair_8c.html',1,'']]], - ['ntru_5fkeypair_2eh',['ntru_keypair.h',['../ntru__keypair_8h.html',1,'']]], - ['ntru_5fmalloc',['ntru_malloc',['../ntru__mem_8c.html#a020790bf8b201fde92395cf975c0c691',1,'ntru_malloc(size_t size): ntru_mem.c'],['../ntru__mem_8h.html#a020790bf8b201fde92395cf975c0c691',1,'ntru_malloc(size_t size): ntru_mem.c']]], - ['ntru_5fmem_2ec',['ntru_mem.c',['../ntru__mem_8c.html',1,'']]], - ['ntru_5fmem_2eh',['ntru_mem.h',['../ntru__mem_8h.html',1,'']]], - ['ntru_5fparams',['ntru_params',['../structntru__params.html',1,'ntru_params'],['../ntru__params_8h.html#a2f326c88fc033eca78a47ee8d387c592',1,'ntru_params(): ntru_params.h'],['../ntru_8h.html#a2f326c88fc033eca78a47ee8d387c592',1,'ntru_params(): ntru.h']]], - ['ntru_5fparams_2eh',['ntru_params.h',['../ntru__params_8h.html',1,'']]], - ['ntru_5fpoly_2ec',['ntru_poly.c',['../ntru__poly_8c.html',1,'']]], - ['ntru_5fpoly_2eh',['ntru_poly.h',['../ntru__poly_8h.html',1,'']]], - ['ntru_5fpoly_5fascii_2ec',['ntru_poly_ascii.c',['../ntru__poly__ascii_8c.html',1,'']]], - ['ntru_5fpoly_5fascii_2eh',['ntru_poly_ascii.h',['../ntru__poly__ascii_8h.html',1,'']]], - ['ntru_5frnd_2ec',['ntru_rnd.c',['../ntru__rnd_8c.html',1,'']]], - ['ntru_5frnd_2eh',['ntru_rnd.h',['../ntru__rnd_8h.html',1,'']]], - ['ntru_5fstring_2ec',['ntru_string.c',['../ntru__string_8c.html',1,'']]], - ['ntru_5fstring_2eh',['ntru_string.h',['../ntru__string_8h.html',1,'']]], - ['ntru_5fwarn',['NTRU_WARN',['../ntru__err_8h.html#a8b2647533f0e1a6f81e08e8315674d55',1,'ntru_err.h']]], - ['ntru_5fwarn_5fdebug',['NTRU_WARN_DEBUG',['../ntru__err_8h.html#abcb6d051074ab3a58c5e9764f927753c',1,'ntru_err.h']]] + ['string',['string',['../structstring.html',1,'string'],['../ntru_8h.html#a63e2e3ee7db5274c6a3929edfc07c6c9',1,'string(): ntru.h']]], + ['string_5fdelete',['string_delete',['../ntru_8h.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'ntru.h']]] ]; diff --git a/search/all_b.js b/search/all_b.js index 6d7a891..3871b9d 100644 --- a/search/all_b.js +++ b/search/all_b.js @@ -1,23 +1,4 @@ var searchData= [ - ['p',['p',['../structntru__params.html#a41b368825e1eb126604e13e8f549ec8f',1,'ntru_params']]], - ['poly_5farr_5fto_5fascii',['poly_arr_to_ascii',['../ntru__poly__ascii_8c.html#afa141976b665b94c0db9912bc50de4a1',1,'poly_arr_to_ascii(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#afa141976b665b94c0db9912bc50de4a1',1,'poly_arr_to_ascii(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c']]], - ['poly_5farr_5fto_5fbase64',['poly_arr_to_base64',['../ntru__poly__ascii_8c.html#a0dc14698073df2e46e6540cbff870fc7',1,'poly_arr_to_base64(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#a16163cc57631a0965577cb0f89365ca0',1,'poly_arr_to_base64(const fmpz_poly_t **poly_arr, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c']]], - ['poly_5fdelete',['poly_delete',['../ntru__poly_8c.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'poly_delete(fmpz_poly_t poly): ntru_poly.c'],['../ntru__poly_8h.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'poly_delete(fmpz_poly_t poly): ntru_poly.c'],['../ntru_8h.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'poly_delete(fmpz_poly_t poly): ntru_poly.c']]], - ['poly_5fdelete_5fall',['poly_delete_all',['../ntru__poly_8c.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'poly_delete_all(fmpz_poly_t poly,...): ntru_poly.c'],['../ntru__poly_8h.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'poly_delete_all(fmpz_poly_t poly,...): ntru_poly.c'],['../ntru_8h.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'poly_delete_all(fmpz_poly_t poly,...): ntru_poly.c']]], - ['poly_5fdelete_5farray',['poly_delete_array',['../ntru__poly_8c.html#a3f53c63383ff301b20dcede0783869a7',1,'poly_delete_array(fmpz_poly_t **poly_array): ntru_poly.c'],['../ntru__poly_8h.html#a3f53c63383ff301b20dcede0783869a7',1,'poly_delete_array(fmpz_poly_t **poly_array): ntru_poly.c'],['../ntru_8h.html#a3f53c63383ff301b20dcede0783869a7',1,'poly_delete_array(fmpz_poly_t **poly_array): ntru_poly.c']]], - ['poly_5fdraw',['poly_draw',['../ntru__poly_8c.html#a80a8ce0f2944bc3df94291ef2f781498',1,'poly_draw(const fmpz_poly_t poly): ntru_poly.c'],['../ntru__poly_8h.html#a80a8ce0f2944bc3df94291ef2f781498',1,'poly_draw(const fmpz_poly_t poly): ntru_poly.c'],['../ntru_8h.html#a80a8ce0f2944bc3df94291ef2f781498',1,'poly_draw(const fmpz_poly_t poly): ntru_poly.c']]], - ['poly_5fdraw_5fpretty',['poly_draw_pretty',['../ntru__poly_8c.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'poly_draw_pretty(const fmpz_poly_t poly): ntru_poly.c'],['../ntru__poly_8h.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'poly_draw_pretty(const fmpz_poly_t poly): ntru_poly.c'],['../ntru_8h.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'poly_draw_pretty(const fmpz_poly_t poly): ntru_poly.c']]], - ['poly_5finverse_5fpoly_5fp',['poly_inverse_poly_p',['../ntru__poly_8c.html#ae77b2014df42e5ed612206d5930ac608',1,'poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params): ntru_poly.c'],['../ntru__poly_8h.html#ae77b2014df42e5ed612206d5930ac608',1,'poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params): ntru_poly.c']]], - ['poly_5finverse_5fpoly_5fq',['poly_inverse_poly_q',['../ntru__poly_8c.html#ace66beb516186e52f9b5b1ed8a397849',1,'poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params): ntru_poly.c'],['../ntru__poly_8h.html#ace66beb516186e52f9b5b1ed8a397849',1,'poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params): ntru_poly.c']]], - ['poly_5fmod2_5fto_5fmodq',['poly_mod2_to_modq',['../ntru__poly_8c.html#a891af13dc4355c9fab9ca3fafcac8054',1,'ntru_poly.c']]], - ['poly_5fnew',['poly_new',['../ntru__poly_8c.html#a20f86085d5eb5372fd25dc270069d38c',1,'poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len): ntru_poly.c'],['../ntru__poly_8h.html#a20f86085d5eb5372fd25dc270069d38c',1,'poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len): ntru_poly.c'],['../ntru_8h.html#a20f86085d5eb5372fd25dc270069d38c',1,'poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len): ntru_poly.c']]], - ['poly_5fstarmultiply',['poly_starmultiply',['../ntru__poly_8c.html#ae96f479ddd97af709a0ed50817fd3fb3',1,'poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus): ntru_poly.c'],['../ntru__poly_8h.html#ae96f479ddd97af709a0ed50817fd3fb3',1,'poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus): ntru_poly.c']]], - ['poly_5fto_5fascii',['poly_to_ascii',['../ntru__poly__ascii_8c.html#aa4d233591b7e51d6cf787edd3bfa91e2',1,'poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#aa4d233591b7e51d6cf787edd3bfa91e2',1,'poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c']]], - ['poly_5fto_5fbase64',['poly_to_base64',['../ntru__poly__ascii_8c.html#a4ba0179e3ae0d5e721ff8429a8265e80',1,'poly_to_base64(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#a4ba0179e3ae0d5e721ff8429a8265e80',1,'poly_to_base64(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c']]], - ['prints',['prints',['../ntru__string_8c.html#a55d4ce182c335ff6cca360909a7be395',1,'prints(const string *print_string): ntru_string.c'],['../ntru__string_8h.html#a55d4ce182c335ff6cca360909a7be395',1,'prints(const string *print_string): ntru_string.c'],['../ntru_8h.html#a55d4ce182c335ff6cca360909a7be395',1,'prints(const string *print_string): ntru_string.c']]], - ['priv',['priv',['../structkeypair.html#a9e9805ad001216da53f2c57accb288e1',1,'keypair']]], - ['priv_5finv',['priv_inv',['../structkeypair.html#a9e63f1d275b91c9d9716fb4069461799',1,'keypair']]], - ['ptr',['ptr',['../structstring.html#afd608f62303958cea6f1f7afdec1e282',1,'string']]], - ['pub',['pub',['../structkeypair.html#afa635c70f233d0b7449b4a17513646c4',1,'keypair']]] + ['write_5ffile',['write_file',['../ntru_8h.html#af2a0fc4dd4109749d8f3100a913cc304',1,'ntru.h']]] ]; diff --git a/search/all_c.html b/search/all_c.html deleted file mode 100644 index cbf7d06..0000000 --- a/search/all_c.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/all_c.js b/search/all_c.js deleted file mode 100644 index 0dbc610..0000000 --- a/search/all_c.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['q',['q',['../structntru__params.html#a29680750bda49dc93e61a752b2f2a0f7',1,'ntru_params']]] -]; diff --git a/search/all_d.html b/search/all_d.html deleted file mode 100644 index 67a6960..0000000 --- a/search/all_d.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/all_d.js b/search/all_d.js deleted file mode 100644 index 6216110..0000000 --- a/search/all_d.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['read_5ffile',['read_file',['../ntru__file_8c.html#a348c2a56837571f410d44631abc09dc4',1,'read_file(char const *const filename): ntru_file.c'],['../ntru__file_8h.html#a348c2a56837571f410d44631abc09dc4',1,'read_file(char const *const filename): ntru_file.c'],['../ntru_8h.html#a348c2a56837571f410d44631abc09dc4',1,'read_file(char const *const filename): ntru_file.c']]], - ['realloc',['REALLOC',['../ntru__mem_8h.html#a718b6446905826d711cb7ef00808bb4e',1,'ntru_mem.h']]], - ['rnd_2eh',['rnd.h',['../rnd_8h.html',1,'']]] -]; diff --git a/search/all_e.html b/search/all_e.html deleted file mode 100644 index 92ab0e3..0000000 --- a/search/all_e.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/all_e.js b/search/all_e.js deleted file mode 100644 index 0b1f896..0000000 --- a/search/all_e.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['std_5ffile_5fbuf',['STD_FILE_BUF',['../ntru__file_8c.html#a15651456278c8f50777dfe104f492951',1,'ntru_file.c']]], - ['string',['string',['../structstring.html',1,'string'],['../ntru__string_8h.html#a63e2e3ee7db5274c6a3929edfc07c6c9',1,'string(): ntru_string.h'],['../ntru_8h.html#a63e2e3ee7db5274c6a3929edfc07c6c9',1,'string(): ntru.h']]], - ['string_5fdelete',['string_delete',['../ntru__string_8c.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'string_delete(string *del_string): ntru_string.c'],['../ntru__string_8h.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'string_delete(string *del_string): ntru_string.c'],['../ntru_8h.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'string_delete(string *del_string): ntru_string.c']]] -]; diff --git a/search/all_f.html b/search/all_f.html deleted file mode 100644 index 6ff4c97..0000000 --- a/search/all_f.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/all_f.js b/search/all_f.js deleted file mode 100644 index 0f707cd..0000000 --- a/search/all_f.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['write_5ffile',['write_file',['../ntru__file_8c.html#a1f8eef5ea12c77ed2491d96864eb0d43',1,'write_file(string const *wstring, char const *const filename): ntru_file.c'],['../ntru__file_8h.html#a1f8eef5ea12c77ed2491d96864eb0d43',1,'write_file(string const *wstring, char const *const filename): ntru_file.c'],['../ntru_8h.html#af2a0fc4dd4109749d8f3100a913cc304',1,'write_file(string const *wstring, char const *const filename): ntru_file.c']]] -]; diff --git a/search/defines_0.html b/search/defines_0.html deleted file mode 100644 index 6560632..0000000 --- a/search/defines_0.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/defines_0.js b/search/defines_0.js deleted file mode 100644 index adccf1d..0000000 --- a/search/defines_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['ascii_5fbits',['ASCII_BITS',['../ntru__common_8h.html#a8d370c21bcf662e586397e764aba95e1',1,'ntru_common.h']]] -]; diff --git a/search/defines_1.html b/search/defines_1.html deleted file mode 100644 index 65d9b1f..0000000 --- a/search/defines_1.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/defines_1.js b/search/defines_1.js deleted file mode 100644 index dbb85e2..0000000 --- a/search/defines_1.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['char_5fsize',['CHAR_SIZE',['../ntru__common_8h.html#a22c7f61c2f0fa6b1943548e838055cec',1,'ntru_common.h']]] -]; diff --git a/search/defines_2.html b/search/defines_2.html deleted file mode 100644 index 03237b1..0000000 --- a/search/defines_2.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/defines_2.js b/search/defines_2.js deleted file mode 100644 index 134a711..0000000 --- a/search/defines_2.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['ntru_5fabort',['NTRU_ABORT',['../ntru__err_8h.html#ab0f71521e9bc99beab8ece52bb00341a',1,'ntru_err.h']]], - ['ntru_5fabort_5fdebug',['NTRU_ABORT_DEBUG',['../ntru__err_8h.html#a5d4dd1c1539c408c0dcd915750e8f224',1,'ntru_err.h']]], - ['ntru_5fwarn',['NTRU_WARN',['../ntru__err_8h.html#a8b2647533f0e1a6f81e08e8315674d55',1,'ntru_err.h']]], - ['ntru_5fwarn_5fdebug',['NTRU_WARN_DEBUG',['../ntru__err_8h.html#abcb6d051074ab3a58c5e9764f927753c',1,'ntru_err.h']]] -]; diff --git a/search/defines_3.html b/search/defines_3.html deleted file mode 100644 index 9e71a8a..0000000 --- a/search/defines_3.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/defines_3.js b/search/defines_3.js deleted file mode 100644 index 0083cc9..0000000 --- a/search/defines_3.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['realloc',['REALLOC',['../ntru__mem_8h.html#a718b6446905826d711cb7ef00808bb4e',1,'ntru_mem.h']]] -]; diff --git a/search/defines_4.html b/search/defines_4.html deleted file mode 100644 index 03de299..0000000 --- a/search/defines_4.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/defines_4.js b/search/defines_4.js deleted file mode 100644 index a37dd70..0000000 --- a/search/defines_4.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['std_5ffile_5fbuf',['STD_FILE_BUF',['../ntru__file_8c.html#a15651456278c8f50777dfe104f492951',1,'ntru_file.c']]] -]; diff --git a/search/files_3.js b/search/files_3.js index 11e19e9..53c4896 100644 --- a/search/files_3.js +++ b/search/files_3.js @@ -1,27 +1,4 @@ var searchData= [ - ['ntru_2eh',['ntru.h',['../ntru_8h.html',1,'']]], - ['ntru_5fascii_5fpoly_2ec',['ntru_ascii_poly.c',['../ntru__ascii__poly_8c.html',1,'']]], - ['ntru_5fascii_5fpoly_2eh',['ntru_ascii_poly.h',['../ntru__ascii__poly_8h.html',1,'']]], - ['ntru_5fcommon_2eh',['ntru_common.h',['../ntru__common_8h.html',1,'']]], - ['ntru_5fdecrypt_2ec',['ntru_decrypt.c',['../ntru__decrypt_8c.html',1,'']]], - ['ntru_5fdecrypt_2eh',['ntru_decrypt.h',['../ntru__decrypt_8h.html',1,'']]], - ['ntru_5fencrypt_2ec',['ntru_encrypt.c',['../ntru__encrypt_8c.html',1,'']]], - ['ntru_5fencrypt_2eh',['ntru_encrypt.h',['../ntru__encrypt_8h.html',1,'']]], - ['ntru_5ferr_2eh',['ntru_err.h',['../ntru__err_8h.html',1,'']]], - ['ntru_5ffile_2ec',['ntru_file.c',['../ntru__file_8c.html',1,'']]], - ['ntru_5ffile_2eh',['ntru_file.h',['../ntru__file_8h.html',1,'']]], - ['ntru_5fkeypair_2ec',['ntru_keypair.c',['../ntru__keypair_8c.html',1,'']]], - ['ntru_5fkeypair_2eh',['ntru_keypair.h',['../ntru__keypair_8h.html',1,'']]], - ['ntru_5fmem_2ec',['ntru_mem.c',['../ntru__mem_8c.html',1,'']]], - ['ntru_5fmem_2eh',['ntru_mem.h',['../ntru__mem_8h.html',1,'']]], - ['ntru_5fparams_2eh',['ntru_params.h',['../ntru__params_8h.html',1,'']]], - ['ntru_5fpoly_2ec',['ntru_poly.c',['../ntru__poly_8c.html',1,'']]], - ['ntru_5fpoly_2eh',['ntru_poly.h',['../ntru__poly_8h.html',1,'']]], - ['ntru_5fpoly_5fascii_2ec',['ntru_poly_ascii.c',['../ntru__poly__ascii_8c.html',1,'']]], - ['ntru_5fpoly_5fascii_2eh',['ntru_poly_ascii.h',['../ntru__poly__ascii_8h.html',1,'']]], - ['ntru_5frnd_2ec',['ntru_rnd.c',['../ntru__rnd_8c.html',1,'']]], - ['ntru_5frnd_2eh',['ntru_rnd.h',['../ntru__rnd_8h.html',1,'']]], - ['ntru_5fstring_2ec',['ntru_string.c',['../ntru__string_8c.html',1,'']]], - ['ntru_5fstring_2eh',['ntru_string.h',['../ntru__string_8h.html',1,'']]] + ['ntru_2eh',['ntru.h',['../ntru_8h.html',1,'']]] ]; diff --git a/search/functions_0.js b/search/functions_0.js index 5981a30..a0e3d9c 100644 --- a/search/functions_0.js +++ b/search/functions_0.js @@ -1,5 +1,5 @@ var searchData= [ - ['ascii_5fbin_5fto_5fbin_5fpoly',['ascii_bin_to_bin_poly',['../ntru__ascii__poly_8c.html#aa5d0d4abdb2ce837a0a3b6e478c8f1a9',1,'ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params): ntru_ascii_poly.c'],['../ntru__ascii__poly_8h.html#aa5d0d4abdb2ce837a0a3b6e478c8f1a9',1,'ascii_bin_to_bin_poly(const char *to_poly, const ntru_params *params): ntru_ascii_poly.c']]], - ['ascii_5fto_5fbin_5fpoly_5farr',['ascii_to_bin_poly_arr',['../ntru__ascii__poly_8c.html#a3237071bca2489c3b2efd46e674e0805',1,'ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c'],['../ntru__ascii__poly_8h.html#a3237071bca2489c3b2efd46e674e0805',1,'ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c']]] + ['export_5fpriv_5fkey',['export_priv_key',['../keypair_8h.html#afa29f14a14486d3f6b979ee900d7e738',1,'keypair.h']]], + ['export_5fpublic_5fkey',['export_public_key',['../keypair_8h.html#a41741ed660cb806c47335f66055e1bdd',1,'keypair.h']]] ]; diff --git a/search/functions_1.js b/search/functions_1.js index fcb635e..0147ba9 100644 --- a/search/functions_1.js +++ b/search/functions_1.js @@ -1,6 +1,5 @@ var searchData= [ - ['base64_5fto_5fpoly_5farr',['base64_to_poly_arr',['../ntru__ascii__poly_8c.html#a8460cd27ad4562f560bb304609a3e06d',1,'base64_to_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c'],['../ntru__ascii__poly_8h.html#a8460cd27ad4562f560bb304609a3e06d',1,'base64_to_poly_arr(const string *to_poly, const ntru_params *params): ntru_ascii_poly.c']]], - ['bin_5fpoly_5farr_5fto_5fascii',['bin_poly_arr_to_ascii',['../ntru__poly__ascii_8c.html#ab9464c96c3ebec6ee716c604fdc4ad21',1,'bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#ab9464c96c3ebec6ee716c604fdc4ad21',1,'bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c']]], - ['bin_5fpoly_5fto_5fascii',['bin_poly_to_ascii',['../ntru__poly__ascii_8c.html#a0d86ab2dede39b332d4149e16b2046b8',1,'bin_poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#a0d86ab2dede39b332d4149e16b2046b8',1,'bin_poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c']]] + ['get_5frnd_5fint',['get_rnd_int',['../rnd_8h.html#ad85ebfb1cb4b4942942213b750812cf0',1,'rnd.h']]], + ['get_5furnd_5fint',['get_urnd_int',['../rnd_8h.html#a99e4820cab7157eb1e16109e21dac81f',1,'rnd.h']]] ]; diff --git a/search/functions_2.js b/search/functions_2.js index 843aa97..25fa482 100644 --- a/search/functions_2.js +++ b/search/functions_2.js @@ -1,5 +1,5 @@ var searchData= [ - ['export_5fpriv_5fkey',['export_priv_key',['../ntru__keypair_8c.html#afa29f14a14486d3f6b979ee900d7e738',1,'export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#afa29f14a14486d3f6b979ee900d7e738',1,'export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#afa29f14a14486d3f6b979ee900d7e738',1,'export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params): ntru_keypair.c']]], - ['export_5fpublic_5fkey',['export_public_key',['../ntru__keypair_8c.html#a41741ed660cb806c47335f66055e1bdd',1,'export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a41741ed660cb806c47335f66055e1bdd',1,'export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a41741ed660cb806c47335f66055e1bdd',1,'export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c']]] + ['import_5fpriv_5fkey',['import_priv_key',['../keypair_8h.html#a1f917ea6ef5302826c888e5c88e0869e',1,'keypair.h']]], + ['import_5fpublic_5fkey',['import_public_key',['../keypair_8h.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'keypair.h']]] ]; diff --git a/search/functions_3.js b/search/functions_3.js index dfec881..da2ef37 100644 --- a/search/functions_3.js +++ b/search/functions_3.js @@ -1,9 +1,8 @@ var searchData= [ - ['fmpz_5fadd_5fn',['fmpz_add_n',['../ntru__poly_8c.html#ad2a11e832808ef1cfee0eed1cc02f4b9',1,'fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h): ntru_poly.c'],['../ntru__poly_8h.html#ad2a11e832808ef1cfee0eed1cc02f4b9',1,'fmpz_add_n(fmpz_t f, const fmpz_t g, const fmpz_t h): ntru_poly.c']]], - ['fmpz_5fcmp_5fsi_5fn',['fmpz_cmp_si_n',['../ntru__poly_8c.html#aaaac83ec72414aa208832442657c3520',1,'fmpz_cmp_si_n(const fmpz_t f, slong g): ntru_poly.c'],['../ntru__poly_8h.html#aaaac83ec72414aa208832442657c3520',1,'fmpz_cmp_si_n(const fmpz_t f, slong g): ntru_poly.c']]], - ['fmpz_5finvmod_5fui',['fmpz_invmod_ui',['../ntru__poly_8c.html#a59da1b7962829af8f18d58c05f588606',1,'fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod): ntru_poly.c'],['../ntru__poly_8h.html#a59da1b7962829af8f18d58c05f588606',1,'fmpz_invmod_ui(fmpz_t f, const fmpz_t g, const uint32_t mod): ntru_poly.c']]], - ['fmpz_5fpoly_5fmod',['fmpz_poly_mod',['../ntru__poly_8c.html#a7c4f5e96355518dc97a23da8f34b661a',1,'fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod): ntru_poly.c'],['../ntru__poly_8h.html#a7c4f5e96355518dc97a23da8f34b661a',1,'fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod): ntru_poly.c']]], - ['fmpz_5fpoly_5fmod_5funsigned',['fmpz_poly_mod_unsigned',['../ntru__poly_8c.html#ae7d0d8364dba689df3fb4904610634cc',1,'fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod): ntru_poly.c'],['../ntru__poly_8h.html#ae7d0d8364dba689df3fb4904610634cc',1,'fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod): ntru_poly.c']]], - ['fmpz_5fpoly_5fset_5fcoeff_5ffmpz_5fn',['fmpz_poly_set_coeff_fmpz_n',['../ntru__poly_8c.html#ab1f966fe680d1ce7c19c8c812d1932a7',1,'fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n, const fmpz_t x): ntru_poly.c'],['../ntru__poly_8h.html#ab1f966fe680d1ce7c19c8c812d1932a7',1,'fmpz_poly_set_coeff_fmpz_n(fmpz_poly_t poly, slong n, const fmpz_t x): ntru_poly.c']]] + ['ntru_5fcreate_5fkeypair',['ntru_create_keypair',['../keypair_8h.html#a6873d41211a92c4f6b0074ef34ae1743',1,'keypair.h']]], + ['ntru_5fdecrypt_5fstring',['ntru_decrypt_string',['../decrypt_8h.html#aa9cc61eec0c119e48762f6078a14527b',1,'decrypt.h']]], + ['ntru_5fdelete_5fkeypair',['ntru_delete_keypair',['../keypair_8h.html#a5279c4990bc22bb9e735fe36372a6786',1,'keypair.h']]], + ['ntru_5fencrypt_5fstring',['ntru_encrypt_string',['../encrypt_8h.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'encrypt.h']]], + ['ntru_5fget_5frnd_5ftern_5fpoly_5fnum',['ntru_get_rnd_tern_poly_num',['../rnd_8h.html#a916a55c609c172ae4e48896032b36e47',1,'rnd.h']]] ]; diff --git a/search/functions_4.js b/search/functions_4.js index ae0b615..8605ea0 100644 --- a/search/functions_4.js +++ b/search/functions_4.js @@ -1,7 +1,10 @@ var searchData= [ - ['get_5fbin_5farr_5fto_5fascii',['get_bin_arr_to_ascii',['../ntru__poly__ascii_8c.html#afd3f036287b4f62846c1a236426d73e1',1,'ntru_poly_ascii.c']]], - ['get_5fint_5fto_5fbin_5fstr',['get_int_to_bin_str',['../ntru__ascii__poly_8c.html#a2d2f760b6a98bd87248c1d3e120a665b',1,'ntru_ascii_poly.c']]], - ['get_5frnd_5fint',['get_rnd_int',['../ntru__rnd_8c.html#ad85ebfb1cb4b4942942213b750812cf0',1,'get_rnd_int(void): ntru_rnd.c'],['../ntru__rnd_8h.html#ad85ebfb1cb4b4942942213b750812cf0',1,'get_rnd_int(void): ntru_rnd.c'],['../rnd_8h.html#ad85ebfb1cb4b4942942213b750812cf0',1,'get_rnd_int(void): ntru_rnd.c']]], - ['get_5furnd_5fint',['get_urnd_int',['../ntru__rnd_8c.html#a99e4820cab7157eb1e16109e21dac81f',1,'get_urnd_int(void): ntru_rnd.c'],['../ntru__rnd_8h.html#a99e4820cab7157eb1e16109e21dac81f',1,'get_urnd_int(void): ntru_rnd.c'],['../rnd_8h.html#a99e4820cab7157eb1e16109e21dac81f',1,'get_urnd_int(void): ntru_rnd.c']]] + ['poly_5fdelete',['poly_delete',['../ntru_8h.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'ntru.h']]], + ['poly_5fdelete_5fall',['poly_delete_all',['../ntru_8h.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'ntru.h']]], + ['poly_5fdelete_5farray',['poly_delete_array',['../ntru_8h.html#a3f53c63383ff301b20dcede0783869a7',1,'ntru.h']]], + ['poly_5fdraw',['poly_draw',['../ntru_8h.html#a80a8ce0f2944bc3df94291ef2f781498',1,'ntru.h']]], + ['poly_5fdraw_5fpretty',['poly_draw_pretty',['../ntru_8h.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'ntru.h']]], + ['poly_5fnew',['poly_new',['../ntru_8h.html#a20f86085d5eb5372fd25dc270069d38c',1,'ntru.h']]], + ['prints',['prints',['../ntru_8h.html#a55d4ce182c335ff6cca360909a7be395',1,'ntru.h']]] ]; diff --git a/search/functions_5.js b/search/functions_5.js index b5b3bb4..da0f054 100644 --- a/search/functions_5.js +++ b/search/functions_5.js @@ -1,5 +1,4 @@ var searchData= [ - ['import_5fpriv_5fkey',['import_priv_key',['../ntru__keypair_8c.html#a1f917ea6ef5302826c888e5c88e0869e',1,'import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a1f917ea6ef5302826c888e5c88e0869e',1,'import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a1f917ea6ef5302826c888e5c88e0869e',1,'import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params): ntru_keypair.c']]], - ['import_5fpublic_5fkey',['import_public_key',['../ntru__keypair_8c.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a4e2c6da04c55e8c1b6c447f4cc9f1d6f',1,'import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params): ntru_keypair.c']]] + ['read_5ffile',['read_file',['../ntru_8h.html#a348c2a56837571f410d44631abc09dc4',1,'ntru.h']]] ]; diff --git a/search/functions_6.js b/search/functions_6.js index 55c449e..999210e 100644 --- a/search/functions_6.js +++ b/search/functions_6.js @@ -1,12 +1,4 @@ var searchData= [ - ['ntru_5fcalloc',['ntru_calloc',['../ntru__mem_8c.html#a37e0be4fd8d0b677a41c8287ef47885c',1,'ntru_calloc(size_t nmemb, size_t size): ntru_mem.c'],['../ntru__mem_8h.html#a37e0be4fd8d0b677a41c8287ef47885c',1,'ntru_calloc(size_t nmemb, size_t size): ntru_mem.c']]], - ['ntru_5fcreate_5fkeypair',['ntru_create_keypair',['../ntru__keypair_8c.html#a6873d41211a92c4f6b0074ef34ae1743',1,'ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params): ntru_keypair.c'],['../ntru__keypair_8h.html#a6873d41211a92c4f6b0074ef34ae1743',1,'ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params): ntru_keypair.c'],['../keypair_8h.html#a6873d41211a92c4f6b0074ef34ae1743',1,'ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params): ntru_keypair.c']]], - ['ntru_5fdecrypt_5fpoly',['ntru_decrypt_poly',['../ntru__decrypt_8c.html#a41c72f59e37a3c6ef6790eb909555d76',1,'ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_bin, const ntru_params *params): ntru_decrypt.c'],['../ntru__decrypt_8h.html#a8108219b815b18d63672bbc45e76ca31',1,'ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_tern, const ntru_params *params): ntru_decrypt.c']]], - ['ntru_5fdecrypt_5fstring',['ntru_decrypt_string',['../ntru__decrypt_8c.html#aa9cc61eec0c119e48762f6078a14527b',1,'ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params): ntru_decrypt.c'],['../ntru__decrypt_8h.html#aa9cc61eec0c119e48762f6078a14527b',1,'ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params): ntru_decrypt.c'],['../decrypt_8h.html#aa9cc61eec0c119e48762f6078a14527b',1,'ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params): ntru_decrypt.c']]], - ['ntru_5fdelete_5fkeypair',['ntru_delete_keypair',['../ntru__keypair_8c.html#a5279c4990bc22bb9e735fe36372a6786',1,'ntru_delete_keypair(keypair *pair): ntru_keypair.c'],['../ntru__keypair_8h.html#a5279c4990bc22bb9e735fe36372a6786',1,'ntru_delete_keypair(keypair *pair): ntru_keypair.c'],['../keypair_8h.html#a5279c4990bc22bb9e735fe36372a6786',1,'ntru_delete_keypair(keypair *pair): ntru_keypair.c']]], - ['ntru_5fencrypt_5fpoly',['ntru_encrypt_poly',['../ntru__encrypt_8c.html#a0156453c7cab7cf3da259beb1daf914b',1,'ntru_encrypt_poly(const fmpz_poly_t msg_bin, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params): ntru_encrypt.c'],['../ntru__encrypt_8h.html#a9063450af4b523d202c7628dbac70e68',1,'ntru_encrypt_poly(const fmpz_poly_t msg_tern, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params): ntru_encrypt.c']]], - ['ntru_5fencrypt_5fstring',['ntru_encrypt_string',['../ntru__encrypt_8c.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params): ntru_encrypt.c'],['../ntru__encrypt_8h.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params): ntru_encrypt.c'],['../encrypt_8h.html#a0bb47c0fa0dd4a4cfa0c0f7a722fd554',1,'ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const ntru_params *params): ntru_encrypt.c']]], - ['ntru_5fget_5frnd_5ftern_5fpoly_5fnum',['ntru_get_rnd_tern_poly_num',['../ntru__rnd_8c.html#a916a55c609c172ae4e48896032b36e47',1,'ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)): ntru_rnd.c'],['../ntru__rnd_8h.html#a916a55c609c172ae4e48896032b36e47',1,'ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)): ntru_rnd.c'],['../rnd_8h.html#a916a55c609c172ae4e48896032b36e47',1,'ntru_get_rnd_tern_poly_num(fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)): ntru_rnd.c']]], - ['ntru_5fmalloc',['ntru_malloc',['../ntru__mem_8c.html#a020790bf8b201fde92395cf975c0c691',1,'ntru_malloc(size_t size): ntru_mem.c'],['../ntru__mem_8h.html#a020790bf8b201fde92395cf975c0c691',1,'ntru_malloc(size_t size): ntru_mem.c']]] + ['string_5fdelete',['string_delete',['../ntru_8h.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'ntru.h']]] ]; diff --git a/search/functions_7.js b/search/functions_7.js index 47967da..3871b9d 100644 --- a/search/functions_7.js +++ b/search/functions_7.js @@ -1,18 +1,4 @@ var searchData= [ - ['poly_5farr_5fto_5fascii',['poly_arr_to_ascii',['../ntru__poly__ascii_8c.html#afa141976b665b94c0db9912bc50de4a1',1,'poly_arr_to_ascii(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#afa141976b665b94c0db9912bc50de4a1',1,'poly_arr_to_ascii(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c']]], - ['poly_5farr_5fto_5fbase64',['poly_arr_to_base64',['../ntru__poly__ascii_8c.html#a0dc14698073df2e46e6540cbff870fc7',1,'poly_arr_to_base64(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#a16163cc57631a0965577cb0f89365ca0',1,'poly_arr_to_base64(const fmpz_poly_t **poly_arr, const uint32_t poly_c, const ntru_params *params): ntru_poly_ascii.c']]], - ['poly_5fdelete',['poly_delete',['../ntru__poly_8c.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'poly_delete(fmpz_poly_t poly): ntru_poly.c'],['../ntru__poly_8h.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'poly_delete(fmpz_poly_t poly): ntru_poly.c'],['../ntru_8h.html#a27ff2116f70bcbf5028219adcae4c5f0',1,'poly_delete(fmpz_poly_t poly): ntru_poly.c']]], - ['poly_5fdelete_5fall',['poly_delete_all',['../ntru__poly_8c.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'poly_delete_all(fmpz_poly_t poly,...): ntru_poly.c'],['../ntru__poly_8h.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'poly_delete_all(fmpz_poly_t poly,...): ntru_poly.c'],['../ntru_8h.html#a83297bc2ab5b6e7ce42553570dd8268f',1,'poly_delete_all(fmpz_poly_t poly,...): ntru_poly.c']]], - ['poly_5fdelete_5farray',['poly_delete_array',['../ntru__poly_8c.html#a3f53c63383ff301b20dcede0783869a7',1,'poly_delete_array(fmpz_poly_t **poly_array): ntru_poly.c'],['../ntru__poly_8h.html#a3f53c63383ff301b20dcede0783869a7',1,'poly_delete_array(fmpz_poly_t **poly_array): ntru_poly.c'],['../ntru_8h.html#a3f53c63383ff301b20dcede0783869a7',1,'poly_delete_array(fmpz_poly_t **poly_array): ntru_poly.c']]], - ['poly_5fdraw',['poly_draw',['../ntru__poly_8c.html#a80a8ce0f2944bc3df94291ef2f781498',1,'poly_draw(const fmpz_poly_t poly): ntru_poly.c'],['../ntru__poly_8h.html#a80a8ce0f2944bc3df94291ef2f781498',1,'poly_draw(const fmpz_poly_t poly): ntru_poly.c'],['../ntru_8h.html#a80a8ce0f2944bc3df94291ef2f781498',1,'poly_draw(const fmpz_poly_t poly): ntru_poly.c']]], - ['poly_5fdraw_5fpretty',['poly_draw_pretty',['../ntru__poly_8c.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'poly_draw_pretty(const fmpz_poly_t poly): ntru_poly.c'],['../ntru__poly_8h.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'poly_draw_pretty(const fmpz_poly_t poly): ntru_poly.c'],['../ntru_8h.html#aec098d00160d2d502eb1f8a7c3fa5453',1,'poly_draw_pretty(const fmpz_poly_t poly): ntru_poly.c']]], - ['poly_5finverse_5fpoly_5fp',['poly_inverse_poly_p',['../ntru__poly_8c.html#ae77b2014df42e5ed612206d5930ac608',1,'poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params): ntru_poly.c'],['../ntru__poly_8h.html#ae77b2014df42e5ed612206d5930ac608',1,'poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params): ntru_poly.c']]], - ['poly_5finverse_5fpoly_5fq',['poly_inverse_poly_q',['../ntru__poly_8c.html#ace66beb516186e52f9b5b1ed8a397849',1,'poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params): ntru_poly.c'],['../ntru__poly_8h.html#ace66beb516186e52f9b5b1ed8a397849',1,'poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params): ntru_poly.c']]], - ['poly_5fmod2_5fto_5fmodq',['poly_mod2_to_modq',['../ntru__poly_8c.html#a891af13dc4355c9fab9ca3fafcac8054',1,'ntru_poly.c']]], - ['poly_5fnew',['poly_new',['../ntru__poly_8c.html#a20f86085d5eb5372fd25dc270069d38c',1,'poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len): ntru_poly.c'],['../ntru__poly_8h.html#a20f86085d5eb5372fd25dc270069d38c',1,'poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len): ntru_poly.c'],['../ntru_8h.html#a20f86085d5eb5372fd25dc270069d38c',1,'poly_new(fmpz_poly_t new_poly, int const *const c, const size_t len): ntru_poly.c']]], - ['poly_5fstarmultiply',['poly_starmultiply',['../ntru__poly_8c.html#ae96f479ddd97af709a0ed50817fd3fb3',1,'poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus): ntru_poly.c'],['../ntru__poly_8h.html#ae96f479ddd97af709a0ed50817fd3fb3',1,'poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus): ntru_poly.c']]], - ['poly_5fto_5fascii',['poly_to_ascii',['../ntru__poly__ascii_8c.html#aa4d233591b7e51d6cf787edd3bfa91e2',1,'poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#aa4d233591b7e51d6cf787edd3bfa91e2',1,'poly_to_ascii(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c']]], - ['poly_5fto_5fbase64',['poly_to_base64',['../ntru__poly__ascii_8c.html#a4ba0179e3ae0d5e721ff8429a8265e80',1,'poly_to_base64(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c'],['../ntru__poly__ascii_8h.html#a4ba0179e3ae0d5e721ff8429a8265e80',1,'poly_to_base64(const fmpz_poly_t poly, const ntru_params *params): ntru_poly_ascii.c']]], - ['prints',['prints',['../ntru__string_8c.html#a55d4ce182c335ff6cca360909a7be395',1,'prints(const string *print_string): ntru_string.c'],['../ntru__string_8h.html#a55d4ce182c335ff6cca360909a7be395',1,'prints(const string *print_string): ntru_string.c'],['../ntru_8h.html#a55d4ce182c335ff6cca360909a7be395',1,'prints(const string *print_string): ntru_string.c']]] + ['write_5ffile',['write_file',['../ntru_8h.html#af2a0fc4dd4109749d8f3100a913cc304',1,'ntru.h']]] ]; diff --git a/search/functions_8.html b/search/functions_8.html deleted file mode 100644 index 491e522..0000000 --- a/search/functions_8.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/functions_8.js b/search/functions_8.js deleted file mode 100644 index f48853a..0000000 --- a/search/functions_8.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['read_5ffile',['read_file',['../ntru__file_8c.html#a348c2a56837571f410d44631abc09dc4',1,'read_file(char const *const filename): ntru_file.c'],['../ntru__file_8h.html#a348c2a56837571f410d44631abc09dc4',1,'read_file(char const *const filename): ntru_file.c'],['../ntru_8h.html#a348c2a56837571f410d44631abc09dc4',1,'read_file(char const *const filename): ntru_file.c']]] -]; diff --git a/search/functions_9.html b/search/functions_9.html deleted file mode 100644 index 401869a..0000000 --- a/search/functions_9.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/functions_9.js b/search/functions_9.js deleted file mode 100644 index 5f73b94..0000000 --- a/search/functions_9.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['string_5fdelete',['string_delete',['../ntru__string_8c.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'string_delete(string *del_string): ntru_string.c'],['../ntru__string_8h.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'string_delete(string *del_string): ntru_string.c'],['../ntru_8h.html#ac1b5f66fbbbdfc7901357ddcfec52e5a',1,'string_delete(string *del_string): ntru_string.c']]] -]; diff --git a/search/functions_a.html b/search/functions_a.html deleted file mode 100644 index 27e7795..0000000 --- a/search/functions_a.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/search/functions_a.js b/search/functions_a.js deleted file mode 100644 index 0f707cd..0000000 --- a/search/functions_a.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['write_5ffile',['write_file',['../ntru__file_8c.html#a1f8eef5ea12c77ed2491d96864eb0d43',1,'write_file(string const *wstring, char const *const filename): ntru_file.c'],['../ntru__file_8h.html#a1f8eef5ea12c77ed2491d96864eb0d43',1,'write_file(string const *wstring, char const *const filename): ntru_file.c'],['../ntru_8h.html#af2a0fc4dd4109749d8f3100a913cc304',1,'write_file(string const *wstring, char const *const filename): ntru_file.c']]] -]; diff --git a/search/search.js b/search/search.js index e1d3f17..81943e9 100644 --- a/search/search.js +++ b/search/search.js @@ -7,14 +7,13 @@ var indexSectionsWithContent = { - 0: "abcdefgiklnpqrsw", + 0: "degiklnpqrsw", 1: "kns", 2: "deknr", - 3: "abefginprsw", + 3: "eginprsw", 4: "lnpq", 5: "kns", - 6: "acnrs", - 7: "i" + 6: "i" }; var indexSectionNames = @@ -25,8 +24,7 @@ var indexSectionNames = 3: "functions", 4: "variables", 5: "typedefs", - 6: "defines", - 7: "pages" + 6: "pages" }; function convertToId(search) diff --git a/search/typedefs_0.js b/search/typedefs_0.js index 0e89730..15f8ab1 100644 --- a/search/typedefs_0.js +++ b/search/typedefs_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['keypair',['keypair',['../ntru__keypair_8h.html#aacfc9254c7939584924ab9d27ba6f504',1,'keypair(): ntru_keypair.h'],['../keypair_8h.html#aacfc9254c7939584924ab9d27ba6f504',1,'keypair(): keypair.h']]] + ['keypair',['keypair',['../keypair_8h.html#aacfc9254c7939584924ab9d27ba6f504',1,'keypair.h']]] ]; diff --git a/search/typedefs_1.js b/search/typedefs_1.js index ee6f24b..f0b4047 100644 --- a/search/typedefs_1.js +++ b/search/typedefs_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['ntru_5fparams',['ntru_params',['../ntru__params_8h.html#a2f326c88fc033eca78a47ee8d387c592',1,'ntru_params(): ntru_params.h'],['../ntru_8h.html#a2f326c88fc033eca78a47ee8d387c592',1,'ntru_params(): ntru.h']]] + ['ntru_5fparams',['ntru_params',['../ntru_8h.html#a2f326c88fc033eca78a47ee8d387c592',1,'ntru.h']]] ]; diff --git a/search/typedefs_2.js b/search/typedefs_2.js index 9ae8184..34104f4 100644 --- a/search/typedefs_2.js +++ b/search/typedefs_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['string',['string',['../ntru__string_8h.html#a63e2e3ee7db5274c6a3929edfc07c6c9',1,'string(): ntru_string.h'],['../ntru_8h.html#a63e2e3ee7db5274c6a3929edfc07c6c9',1,'string(): ntru.h']]] + ['string',['string',['../ntru_8h.html#a63e2e3ee7db5274c6a3929edfc07c6c9',1,'ntru.h']]] ]; diff --git a/search/variables_2.js b/search/variables_2.js index 3237746..3b3d001 100644 --- a/search/variables_2.js +++ b/search/variables_2.js @@ -3,6 +3,6 @@ var searchData= ['p',['p',['../structntru__params.html#a41b368825e1eb126604e13e8f549ec8f',1,'ntru_params']]], ['priv',['priv',['../structkeypair.html#a9e9805ad001216da53f2c57accb288e1',1,'keypair']]], ['priv_5finv',['priv_inv',['../structkeypair.html#a9e63f1d275b91c9d9716fb4069461799',1,'keypair']]], - ['ptr',['ptr',['../structstring.html#afd608f62303958cea6f1f7afdec1e282',1,'string']]], + ['ptr',['ptr',['../structstring.html#aa1b2f3a2ddd1ed38245b8d4590aadf93',1,'string']]], ['pub',['pub',['../structkeypair.html#afa635c70f233d0b7449b4a17513646c4',1,'keypair']]] ]; diff --git a/structkeypair.html b/structkeypair.html index 46d5afa..1664ceb 100644 --- a/structkeypair.html +++ b/structkeypair.html @@ -70,7 +70,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs Macros Pages + All Data Structures Files Functions Variables Typedefs Pages
    @@ -88,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -

    #include <ntru_keypair.h>

    +

    #include <keypair.h>

    @@ -102,7 +102,7 @@ Data Fields

    Detailed Description

    This struct holds the keypair, both private and public components.

    -

    Definition at line 46 of file ntru_keypair.h.

    +

    Definition at line 49 of file keypair.h.

    Field Documentation

    @@ -115,7 +115,7 @@ Data Fields

    First part of the private key, a random polynom.

    -

    Definition at line 51 of file ntru_keypair.h.

    +

    Definition at line 54 of file keypair.h.

    @@ -130,7 +130,7 @@ Data Fields

    Second part of the private key, the priv polynom inverted.

    -

    Definition at line 56 of file ntru_keypair.h.

    +

    Definition at line 59 of file keypair.h.

    @@ -145,18 +145,17 @@ Data Fields

    The public key, computed as: h = p * (Fq * g) mod q

    -

    Definition at line 61 of file ntru_keypair.h.

    +

    Definition at line 64 of file keypair.h.

    -
    The documentation for this struct was generated from the following files:

    Data Fields

    @@ -102,7 +102,7 @@ Data Fields

    Detailed Description

    NTRU cryptosystem is specified by the following triple.

    -

    Definition at line 43 of file ntru_params.h.

    +

    Definition at line 47 of file ntru.h.

    Field Documentation

    @@ -115,7 +115,7 @@ Data Fields

    maximal degree N - 1 for all polynomials

    -

    Definition at line 48 of file ntru_params.h.

    +

    Definition at line 52 of file ntru.h.

    @@ -130,7 +130,7 @@ Data Fields

    small modulus

    -

    Definition at line 56 of file ntru_params.h.

    +

    Definition at line 60 of file ntru.h.

    @@ -145,18 +145,17 @@ Data Fields

    large modulus

    -

    Definition at line 52 of file ntru_params.h.

    +

    Definition at line 56 of file ntru.h.

    -
    The documentation for this struct was generated from the following files:

    Data Fields

    - - + +

    Data Fields

    char * ptr
     
    char * ptr
     
    size_t len
     

    Detailed Description

    Represents a string.

    -

    Definition at line 41 of file ntru_string.h.

    +

    Definition at line 66 of file ntru.h.

    Field Documentation

    @@ -113,33 +113,32 @@ Data Fields

    Length of the string.

    -

    Definition at line 53 of file ntru_string.h.

    +

    Definition at line 78 of file ntru.h.

    - +
    - +
    char * string::ptrchar* string::ptr

    Pointer to the char array, holding the actual string. THIS IS NOT NULL TERMINATED (at least not necessarily, don't ever assume it).

    -

    Definition at line 49 of file ntru_string.h.

    +

    Definition at line 74 of file ntru.h.

    -
    The documentation for this struct was generated from the following files: