Botan  2.6.0
Crypto and TLS for C++11
curve_nistp.h
Go to the documentation of this file.
1 /*
2 * Arithmetic operations specialized for NIST ECC primes
3 * (C) 2014,2015 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_NIST_PRIMES_H_
9 #define BOTAN_NIST_PRIMES_H_
10 
11 #include <botan/bigint.h>
12 
13 namespace Botan {
14 
15 /**
16 * NIST Prime reduction functions.
17 *
18 * Reduces the value in place
19 *
20 * ws is a workspace function which is used as a temporary,
21 * and will be resized as needed.
22 */
23 BOTAN_PUBLIC_API(2,0) const BigInt& prime_p521();
24 BOTAN_PUBLIC_API(2,0) void redc_p521(BigInt& x, secure_vector<word>& ws);
25 
26 #if (BOTAN_MP_WORD_BITS == 32) || (BOTAN_MP_WORD_BITS == 64)
27 
28 #define BOTAN_HAS_NIST_PRIME_REDUCERS_W32
29 
30 BOTAN_PUBLIC_API(2,0) const BigInt& prime_p384();
31 BOTAN_PUBLIC_API(2,0) void redc_p384(BigInt& x, secure_vector<word>& ws);
32 
33 BOTAN_PUBLIC_API(2,0) const BigInt& prime_p256();
34 BOTAN_PUBLIC_API(2,0) void redc_p256(BigInt& x, secure_vector<word>& ws);
35 
36 BOTAN_PUBLIC_API(2,0) const BigInt& prime_p224();
37 BOTAN_PUBLIC_API(2,0) void redc_p224(BigInt& x, secure_vector<word>& ws);
38 
39 BOTAN_PUBLIC_API(2,0) const BigInt& prime_p192();
40 BOTAN_PUBLIC_API(2,0) void redc_p192(BigInt& x, secure_vector<word>& ws);
41 
42 #endif
43 
44 }
45 
46 #endif
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
Definition: alg_id.cpp:13
void redc_p521(BigInt &x, secure_vector< word > &ws)
Definition: nistp_redc.cpp:22
const BigInt & prime_p521()
Definition: nistp_redc.cpp:14
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88