Line | |
---|
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 | |
---|
16 | class ModExpPrecomputation : public DL_GroupPrecomputation<Integer> |
---|
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: |
---|
32 | value_ptr<MontgomeryRepresentation> m_mr; |
---|
33 | }; |
---|
34 | |
---|
35 | NAMESPACE_END |
---|
36 | |
---|
37 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.