diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /src/def_powm.cpp |
Initial checkin1.5.6
Diffstat (limited to 'src/def_powm.cpp')
-rw-r--r-- | src/def_powm.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/def_powm.cpp b/src/def_powm.cpp new file mode 100644 index 000000000..62014e41c --- /dev/null +++ b/src/def_powm.cpp @@ -0,0 +1,22 @@ +/************************************************* +* Modular Exponentiation Source File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#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); + } + +} |