diff options
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); + } + +} |