Fabcoin Core  0.16.2
P2P Digital Currency
modexppc.h
Go to the documentation of this file.
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 
13 
15 
17 {
18 public:
19  virtual ~ModExpPrecomputation() {}
20 
21  // DL_GroupPrecomputation
22  bool NeedConversions() const {return true;}
23  Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);}
24  virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);}
25  const AbstractGroup<Element> & GetGroup() const {return m_mr->MultiplicativeGroup();}
26  Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);}
27  void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);}
28 
29  // non-inherited
30  void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));}
31  const Integer & GetModulus() const {return m_mr->GetModulus();}
32 
33 private:
35 };
36 
38 
39 #endif
void SetModulus(const Integer &v)
Definition: modexppc.h:30
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
#define CRYPTOPP_DLL_TEMPLATE_CLASS
Definition: config.h:720
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:1352
Element BERDecodeElement(BufferedTransformation &bt) const
Definition: modexppc.h:26
virtual Element ConvertOut(const Element &v) const
Definition: modexppc.h:24
bool NeedConversions() const
Definition: modexppc.h:22
Multiple precision integer with arithmetic operations.
Definition: integer.h:43
void DEREncodeElement(BufferedTransformation &bt, const Element &v) const
Definition: modexppc.h:27
virtual ~ModExpPrecomputation()
Definition: modexppc.h:19
Abstract group.
Definition: algebra.h:26
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
Definition: integer.cpp:3391
Classes for precomputation in a group.
Performs modular arithmetic in Montgomery representation for increased speed.
Definition: modarith.h:271
Element ConvertIn(const Element &v) const
Definition: modexppc.h:23
const Integer & GetModulus() const
Definition: modexppc.h:31
Multiple precision integer with arithmetic operations.
#define NAMESPACE_END
Definition: config.h:201
Class file for performing modular arithmetic.
value_ptr< MontgomeryRepresentation > m_mr
Definition: modexppc.h:34
const AbstractGroup< Element > & GetGroup() const
Definition: modexppc.h:25