![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
Classes | |
| class | InvalidSerialException |
| class | PublicCoin |
| A Public coin is the part of a coin that is published to the network and what is handled by other clients. More... | |
| class | CoinRandomnessSchnorrSignature |
| A Schnorr Signature on the hash of metadata attesting that the signer knows the randomness v necessary to open a public coin C (which is a pedersen commitment g^S h^v mod p) with given serial number S. More... | |
| class | AccumulatorProofOfKnowledge |
| class | SerialNumberSignatureOfKnowledge |
| class | CommitmentProofOfKnowledge |
| class | CoinSpend |
| The complete proof needed to spend a zerocoin. More... | |
| class | Commitment |
| A commitment, complete with contents and opening randomness. More... | |
| class | IntegerGroupParams |
| class | AccumulatorAndProofParams |
| class | ZerocoinParams |
Enumerations | |
| enum | CoinDenomination { ZQ_ERROR = 0 , ZQ_ONE = 1 , ZQ_FIVE = 5 , ZQ_TEN = 10 , ZQ_FIFTY = 50 , ZQ_ONE_HUNDRED = 100 , ZQ_FIVE_HUNDRED = 500 , ZQ_ONE_THOUSAND = 1000 , ZQ_FIVE_THOUSAND = 5000 } |
| enum | SpendType : uint8_t { SPEND , STAKE , MN_COLLATERAL , SIGN_MESSAGE } |
Functions | |
| int | ExtractVersionFromSerial (const CBigNum &bnSerial) |
| CBigNum | GetAdjustedSerial (const CBigNum &bnSerial) |
| bool | IsValidSerial (const ZerocoinParams *params, const CBigNum &bnSerial) |
| bool | IsValidCommitmentToCoinRange (const ZerocoinParams *params, const CBigNum &bnCommitment) |
| CBigNum | ExtractSerialFromPubKey (const CPubKey pubkey) |
| CoinDenomination | IntToZerocoinDenomination (int64_t amount) |
| int64_t | ZerocoinDenominationToInt (const CoinDenomination &denomination) |
| CoinDenomination | AmountToZerocoinDenomination (CAmount amount) |
| CoinDenomination | AmountToClosestDenomination (CAmount nAmount, CAmount &nRemaining) |
| CAmount | ZerocoinDenominationToAmount (const CoinDenomination &denomination) |
| CoinDenomination | get_denomination (std::string denomAmount) |
| int64_t | get_amount (std::string denomAmount) |
| 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". More... | |
| 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. More... | |
| uint256 | calculateSeed (const CBigNum &modulus, const std::string &auxString, uint32_t securityLevel, const std::string &groupName) |
| Format a seed string by hashing several values. More... | |
| uint256 | calculateHash (const uint256 &input) |
| void | calculateGroupParamLengths (uint32_t maxPLen, uint32_t securityLevel, uint32_t *pLen, uint32_t *qLen) |
| Calculate field/group parameter sizes based on a security level. More... | |
| IntegerGroupParams | deriveIntegerGroupParams (const uint256 &seed, uint32_t pLen, uint32_t qLen) |
| Deterministically compute a set of group parameters using NIST procedures. More... | |
| IntegerGroupParams | deriveIntegerGroupFromOrder (const CBigNum &groupOrder) |
| Deterministically compute a set of group parameters with a specified order. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| CBigNum | generateIntegerFromSeed (uint32_t numBits, const arith_uint256 &seed, uint32_t *numIterations) |
| bool | primalityTestByTrialDivision (uint32_t candidate) |
| Determines whether a uint32_t is a prime through trial division. More... | |
Variables | |
| const std::vector< CoinDenomination > | zerocoinDenomList = {ZQ_ONE, ZQ_FIVE, ZQ_TEN, ZQ_FIFTY, ZQ_ONE_HUNDRED, ZQ_FIVE_HUNDRED, ZQ_ONE_THOUSAND, ZQ_FIVE_THOUSAND} |
| const std::vector< int > | maxCoinsAtDenom = {4, 1, 4, 1, 4, 1, 4, 4} |
| Enumerator | |
|---|---|
| ZQ_ERROR | |
| ZQ_ONE | |
| ZQ_FIVE | |
| ZQ_TEN | |
| ZQ_FIFTY | |
| ZQ_ONE_HUNDRED | |
| ZQ_FIVE_HUNDRED | |
| ZQ_ONE_THOUSAND | |
| ZQ_FIVE_THOUSAND | |
Definition at line 14 of file Denominations.h.
| enum libzerocoin::SpendType : uint8_t |
| Enumerator | |
|---|---|
| SPEND | |
| STAKE | |
| MN_COLLATERAL | |
| SIGN_MESSAGE | |
Definition at line 11 of file SpendType.h.
| CoinDenomination libzerocoin::AmountToClosestDenomination | ( | CAmount | nAmount, |
| CAmount & | nRemaining | ||
| ) |
Definition at line 64 of file Denominations.cpp.
| CoinDenomination libzerocoin::AmountToZerocoinDenomination | ( | CAmount | amount | ) |
Definition at line 51 of file Denominations.cpp.
| uint256 libzerocoin::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.
| N | A CBigNum |
| aux | An auxiliary string |
| securityLevel | The security level in bits |
| groupName | A group description string |
| std::runtime_error | if the process fails |
Returns the hash of the value.
Definition at line 126 of file ParamGeneration.cpp.
| CBigNum libzerocoin::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.
| seed | A first seed for the process. |
| pSeed | A second seed for the process. |
| qSeed | A third seed for the process. |
| modulus | Proposed prime modulus for the field. |
| groupOrder | Proposed order of the group. |
| index | Index value, selects which generator you're building. |
| A | std::runtime_error if error. |
Generates a random group generator deterministically as a function of (seed,pSeed,qSeed) Uses the algorithm described in FIPS 186-3 Appendix A.2.3.
Definition at line 451 of file ParamGeneration.cpp.
| void libzerocoin::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.
| seed | A byte string seeding the process. |
| pLen | The desired length of the modulus "p" in bits |
| qLen | The desired length of the order "q" in bits |
| resultModulus | A value "p" describing a finite field "F_p" |
| resultGroupOrder | A value "q" describing the order of a subgroup |
| resultDomainParameterSeed | A resulting seed for use in later calculations. |
Calculates the description of a group G of prime order "q" embedded within a field "F_p". The input to this routine is in arbitrary seed. It uses the algorithms described in FIPS 186-3 Appendix A.1.2 to calculate primes "p" and "q".
Definition at line 350 of file ParamGeneration.cpp.
| void libzerocoin::calculateGroupParamLengths | ( | uint32_t | maxPLen, |
| uint32_t | securityLevel, | ||
| uint32_t * | pLen, | ||
| uint32_t * | qLen | ||
| ) |
Calculate field/group parameter sizes based on a security level.
| maxPLen | Maximum size of the field (modulus "p") in bits. |
| securityLevel | Required security level in bits (at least 80) |
| pLen | Result: length of "p" in bits |
| qLen | Result: length of "q" in bits |
| std::runtime_error | if the process fails |
Calculates the appropriate sizes of "p" and "q" for a prime-order subgroup of order "q" embedded within a field "F_p". The sizes are based on a 'securityLevel' provided in symmetric-equivalent bits. Our choices slightly exceed the specs in FIPS 186-3:
securityLevel = 80: pLen = 1024, qLen = 256 securityLevel = 112: pLen = 2048, qLen = 256 securityLevel = 128: qLen = 3072, qLen = 320
If the length of "p" exceeds the length provided in "maxPLen", or if "securityLevel < 80" this routine throws an exception.
Definition at line 205 of file ParamGeneration.cpp.
Definition at line 175 of file ParamGeneration.cpp.
| void libzerocoin::CalculateParams | ( | ZerocoinParams & | params, |
| const CBigNum & | N, | ||
| const std::string & | aux, | ||
| uint32_t | securityLevel | ||
| ) |
Fill in a set of Zerocoin parameters from a modulus "N".
| N | A trusted RSA modulus |
| aux | An optional auxiliary string used in derivation |
| securityLevel | A security level |
| std::runtime_error | if the process fails |
Fills in a ZC_Params data structure deterministically from a trustworthy RSA modulus "N", which is provided as a CBigNum.
Note: this routine makes the fundamental assumption that "N" encodes a valid RSA-style modulus of the form "e1*e2" for some unknown safe primes "e1" and "e2". These factors must not be known to any party, or the security of Zerocoin is compromised. The integer "N" must be a MINIMUM of 1023 in length, and 3072 bits is strongly recommended.
Definition at line 41 of file ParamGeneration.cpp.
| uint256 libzerocoin::calculateSeed | ( | const CBigNum & | modulus, |
| const std::string & | auxString, | ||
| uint32_t | securityLevel, | ||
| const std::string & | groupName | ||
| ) |
Format a seed string by hashing several values.
| N | A CBigNum |
| aux | An auxiliary string |
| securityLevel | The security level in bits |
| groupName | A group description string |
| std::runtime_error | if the process fails |
Returns the hash of the value.
Definition at line 157 of file ParamGeneration.cpp.
| IntegerGroupParams libzerocoin::deriveIntegerGroupFromOrder | ( | const CBigNum & | groupOrder | ) |
Deterministically compute a set of group parameters with a specified order.
| groupOrder | The order of the group |
Given "q" calculates the description of a group G of prime order "q" embedded within a field "F_p".
Definition at line 287 of file ParamGeneration.cpp.
| IntegerGroupParams libzerocoin::deriveIntegerGroupParams | ( | const uint256 & | seed, |
| uint32_t | pLen, | ||
| uint32_t | qLen | ||
| ) |
Deterministically compute a set of group parameters using NIST procedures.
| seedStr | A byte string seeding the process. |
| pLen | The desired length of the modulus "p" in bits |
| qLen | The desired length of the order "q" in bits |
Calculates the description of a group G of prime order "q" embedded within a field "F_p". The input to this routine is in arbitrary seed. It uses the algorithms described in FIPS 186-3 Appendix A.1.2 to calculate primes "p" and "q". It uses the procedure in Appendix A.2.3 to derive two generators "g", "h".
Definition at line 242 of file ParamGeneration.cpp.
| int libzerocoin::ExtractVersionFromSerial | ( | const CBigNum & | bnSerial | ) |
| CBigNum libzerocoin::generateIntegerFromSeed | ( | uint32_t | numBits, |
| const arith_uint256 & | seed, | ||
| uint32_t * | numIterations | ||
| ) |
| CBigNum libzerocoin::generateRandomPrime | ( | uint32_t | primeBitLen, |
| const arith_uint256 & | in_seed, | ||
| arith_uint256 * | out_seed, | ||
| uint32_t * | prime_gen_counter | ||
| ) |
Deterministically compute a random prime number.
| primeBitLen | Desired bit length of the prime. |
| in_seed | Input seed for the process. |
| out_seed | Result: output seed from the process. |
| prime_gen_counter | Result: number of iterations required. |
| A | std::runtime_error if error. |
Generates a random prime number of primeBitLen bits from a given input seed. Uses the Shawe-Taylor algorithm as described in FIPS 186-3 Appendix C.6. This is a recursive function.
Definition at line 494 of file ParamGeneration.cpp.
| int64_t libzerocoin::get_amount | ( | std::string | denomAmount | ) |
| CoinDenomination libzerocoin::get_denomination | ( | std::string | denomAmount | ) |
Definition at line 99 of file Denominations.cpp.
| CoinDenomination libzerocoin::IntToZerocoinDenomination | ( | int64_t | amount | ) |
| bool libzerocoin::IsValidCommitmentToCoinRange | ( | const ZerocoinParams * | params, |
| const CBigNum & | bnCommitment | ||
| ) |
| bool libzerocoin::IsValidSerial | ( | const ZerocoinParams * | params, |
| const CBigNum & | bnSerial | ||
| ) |
| bool libzerocoin::primalityTestByTrialDivision | ( | uint32_t | candidate | ) |
Determines whether a uint32_t is a prime through trial division.
| candidate | Candidate to test. |
Performs trial division to determine whether a uint32_t is prime.
Definition at line 639 of file ParamGeneration.cpp.
| int64_t libzerocoin::ZerocoinDenominationToAmount | ( | const CoinDenomination & | denomination | ) |
| int64_t libzerocoin::ZerocoinDenominationToInt | ( | const CoinDenomination & | denomination | ) |
| const std::vector<int> libzerocoin::maxCoinsAtDenom = {4, 1, 4, 1, 4, 1, 4, 4} |
Definition at line 30 of file Denominations.h.
| const std::vector<CoinDenomination> libzerocoin::zerocoinDenomList = {ZQ_ONE, ZQ_FIVE, ZQ_TEN, ZQ_FIFTY, ZQ_ONE_HUNDRED, ZQ_FIVE_HUNDRED, ZQ_ONE_THOUSAND, ZQ_FIVE_THOUSAND} |
Definition at line 27 of file Denominations.h.