diff options
author | lloyd <[email protected]> | 2008-09-29 18:12:16 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-29 18:12:16 +0000 |
commit | 0d8e9744ef02aba33ddd89c93194ce526f6ff6ee (patch) | |
tree | e60064db23397f9a9dc3b847f9c4199be7c7ca0d /src/core | |
parent | 26abd45c61294aacdd59fa4763ff1cd78aefbc7c (diff) |
Put only the implementation of BigInt in src/bigint, mathematical functions
on top of BigInt go to src/math. Some prototypes were moved in order to
complete the split, in particular random_integer() is now a static member
of BigInt instead of being a global function, and divide() is in divide.h
instead of numthry.h
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/def_powm.cpp | 22 | ||||
-rw-r--r-- | src/core/info.txt | 6 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/core/def_powm.cpp b/src/core/def_powm.cpp new file mode 100644 index 000000000..a28438f5b --- /dev/null +++ b/src/core/def_powm.cpp @@ -0,0 +1,22 @@ +/************************************************* +* Modular Exponentiation Source File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#include <botan/eng_def.h> +#include <botan/def_powm.h> + +namespace Botan { + +/************************************************* +* Choose a modular exponentation algorithm * +*************************************************/ +Modular_Exponentiator* +Default_Engine::mod_exp(const BigInt& n, Power_Mod::Usage_Hints hints) const + { + if(n.is_odd()) + return new Montgomery_Exponentiator(n, hints); + return new Fixed_Window_Exponentiator(n, hints); + } + +} diff --git a/src/core/info.txt b/src/core/info.txt index df98e51ab..802f5bcef 100644 --- a/src/core/info.txt +++ b/src/core/info.txt @@ -6,8 +6,11 @@ define CORE_MODULE <requires> aes -bigint sha1 +sha2 +hmac +bigint +math allocators filters pubkey @@ -19,6 +22,7 @@ data_src.cpp datastor.cpp def_alg.cpp def_mode.cpp +def_powm.cpp eng_base.cpp engine.cpp exceptn.cpp |