Crypto++  5.6.4
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 "algebra.h"
8 #include "eprecomp.h"
9 #include "smartptr.h"
10 #include "pubkey.h"
11 
12 NAMESPACE_BEGIN(CryptoPP)
13 
14 CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl<Integer>;
15 
17 {
18 public:
19  // DL_GroupPrecomputation
20  bool NeedConversions() const {return true;}
21  Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);}
22  virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);}
23  const AbstractGroup<Element> & GetGroup() const {return m_mr->MultiplicativeGroup();}
24  Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);}
25  void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);}
26 
27  // non-inherited
28  void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));}
29  const Integer & GetModulus() const {return m_mr->GetModulus();}
30 
31 private:
33 };
34 
35 NAMESPACE_END
36 
37 #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.
Classes for performing mathematics over different fields.
Interface for buffered transformations.
Definition: cryptlib.h:1359
Multiple precision integer with arithmetic operations.
Definition: integer.h:45
Abstract group.
Definition: algebra.h:26
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
Definition: integer.cpp:3363
Classes for precomputation in a group.
Performs modular arithmetic in Montgomery representation for increased speed.
Definition: modarith.h:274
Multiple precision integer with arithmetic operations.
Class file for performing modular arithmetic.
Crypto++ library namespace.