@@ -33,7 +33,6 @@ namespace libzerocoin
3333class AccumulatorProofOfKnowledge {
3434public:
3535 AccumulatorProofOfKnowledge () {};
36- AccumulatorProofOfKnowledge (const AccumulatorAndProofParams* p): params(p) {};
3736 ADD_SERIALIZE_METHODS;
3837 template <typename Stream, typename Operation>
3938 inline void SerializationOp (Stream& s, Operation ser_action, int nType, int nVersion)
@@ -44,7 +43,6 @@ class AccumulatorProofOfKnowledge {
4443 READWRITE (s_delta); READWRITE (s_xi); READWRITE (s_phi); READWRITE (s_gamma); READWRITE (s_psi);
4544 }
4645private:
47- const AccumulatorAndProofParams* params;
4846 CBigNum C_e, C_u, C_r;
4947 CBigNum st_1, st_2, st_3;
5048 CBigNum t_1, t_2, t_3, t_4;
@@ -58,7 +56,6 @@ class AccumulatorProofOfKnowledge {
5856class SerialNumberSignatureOfKnowledge {
5957public:
6058 SerialNumberSignatureOfKnowledge (){};
61- SerialNumberSignatureOfKnowledge (const ZerocoinParams* p): params(p) {}
6259 ADD_SERIALIZE_METHODS;
6360 template <typename Stream, typename Operation>
6461 inline void SerializationOp (Stream& s, Operation ser_action, int nType, int nVersion)
@@ -68,7 +65,6 @@ class SerialNumberSignatureOfKnowledge {
6865 READWRITE (hash);
6966 }
7067private:
71- const ZerocoinParams* params;
7268 uint256 hash;
7369 std::vector<CBigNum> s_notprime;
7470 std::vector<CBigNum> sprime;
@@ -79,23 +75,13 @@ class SerialNumberSignatureOfKnowledge {
7975class CommitmentProofOfKnowledge {
8076public:
8177 CommitmentProofOfKnowledge () {};
82- CommitmentProofOfKnowledge (const IntegerGroupParams* ap, const IntegerGroupParams* bp): ap(ap), bp(bp) {};
83- template <typename Stream>
84- CommitmentProofOfKnowledge (const IntegerGroupParams* aParams, const IntegerGroupParams* bParams, Stream& strm):
85- ap (aParams),
86- bp (bParams)
87- {
88- strm >> *this ;
89- }
90-
9178 ADD_SERIALIZE_METHODS;
9279 template <typename Stream, typename Operation>
9380 inline void SerializationOp (Stream& s, Operation ser_action, int nType, int nVersion)
9481 {
9582 READWRITE (S1); READWRITE (S2); READWRITE (S3); READWRITE (challenge);
9683 }
9784private:
98- const IntegerGroupParams *ap, *bp;
9985 CBigNum S1, S2, S3, challenge;
10086};
10187
@@ -109,31 +95,10 @@ class CoinSpend
10995{
11096public:
11197
112- CoinSpend (){};
113-
114- // ! \param paramsV1 - if this is a V1 zerocoin, then use params that existed with initial modulus, ignored otherwise
115- // ! \param paramsV2 - params that begin when V2 zerocoins begin on the PIVX network
116- // ! \param strm - a serialized CoinSpend
117- template <typename Stream>
118- CoinSpend (const ZerocoinParams* paramsV1, const ZerocoinParams* paramsV2, Stream& strm) :
119- accumulatorPoK (¶msV2->accumulatorParams),
120- serialNumberSoK (paramsV1),
121- commitmentPoK (¶msV1->serialNumberSoKCommitmentGroup, ¶msV2->accumulatorParams.accumulatorPoKCommitmentGroup)
122-
123- {
124- Stream strmCopy = strm;
125- strm >> *this ;
126-
127- // Need to reset some parameters if v2
128- if (getCoinVersion () >= PrivateCoin::PUBKEY_VERSION) {
129- accumulatorPoK = AccumulatorProofOfKnowledge (¶msV2->accumulatorParams );
130- serialNumberSoK = SerialNumberSignatureOfKnowledge (paramsV2);
131- commitmentPoK = CommitmentProofOfKnowledge (¶msV2->serialNumberSoKCommitmentGroup , ¶msV2->accumulatorParams .accumulatorPoKCommitmentGroup );
132- strmCopy >> *this ;
133- }
134- }
135-
98+ CoinSpend () {};
99+ CoinSpend (CDataStream& strm) { strm >> *this ; }
136100 virtual ~CoinSpend (){};
101+
137102 const CBigNum& getCoinSerialNumber () const { return this ->coinSerialNumber ; }
138103 CoinDenomination getDenomination () const { return this ->denomination ; }
139104 uint32_t getAccumulatorChecksum () const { return this ->accChecksum ; }
0 commit comments