Crypto++  5.6.3
Free C++ class library of cryptographic schemes
modexppc.h
1 #ifndef CRYPTOPP_MODEXPPC_H
2 #define CRYPTOPP_MODEXPPC_H
3 
4 #include "cryptlib.h"
5 #include "modarith.h"
6 #include "integer.h"
7 #include "eprecomp.h"
8 #include "smartptr.h"
9 #include "pubkey.h"
10 
11 NAMESPACE_BEGIN(CryptoPP)
12 
13 CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl<Integer>;
14 
16 {
17 public:
18  // DL_GroupPrecomputation
19  bool NeedConversions() const {return true;}
20  Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);}
21  virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);}
22  const AbstractGroup<Element> & GetGroup() const {return m_mr->MultiplicativeGroup();}
23  Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);}
24  void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);}
25 
26  // non-inherited
27  void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));}
28  const Integer & GetModulus() const {return m_mr->GetModulus();}
29 
30 private:
32 };
33 
34 NAMESPACE_END
35 
36 #endif
This file contains helper classes/functions for implementing public key algorithms.
Abstract base classes that provide a uniform interface to this library.
Classes for automatic resource management.
Interface for buffered transformations.
Definition: cryptlib.h:1247
Multiple precision integer with arithmetic operations.
Definition: integer.h:31
Abstract Group.
Definition: algebra.h:27
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
Definition: integer.cpp:3201
Classes for precomputation in a group.
Performs modular arithmetic in Montgomery representation for increased speed.
Definition: modarith.h:137
Class file for performing modular arithmetic.
Crypto++ library namespace.