monotone

monotone Mtn Source Tree

Root/botan/def_powm.cpp

1/*************************************************
2* Modular Exponentiation Source File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#include <botan/eng_def.h>
7#include <botan/def_powm.h>
8
9namespace Botan {
10
11/*************************************************
12* Choose a modular exponentation algorithm *
13*************************************************/
14Modular_Exponentiator*
15Default_Engine::mod_exp(const BigInt& n, Power_Mod::Usage_Hints hints) const
16 {
17 if(n.is_odd())
18 return new Montgomery_Exponentiator(n, hints);
19 return new Fixed_Window_Exponentiator(n, hints);
20 }
21
22}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status