Create an explicit value rangeproof which proves that the commitment commits to an explicit value
| 123 | |
| 124 | // Create an explicit value rangeproof which proves that the commitment commits to an explicit value |
| 125 | static bool CreateBlindValueProof(std::vector<unsigned char>& rangeproof, const uint256& value_blinder, const CAmount amount, const secp256k1_pedersen_commitment& value_commit, const secp256k1_generator& gen) |
| 126 | { |
| 127 | // Prep rangeproof |
| 128 | size_t rangeproof_len = 5134; |
| 129 | rangeproof.resize(rangeproof_len); |
| 130 | |
| 131 | // Generate a new random nonce |
| 132 | uint256 nonce; |
| 133 | GetStrongRandBytes(nonce.begin(), nonce.size()); |
| 134 | |
| 135 | // Make the rangeproof |
| 136 | int res = secp256k1_rangeproof_sign(secp256k1_blind_context, rangeproof.data(), &rangeproof_len, /* min_value */ amount, &value_commit, value_blinder.begin(), nonce.begin(), /* exp */ -1, /* min_bits */ 0, amount, /* message */ nullptr, /* message_len */ 0, /* extra_commit */ nullptr, /* extra_commit_len */ 0, &gen); |
| 137 | rangeproof.resize(rangeproof_len); |
| 138 | return res == 1; |
| 139 | } |
| 140 | |
| 141 | bool CreateBlindValueProof(std::vector<unsigned char>& rangeproof, const uint256& value_blinder, const CAmount amount, const CConfidentialValue& conf_value, const CConfidentialAsset& conf_asset) |
| 142 | { |
no test coverage detected