modexppc.h
#ifndef CRYPTOPP_MODEXPPC_H
#define CRYPTOPP_MODEXPPC_H
#include "modarith.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:11
pubkey.h
This file contains helper classes/functions for implementing public key algorithms.
BufferedTransformation
interface for buffered transformations
Definition: cryptlib.h:770
Integer
multiple precision integer and basic arithmetics
Definition: integer.h:26
ModExpPrecomputation
Definition: modexppc.h:13
AbstractGroup
Abstract Group.
Definition: algebra.h:19
Integer::DEREncode
void DEREncode(BufferedTransformation &bt) const
encode using Distinguished Encoding Rules, put result into a BufferedTransformation object ...
MontgomeryRepresentation
do modular arithmetics in Montgomery representation for increased speed
Definition: modarith.h:122
value_ptr< MontgomeryRepresentation >
DL_FixedBasePrecomputationImpl
Definition: eprecomp.h:41