monotone

monotone Mtn Source Tree

Root/botan/reducer.h

1/*************************************************
2* Modular Reducer Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_MODARITH_H__
7#define BOTAN_MODARITH_H__
8
9#include <botan/bigint.h>
10
11namespace Botan {
12
13/*************************************************
14* Modular Reducer *
15*************************************************/
16class Modular_Reducer
17 {
18 public:
19 BigInt multiply(const BigInt&, const BigInt&) const;
20 BigInt square(const BigInt&) const;
21 BigInt reduce(const BigInt&) const;
22
23 bool initialized() const { return (mod_words != 0); }
24
25 Modular_Reducer() { mod_words = 0; }
26 Modular_Reducer(const BigInt&);
27 private:
28 BigInt modulus, modulus_2, mu;
29 u32bit mod_words, mod2_words, mu_words;
30 };
31
32}
33
34#endif

Archive Download this file

Branches

Tags

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