post quantum cryptography
Highly optimized implementation of the NTRUEncrypt algorithm
 All Data Structures Files Functions Variables Typedefs Pages
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 
31 #ifndef PUBLIC_NTRU_KEYPAIR_H_
32 #define PUBLIC_NTRU_KEYPAIR_H_
33 
34 #include "ntru.h"
35 
36 #include <fmpz_poly.h>
37 #include <fmpz.h>
38 #include <stdbool.h>
39 #include <stdint.h>
40 
41 
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;
65 };
66 
67 
78 bool
80  fmpz_poly_t f,
81  fmpz_poly_t g,
82  keypair *pair,
83  ntru_params *params);
84 
92 void
93 export_public_key(char const * const filename,
94  fmpz_poly_t pub,
95  ntru_params *params);
96 
104 void
105 export_priv_key(char const * const filename,
106  fmpz_poly_t priv,
107  ntru_params *params);
108 
115 void
116 import_public_key(char const * const filename,
117  fmpz_poly_t pub,
118  ntru_params *params);
119 
129 void
130 import_priv_key(char const * const filename,
131  fmpz_poly_t priv,
132  fmpz_poly_t priv_inv,
133  ntru_params *params);
134 
142 void
144 
145 
146 #endif /* PUBLIC_NTRU_KEYPAIR_H_ */
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)
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)