Imported Upstream version 2.7.1
[platform/upstream/nettle.git] / ecc-224.c
1 /* ecc-224.c.c */
2
3 /* Compile time constant (but machine dependent) tables. */
4
5 /* nettle, low-level cryptographics library
6  *
7  * Copyright (C) 2013 Niels Möller
8  *  
9  * The nettle library is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or (at your
12  * option) any later version.
13  * 
14  * The nettle library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
17  * License for more details.
18  * 
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with the nettle library; see the file COPYING.LIB.  If not, write to
21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22  * MA 02111-1301, USA.
23  */
24
25 /* Development of Nettle's ECC support was funded by the .SE Internet Fund. */
26
27 #if HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include "ecc-internal.h"
32
33 #if HAVE_NATIVE_ecc_224_modp
34
35 #define USE_REDC 0
36 #define ecc_224_modp nettle_ecc_224_modp
37 void
38 ecc_224_modp (const struct ecc_curve *ecc, mp_limb_t *rp);
39
40 #else
41 #define USE_REDC (ECC_REDC_SIZE != 0)
42 #define ecc_224_modp ecc_generic_modp
43 #endif
44
45 #include "ecc-224.h"
46
47 const struct ecc_curve nettle_secp_224r1 =
48 {
49   224,
50   ECC_LIMB_SIZE,    
51   ECC_BMODP_SIZE,
52   ECC_BMODQ_SIZE,
53   USE_REDC,
54   ECC_REDC_SIZE,
55   ECC_PIPPENGER_K,
56   ECC_PIPPENGER_C,
57   ecc_p,
58   ecc_b,
59   ecc_q,
60   ecc_g,
61   ecc_redc_g,
62   ecc_224_modp,
63   ecc_generic_redc,
64   USE_REDC ? ecc_generic_redc : ecc_224_modp,
65   ecc_generic_modq,
66   ecc_Bmodp,
67   ecc_Bmodp_shifted,
68   ecc_pp1h,
69   ecc_redc_ppm1,
70   ecc_unit,
71   ecc_Bmodq,
72   ecc_Bmodq_shifted,
73   ecc_qp1h,
74   ecc_table
75 };