aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/pow_mod.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-09 01:29:12 +0000
committerlloyd <[email protected]>2010-03-09 01:29:12 +0000
commit56a19fb01f3b0651359f059b51eef26e408015b4 (patch)
tree6d7e100abf4792159227d88808e71e0803449a98 /src/math/numbertheory/pow_mod.h
parentb98f0aa4ac768fb045e439915a8115434e5a91de (diff)
Consolidate code for choosing a window size for fixed width window
exponentiation algorithms.
Diffstat (limited to 'src/math/numbertheory/pow_mod.h')
-rw-r--r--src/math/numbertheory/pow_mod.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/math/numbertheory/pow_mod.h b/src/math/numbertheory/pow_mod.h
index 6952dcd1b..7b92f0ec4 100644
--- a/src/math/numbertheory/pow_mod.h
+++ b/src/math/numbertheory/pow_mod.h
@@ -31,6 +31,7 @@ class BOTAN_DLL Modular_Exponentiator
class BOTAN_DLL Power_Mod
{
public:
+
enum Usage_Hints {
NO_HINTS = 0x0000,
@@ -44,6 +45,12 @@ class BOTAN_DLL Power_Mod
EXP_IS_LARGE = 0x0400
};
+ /*
+ * Try to choose a good window size
+ */
+ static u32bit window_bits(u32bit exp_bits, u32bit base_bits,
+ Power_Mod::Usage_Hints hints);
+
void set_modulus(const BigInt&, Usage_Hints = NO_HINTS) const;
void set_base(const BigInt&) const;
void set_exponent(const BigInt&) const;