12 #ifndef PIVX_LIBZEROCOIN_PARAMGENERATION_H
13 #define PIVX_LIBZEROCOIN_PARAMGENERATION_H
19 void CalculateParams(ZerocoinParams ¶ms,
const CBigNum& N,
const std::string& aux, uint32_t securityLevel);
23 #define STRING_COMMIT_GROUP "COIN_COMMITMENT_GROUP"
24 #define STRING_AVC_GROUP "ACCUMULATED_VALUE_COMMITMENT_GROUP"
25 #define STRING_AVC_ORDER "ACCUMULATED_VALUE_COMMITMENT_ORDER"
26 #define STRING_AIC_GROUP "ACCUMULATOR_INTERNAL_COMMITMENT_GROUP"
27 #define STRING_QRNCOMMIT_GROUPG "ACCUMULATOR_QRN_COMMITMENT_GROUPG"
28 #define STRING_QRNCOMMIT_GROUPH "ACCUMULATOR_QRN_COMMITMENT_GROUPH"
29 #define ACCUMULATOR_BASE_CONSTANT 31
30 #define MAX_PRIMEGEN_ATTEMPTS 10000
31 #define MAX_ACCUMGEN_ATTEMPTS 10000
32 #define MAX_GENERATOR_ATTEMPTS 10000
33 #define NUM_SCHNORRGEN_ATTEMPTS 10000
256-bit unsigned big integer.
Parameter classes for Zerocoin.
uint256 calculateHash(const uint256 &input)
uint256 calculateGeneratorSeed(const uint256 &seed, const uint256 &pSeed, const uint256 &qSeed, const std::string &label, uint32_t index, uint32_t count)
Format a seed string by hashing several values.
uint256 calculateSeed(const CBigNum &modulus, const std::string &auxString, uint32_t securityLevel, const std::string &groupName)
Format a seed string by hashing several values.
IntegerGroupParams deriveIntegerGroupFromOrder(const CBigNum &groupOrder)
Deterministically compute a set of group parameters with a specified order.
void calculateGroupModulusAndOrder(const uint256 &seed, uint32_t pLen, uint32_t qLen, CBigNum *resultModulus, CBigNum *resultGroupOrder, uint256 *resultPseed, uint256 *resultQseed)
Deterministically compute a group description using NIST procedures.
IntegerGroupParams deriveIntegerGroupParams(const uint256 &seed, uint32_t pLen, uint32_t qLen)
Deterministically compute a set of group parameters using NIST procedures.
CBigNum generateRandomPrime(uint32_t primeBitLen, const arith_uint256 &in_seed, arith_uint256 *out_seed, uint32_t *prime_gen_counter)
Deterministically compute a random prime number.
CBigNum generateIntegerFromSeed(uint32_t numBits, const arith_uint256 &seed, uint32_t *numIterations)
CBigNum calculateGroupGenerator(const uint256 &seed, const uint256 &pSeed, const uint256 &qSeed, const CBigNum &modulus, const CBigNum &groupOrder, uint32_t index)
Deterministically compute a generator for a given group.
void CalculateParams(ZerocoinParams ¶ms, const CBigNum &N, const std::string &aux, uint32_t securityLevel)
Fill in a set of Zerocoin parameters from a modulus "N".
bool primalityTestByTrialDivision(uint32_t candidate)
Determines whether a uint32_t is a prime through trial division.
void calculateGroupParamLengths(uint32_t maxPLen, uint32_t securityLevel, uint32_t *pLen, uint32_t *qLen)
Calculate field/group parameter sizes based on a security level.