Botan 1.10.17
def_powm.cpp
Go to the documentation of this file.
1/*
2* Modular Exponentiation
3* (C) 1999-2007 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#include <botan/internal/core_engine.h>
9#include <botan/internal/def_powm.h>
10
11namespace Botan {
12
13/*
14* Choose a modular exponentation algorithm
15*/
18 {
19 if(n.is_odd())
20 return new Montgomery_Exponentiator(n, hints);
21 return new Fixed_Window_Exponentiator(n, hints);
22 }
23
24}
bool is_odd() const
Definition bigint.h:164
Modular_Exponentiator * mod_exp(const BigInt &n, Power_Mod::Usage_Hints) const
Definition def_powm.cpp:17
Fixed_Window_Exponentiator(const BigInt &, Power_Mod::Usage_Hints)
Definition powm_fw.cpp:61
Montgomery_Exponentiator(const BigInt &, Power_Mod::Usage_Hints)
Definition powm_mnt.cpp:130