4 * @brief Parameter class for Zerocoin.
6 * @author Ian Miers, Christina Garman and Matthew Green
9 * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
10 * @license This project is released under the MIT license.
14 namespace libzerocoin {
16 Params::Params(Bignum N, uint32_t securityLevel) {
17 this->zkp_hash_len = securityLevel;
18 this->zkp_iterations = securityLevel;
20 this->accumulatorParams.k_prime = ACCPROOF_KPRIME;
21 this->accumulatorParams.k_dprime = ACCPROOF_KDPRIME;
23 // Generate the parameters
24 CalculateParams(*this, N, ZEROCOIN_PROTOCOL_VERSION, securityLevel);
26 this->accumulatorParams.initialized = true;
27 this->initialized = true;
30 AccumulatorAndProofParams::AccumulatorAndProofParams() {
31 this->initialized = false;
34 IntegerGroupParams::IntegerGroupParams() {
35 this->initialized = false;
38 Bignum IntegerGroupParams::randomElement() const {
39 // The generator of the group raised
40 // to a random number less than the order of the group
41 // provides us with a uniformly distributed random number.
42 return this->g.pow_mod(Bignum::randBignum(this->groupOrder),this->modulus);
45 } /* namespace libzerocoin */