aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/openssl/bn_powm.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-09 19:49:23 +0000
committerlloyd <[email protected]>2008-11-09 19:49:23 +0000
commitcec305c17354fca9c426d76a78f7088f60607afb (patch)
tree1bf7b53a76617339d67523d34be34f903ced28fc /src/engine/openssl/bn_powm.cpp
parentb01c1d79f02de8ca5c02f08e73cedeadc4d0753a (diff)
Move engine to libstate/ directory, since there is a mutual dependency
(messy). Remove unused libstate.h includes from a few files.
Diffstat (limited to 'src/engine/openssl/bn_powm.cpp')
-rw-r--r--src/engine/openssl/bn_powm.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/engine/openssl/bn_powm.cpp b/src/engine/openssl/bn_powm.cpp
deleted file mode 100644
index f54411240..000000000
--- a/src/engine/openssl/bn_powm.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************
-* OpenSSL Modular Exponentiation Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
-
-#include <botan/eng_ossl.h>
-#include <botan/bn_wrap.h>
-
-namespace Botan {
-
-namespace {
-
-/*************************************************
-* OpenSSL Modular Exponentiator *
-*************************************************/
-class OpenSSL_Modular_Exponentiator : public Modular_Exponentiator
- {
- public:
- void set_base(const BigInt& b) { base = b; }
- void set_exponent(const BigInt& e) { exp = e; }
- BigInt execute() const;
- Modular_Exponentiator* copy() const
- { return new OpenSSL_Modular_Exponentiator(*this); }
-
- OpenSSL_Modular_Exponentiator(const BigInt& n) : mod(n) {}
- private:
- OSSL_BN base, exp, mod;
- OSSL_BN_CTX ctx;
- };
-
-/*************************************************
-* Compute the result *
-*************************************************/
-BigInt OpenSSL_Modular_Exponentiator::execute() const
- {
- OSSL_BN r;
- BN_mod_exp(r.value, base.value, exp.value, mod.value, ctx.value);
- return r.to_bigint();
- }
-
-}
-
-/*************************************************
-* Return the OpenSSL-based modular exponentiator *
-*************************************************/
-Modular_Exponentiator* OpenSSL_Engine::mod_exp(const BigInt& n,
- Power_Mod::Usage_Hints) const
- {
- return new OpenSSL_Modular_Exponentiator(n);
- }
-
-}