diff options
author | Jack Lloyd <[email protected]> | 2018-02-25 18:56:20 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-25 18:56:20 -0500 |
commit | bccd06762895cd572a30858fd591753d4f769a4d (patch) | |
tree | 2875721c50212a19f932c07520858d0e2ea823c6 /src/lib/math/numbertheory/curve_nistp.h | |
parent | a3d712149cfe7fc8a2ce8885bd29264cff496639 (diff) |
Merge ec_gfp and ec_group modules
They were already somewhat entangled and future work will increase
that (eg by having PointGFp hold a pointer to EC_Group)
Diffstat (limited to 'src/lib/math/numbertheory/curve_nistp.h')
-rw-r--r-- | src/lib/math/numbertheory/curve_nistp.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/math/numbertheory/curve_nistp.h b/src/lib/math/numbertheory/curve_nistp.h new file mode 100644 index 000000000..c9936a338 --- /dev/null +++ b/src/lib/math/numbertheory/curve_nistp.h @@ -0,0 +1,46 @@ +/* +* Arithmetic operations specialized for NIST ECC primes +* (C) 2014,2015 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#ifndef BOTAN_NIST_PRIMES_H_ +#define BOTAN_NIST_PRIMES_H_ + +#include <botan/bigint.h> + +namespace Botan { + +/** +* NIST Prime reduction functions. +* +* Reduces the value in place +* +* ws is a workspace function which is used as a temporary, +* and will be resized as needed. +*/ +BOTAN_PUBLIC_API(2,0) const BigInt& prime_p521(); +BOTAN_PUBLIC_API(2,0) void redc_p521(BigInt& x, secure_vector<word>& ws); + +#if (BOTAN_MP_WORD_BITS == 32) || (BOTAN_MP_WORD_BITS == 64) + +#define BOTAN_HAS_NIST_PRIME_REDUCERS_W32 + +BOTAN_PUBLIC_API(2,0) const BigInt& prime_p384(); +BOTAN_PUBLIC_API(2,0) void redc_p384(BigInt& x, secure_vector<word>& ws); + +BOTAN_PUBLIC_API(2,0) const BigInt& prime_p256(); +BOTAN_PUBLIC_API(2,0) void redc_p256(BigInt& x, secure_vector<word>& ws); + +BOTAN_PUBLIC_API(2,0) const BigInt& prime_p224(); +BOTAN_PUBLIC_API(2,0) void redc_p224(BigInt& x, secure_vector<word>& ws); + +BOTAN_PUBLIC_API(2,0) const BigInt& prime_p192(); +BOTAN_PUBLIC_API(2,0) void redc_p192(BigInt& x, secure_vector<word>& ws); + +#endif + +} + +#endif |