aboutsummaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/def_powm.cpp22
-rw-r--r--src/core/info.txt6
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