aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/def_powm.cpp
blob: a28438f5b122ddf8cc92ce0ca12338c7d014ac57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
   }

}