aboutsummaryrefslogtreecommitdiffstats
path: root/include/reducer.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/reducer.h
Initial checkin1.5.6
Diffstat (limited to 'include/reducer.h')
-rw-r--r--include/reducer.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/reducer.h b/include/reducer.h
new file mode 100644
index 000000000..537254bb7
--- /dev/null
+++ b/include/reducer.h
@@ -0,0 +1,34 @@
+/*************************************************
+* Modular Reducer Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_MODARITH_H__
+#define BOTAN_MODARITH_H__
+
+#include <botan/bigint.h>
+
+namespace Botan {
+
+/*************************************************
+* Modular Reducer *
+*************************************************/
+class Modular_Reducer
+ {
+ public:
+ BigInt multiply(const BigInt&, const BigInt&) const;
+ BigInt square(const BigInt&) const;
+ BigInt reduce(const BigInt&) const;
+
+ bool initialized() const { return (mod_words != 0); }
+
+ Modular_Reducer() { mod_words = 0; }
+ Modular_Reducer(const BigInt&);
+ private:
+ BigInt modulus, modulus_2, mu;
+ u32bit mod_words, mod2_words, mu_words;
+ };
+
+}
+
+#endif