modexppc.h
#ifndef CRYPTOPP_MODEXPPC_H
#define CRYPTOPP_MODEXPPC_H
#include "cryptlib.h"
#include "modarith.h"
#include "integer.h"
#include "algebra.h"
#include "eprecomp.h"
#include "smartptr.h"
#include "pubkey.h"
NAMESPACE_BEGIN(CryptoPP)
CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl<Integer>;
class ModExpPrecomputation : public DL_GroupPrecomputation<Integer>
{
public:
// DL_GroupPrecomputation
bool NeedConversions() const {return true;}
Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);}
virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);}
const AbstractGroup<Element> & GetGroup() const {return m_mr->MultiplicativeGroup();}
Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);}
void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);}
// non-inherited
void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));}
const Integer & GetModulus() const {return m_mr->GetModulus();}
private:
value_ptr<MontgomeryRepresentation> m_mr;
};
NAMESPACE_END
#endif
DL_GroupPrecomputation
Definition: eprecomp.h:17
Integer::DEREncode
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
Definition: integer.cpp:3372
pubkey.h
This file contains helper classes/functions for implementing public key algorithms.
cryptlib.h
Abstract base classes that provide a uniform interface to this library.
smartptr.h
Classes for automatic resource management.
algebra.h
Classes for performing mathematics over different fields.
BufferedTransformation
Interface for buffered transformations.
Definition: cryptlib.h:1352
Integer
Multiple precision integer with arithmetic operations.
Definition: integer.h:45
ModExpPrecomputation
Definition: modexppc.h:16
AbstractGroup
Abstract group.
Definition: algebra.h:26
eprecomp.h
Classes for precomputation in a group.
MontgomeryRepresentation
Performs modular arithmetic in Montgomery representation for increased speed.
Definition: modarith.h:274
value_ptr< MontgomeryRepresentation >
integer.h
Multiple precision integer with arithmetic operations.
modarith.h
Class file for performing modular arithmetic.
CryptoPP
Crypto++ library namespace.
DL_FixedBasePrecomputationImpl
Definition: eprecomp.h:55