post quantum cryptography
Highly optimized implementation of the NTRUEncrypt algorithm
|
00001 /* 00002 * Copyright (C) 2014 FH Bielefeld 00003 * 00004 * This file is part of a FH Bielefeld project. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00019 * MA 02110-1301 USA 00020 */ 00021 00030 #ifndef PUBLIC_NTRU_NTRU_H_ 00031 #define PUBLIC_NTRU_NTRU_H_ 00032 00033 00034 #include <fmpz_poly.h> 00035 #include <fmpz.h> 00036 #include <stdint.h> 00037 00038 00039 typedef struct ntru_params ntru_params; 00040 typedef struct string string; 00041 00042 00047 struct ntru_params { 00052 uint32_t N; 00056 uint32_t q; 00060 uint32_t p; 00061 }; 00062 00066 struct string { 00074 char *ptr; 00078 size_t len; 00079 }; 00080 00081 00087 void 00088 prints(const string *print_string); 00089 00098 void 00099 string_delete(string *del_string); 00100 00114 void 00115 poly_new(fmpz_poly_t new_poly, 00116 int const * const c, 00117 const size_t len); 00118 00125 void 00126 poly_delete(fmpz_poly_t poly); 00127 00136 void 00137 poly_delete_array(fmpz_poly_t **poly_array); 00138 00147 void 00148 poly_delete_all(fmpz_poly_t poly, ...); 00149 00155 void 00156 poly_draw(const fmpz_poly_t poly); 00157 00164 void 00165 poly_draw_pretty(const fmpz_poly_t poly); 00166 00174 string * 00175 read_file(char const * const filename); 00176 00184 void 00185 write_file(string const *wstring, char const * const filename); 00186 00187 00188 #endif /* NTRU_NTRU_H_ */