post quantum cryptography
Highly optimized implementation of the NTRUEncrypt algorithm
 All Data Structures Files Functions Variables Typedefs Pages
ntru.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 PUBLIC_NTRU_NTRU_H_
31 #define PUBLIC_NTRU_NTRU_H_
32 
33 
34 #include <fmpz_poly.h>
35 #include <fmpz.h>
36 #include <stdint.h>
37 
38 
39 typedef struct ntru_params ntru_params;
40 typedef struct string string;
41 
42 
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;
79 };
80 
81 
87 void
88 prints(const string *print_string);
89 
98 void
99 string_delete(string *del_string);
100 
112 void
113 poly_new(fmpz_poly_t new_poly,
114  int const * const c,
115  const size_t len);
116 
123 void
124 poly_delete(fmpz_poly_t poly);
125 
134 void
135 poly_delete_array(fmpz_poly_t **poly_array);
136 
145 void
146 poly_delete_all(fmpz_poly_t poly, ...);
147 
153 void
154 poly_draw(const fmpz_poly_t poly);
155 
162 void
163 poly_draw_pretty(const fmpz_poly_t poly);
164 
172 string *
173 read_file(char const * const filename);
174 
182 void
183 write_file(string const *wstring, char const * const filename);
184 
185 
186 #endif /* NTRU_NTRU_H_ */
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)