diff options
author | lloyd <[email protected]> | 2010-03-09 01:29:12 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-09 01:29:12 +0000 |
commit | 56a19fb01f3b0651359f059b51eef26e408015b4 (patch) | |
tree | 6d7e100abf4792159227d88808e71e0803449a98 /src/math/numbertheory/pow_mod.h | |
parent | b98f0aa4ac768fb045e439915a8115434e5a91de (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.h | 7 |
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; |