2 * Copyright (C) 2014 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * Copyright (C) 2009-2013 Security Innovation
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 #include "ntru_param_set.h"
20 ENUM(ntru_param_set_id_names
, NTRU_EES401EP1
, NTRU_EES743EP1
,
40 * NTRU encryption parameter set definitions
42 static ntru_param_set_t ntru_param_sets
[] = {
44 /* X9.98/IEEE 1363.1 parameter sets for best bandwidth (smallest size) */
46 NTRU_EES401EP1
, /* parameter-set id */
47 {0x00, 0x02, 0x04}, /* OID */
49 9, /* no. of bits in N (i.e., in an index) */
51 14, /* security strength in octets */
53 11, /* no. of bits in q (i.e., in a coeff) */
54 FALSE
, /* product form */
57 60, /* maxMsgLenBytes */
64 NTRU_EES449EP1
, /* parameter-set id */
65 {0x00, 0x03, 0x03}, /* OID */
67 9, /* no. of bits in N (i.e., in an index) */
69 16, /* security strength in octets */
71 11, /* no. of bits in q (i.e., in a coeff) */
72 FALSE
, /* product form */
75 67, /* maxMsgLenBytes */
82 NTRU_EES677EP1
, /* parameter-set id */
83 {0x00, 0x05, 0x03}, /* OID */
85 10, /* no. of bits in N (i.e., in an index) */
87 24, /* security strength in octets */
89 11, /* no. of bits in q (i.e., in a coeff) */
90 FALSE
, /* product form */
93 101, /* maxMsgLenBytes */
100 NTRU_EES1087EP2
, /* parameter-set id */
101 {0x00, 0x06, 0x03}, /* OID */
103 11, /* no. of bits in N (i.e., in an index) */
105 32, /* security strength in octets */
107 11, /* no. of bits in q (i.e., in a coeff) */
108 FALSE
, /* product form */
111 170, /* maxMsgLenBytes */
117 /* X9.98/IEEE 1363.1 parameter sets balancing speed and bandwidth */
119 NTRU_EES541EP1
, /* parameter-set id */
120 {0x00, 0x02, 0x05}, /* OID */
122 10, /* no. of bits in N (i.e., in an index) */
124 14, /* security strength in octets */
126 11, /* no. of bits in q (i.e., in a coeff) */
127 FALSE
, /* product form */
130 86, /* maxMsgLenBytes */
137 NTRU_EES613EP1
, /* parameter-set id */
138 {0x00, 0x03, 0x04}, /* OID */
140 10, /* no. of bits in N (i.e., in an index) */
142 16, /* securuity strength in octets */
144 11, /* no. of bits in q (i.e., in a coeff) */
145 FALSE
, /* product form */
148 97, /* maxMsgLenBytes */
155 NTRU_EES887EP1
, /* parameter-set id */
156 {0x00, 0x05, 0x04}, /* OID */
158 10, /* no. of bits in N (i.e., in an index) */
160 24, /* security strength in octets */
162 11, /* no. of bits in q (i.e., in a coeff) */
163 FALSE
, /* product form */
166 141, /* maxMsgLenBytes */
173 NTRU_EES1171EP1
, /* parameter-set id */
174 {0x00, 0x06, 0x04}, /* OID */
176 11, /* no. of bits in N (i.e., in an index) */
178 32, /* security strength in octets */
180 11, /* no. of bits in q (i.e., in a coeff) */
181 FALSE
, /* product form */
184 186, /* maxMsgLenBytes */
190 /* X9.98/IEEE 1363.1 parameter sets for best speed */
192 NTRU_EES659EP1
, /* parameter-set id */
193 {0x00, 0x02, 0x06}, /* OID */
195 10, /* no. of bits in N (i.e., in an index) */
197 14, /* security strength in octets */
199 11, /* no. of bits in q (i.e., in a coeff) */
200 FALSE
, /* product form */
203 108, /* maxMsgLenBytes */
210 NTRU_EES761EP1
, /* parameter-set id */
211 {0x00, 0x03, 0x05}, /* OID */
213 10, /* no. of bits in N (i.e., in an index) */
215 16, /* security strength in octets */
217 11, /* no. of bits in q (i.e., in a coeff) */
218 FALSE
, /* product form */
221 125, /* maxMsgLenBytes */
228 NTRU_EES1087EP1
, /* parameter-set id */
229 {0x00, 0x05, 0x05}, /* OID */
231 11, /* no. of bits in N (i.e., in an index) */
233 24, /* security strength in octets */
235 11, /* no. of bits in q (i.e., in a coeff) */
236 FALSE
, /* product form */
239 178, /* maxMsgLenBytes */
246 NTRU_EES1499EP1
, /* parameter-set id */
247 {0x00, 0x06, 0x05}, /* OID */
249 11, /* no. of bits in N (i.e., in an index) */
251 32, /* security strength in octets */
253 11, /* no. of bits in q (i.e., in a coeff) */
254 FALSE
, /* product form */
257 247, /* maxMsgLenBytes */
263 /* Best bandwidth and speed, no X9.98 compatibility */
265 NTRU_EES401EP2
, /* parameter-set id */
266 {0x00, 0x02, 0x10}, /* OID */
268 9, /* no. of bits in N (i.e., in an index) */
270 14, /* security strength in octets */
272 11, /* no. of bits in q (i.e., in a coeff) */
273 TRUE
, /* product form */
274 8 + (8 << 8) + (6 << 16), /* df, dr */
276 60, /* maxMsgLenBytes */
283 NTRU_EES439EP1
, /* parameter-set id */
284 {0x00, 0x03, 0x10}, /* OID */
286 9, /* no. of bits in N (i.e., in an index) */
288 16, /* security strength in octets */
290 11, /* no. of bits in q (i.e., in a coeff) */
291 TRUE
, /* product form */
292 9 + (8 << 8) + (5 << 16), /* df, dr */
294 65, /* maxMsgLenBytes */
301 NTRU_EES593EP1
, /* parameter-set id */
302 {0x00, 0x05, 0x10}, /* OID */
304 10, /* no. of bits in N (i.e., in an index) */
306 24, /* security strength in octets */
308 11, /* no. of bits in q (i.e., in a coeff) */
309 TRUE
, /* product form */
310 10 + (10 << 8) + (8 << 16), /* df, dr */
312 86, /* maxMsgLenBytes */
319 NTRU_EES743EP1
, /* parameter-set id */
320 {0x00, 0x06, 0x10}, /* OID */
322 10, /* no. of bits in N (i.e., in an index) */
324 32, /* security strength in octets */
326 11, /* no. of bits in q (i.e., in a coeff) */
327 TRUE
, /* product form */
328 11 + (11 << 8) + (15 << 16), /* df, dr */
330 106, /* maxMsgLenBytes */
341 ntru_param_set_t
* ntru_param_set_get_by_id(ntru_param_set_id_t id
)
345 for (i
= 0; i
< countof(ntru_param_sets
); i
++)
347 if (ntru_param_sets
[i
].id
== id
)
349 return &ntru_param_sets
[i
];
359 ntru_param_set_t
* ntru_param_set_get_by_oid(uint8_t const *oid
)
363 for (i
= 0; i
< countof(ntru_param_sets
); i
++)
365 if (memeq(ntru_param_sets
[i
].oid
, oid
, 3))
367 return &ntru_param_sets
[i
];