diff options
author | lloyd <[email protected]> | 2008-11-08 20:58:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-08 20:58:33 +0000 |
commit | bee2ca1cd5c59318d95d9363d82632aee253b913 (patch) | |
tree | 125a31fdccf62cf6a0fef72509384f4223f35374 /src/engine/def_engine/def_powm.cpp | |
parent | de0e6d06a2efa362f9803be6ca5a3535c043ebc8 (diff) |
Move most of the Default_Engine code into engine/def_engine, and the
engine base classes into src/engine
Diffstat (limited to 'src/engine/def_engine/def_powm.cpp')
-rw-r--r-- | src/engine/def_engine/def_powm.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/engine/def_engine/def_powm.cpp b/src/engine/def_engine/def_powm.cpp new file mode 100644 index 000000000..a28438f5b --- /dev/null +++ b/src/engine/def_engine/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); + } + +} |