Fix LLVM compilation issues
[novacoin.git] / src / zerocoin / AccumulatorProofOfKnowledge.h
1 /**
2  * @file       AccumulatorProofOfKnowledge.h
3  *
4  * @brief      AccumulatorProofOfKnowledge class for the Zerocoin library.
5  *
6  * @author     Ian Miers, Christina Garman and Matthew Green
7  * @date       June 2013
8  *
9  * @copyright  Copyright 2013 Ian Miers, Christina Garman and Matthew Green
10  * @license    This project is released under the MIT license.
11  **/
12
13 #ifndef ACCUMULATEPROOF_H_
14 #define ACCUMULATEPROOF_H_
15
16 namespace libzerocoin {
17
18 /**A prove that a value insde the commitment commitmentToCoin is in an accumulator a.
19  *
20  */
21 class AccumulatorProofOfKnowledge {
22 public:
23         AccumulatorProofOfKnowledge(const AccumulatorAndProofParams* p);
24
25         /** Generates a proof that a commitment to a coin c was accumulated
26          * @param p  Cryptographic parameters
27          * @param commitmentToCoin commitment containing the coin we want to prove is accumulated
28          * @param witness The witness to the accumulation of the coin
29          * @param a
30          */
31         AccumulatorProofOfKnowledge(const AccumulatorAndProofParams* p, const Commitment& commitmentToCoin, const AccumulatorWitness& witness, Accumulator& a);
32         /** Verifies that  a commitment c is accumulated in accumulated a
33          */
34         bool Verify(const Accumulator& a,const Bignum& valueOfCommitmentToCoin) const;
35
36         IMPLEMENT_SERIALIZE
37         (
38             READWRITE(C_e);
39             READWRITE(C_u);
40             READWRITE(C_r);
41             READWRITE(st_1);
42             READWRITE(st_2);
43             READWRITE(st_3);
44             READWRITE(t_1);
45             READWRITE(t_2);
46             READWRITE(t_3);
47             READWRITE(t_4);
48             READWRITE(s_alpha);
49             READWRITE(s_beta);
50             READWRITE(s_zeta);
51             READWRITE(s_sigma);
52             READWRITE(s_eta);
53             READWRITE(s_epsilon);
54             READWRITE(s_delta);
55             READWRITE(s_xi);
56             READWRITE(s_phi);
57             READWRITE(s_gamma);
58             READWRITE(s_psi);
59         )
60 private:
61         const AccumulatorAndProofParams* params;
62
63         /* Return values for proof */
64         Bignum C_e;
65         Bignum C_u;
66         Bignum C_r;
67
68         Bignum st_1;
69         Bignum st_2;
70         Bignum st_3;
71
72         Bignum t_1;
73         Bignum t_2;
74         Bignum t_3;
75         Bignum t_4;
76
77         Bignum s_alpha;
78         Bignum s_beta;
79         Bignum s_zeta;
80         Bignum s_sigma;
81         Bignum s_eta;
82         Bignum s_epsilon;
83         Bignum s_delta;
84         Bignum s_xi;
85         Bignum s_phi;
86         Bignum s_gamma;
87         Bignum s_psi;
88 };
89
90 } /* namespace libzerocoin */
91 #endif /* ACCUMULATEPROOF_H_ */