mirror of
https://github.com/monero-project/monero.git
synced 2025-08-01 17:36:10 -04:00
add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
This commit is contained in:
parent
4e72384318
commit
f931e16c6e
24 changed files with 184 additions and 140 deletions
|
@ -171,8 +171,10 @@ TEST(ringct, range_proofs)
|
|||
skpkGen(Sk, Pk);
|
||||
destinations.push_back(Pk);
|
||||
|
||||
const rct::RCTConfig rct_config { RangeProofBorromean, 0 };
|
||||
|
||||
//compute rct data with mixin 500
|
||||
rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, hw::get_device("default"));
|
||||
rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, rct_config, hw::get_device("default"));
|
||||
|
||||
//verify rct data
|
||||
ASSERT_TRUE(verRct(s));
|
||||
|
@ -189,7 +191,7 @@ TEST(ringct, range_proofs)
|
|||
|
||||
|
||||
//compute rct data with mixin 500
|
||||
s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, hw::get_device("default"));
|
||||
s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, rct_config, hw::get_device("default"));
|
||||
|
||||
//verify rct data
|
||||
ASSERT_FALSE(verRct(s));
|
||||
|
@ -235,8 +237,10 @@ TEST(ringct, range_proofs_with_fee)
|
|||
skpkGen(Sk, Pk);
|
||||
destinations.push_back(Pk);
|
||||
|
||||
const rct::RCTConfig rct_config { RangeProofBorromean, 0 };
|
||||
|
||||
//compute rct data with mixin 500
|
||||
rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, hw::get_device("default"));
|
||||
rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, rct_config, hw::get_device("default"));
|
||||
|
||||
//verify rct data
|
||||
ASSERT_TRUE(verRct(s));
|
||||
|
@ -253,7 +257,7 @@ TEST(ringct, range_proofs_with_fee)
|
|||
|
||||
|
||||
//compute rct data with mixin 500
|
||||
s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, hw::get_device("default"));
|
||||
s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, rct_config, hw::get_device("default"));
|
||||
|
||||
//verify rct data
|
||||
ASSERT_FALSE(verRct(s));
|
||||
|
@ -311,7 +315,8 @@ TEST(ringct, simple)
|
|||
//compute sig with mixin 2
|
||||
xmr_amount txnfee = 1;
|
||||
|
||||
rctSig s = genRctSimple(message, sc, pc, destinations,inamounts, outamounts, amount_keys, NULL, NULL, txnfee, 2, hw::get_device("default"));
|
||||
const rct::RCTConfig rct_config { RangeProofBorromean, 0 };
|
||||
rctSig s = genRctSimple(message, sc, pc, destinations,inamounts, outamounts, amount_keys, NULL, NULL, txnfee, 2, rct_config, hw::get_device("default"));
|
||||
|
||||
//verify ring ct signature
|
||||
ASSERT_TRUE(verRctSimple(s));
|
||||
|
@ -345,7 +350,8 @@ static rct::rctSig make_sample_rct_sig(int n_inputs, const uint64_t input_amount
|
|||
}
|
||||
}
|
||||
|
||||
return genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, hw::get_device("default"));
|
||||
const rct::RCTConfig rct_config { RangeProofBorromean, 0 };
|
||||
return genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3, rct_config, hw::get_device("default"));
|
||||
}
|
||||
|
||||
static rct::rctSig make_sample_simple_rct_sig(int n_inputs, const uint64_t input_amounts[], int n_outputs, const uint64_t output_amounts[], uint64_t fee)
|
||||
|
@ -371,7 +377,8 @@ static rct::rctSig make_sample_simple_rct_sig(int n_inputs, const uint64_t input
|
|||
destinations.push_back(Pk);
|
||||
}
|
||||
|
||||
return genRctSimple(rct::zero(), sc, pc, destinations, inamounts, outamounts, amount_keys, NULL, NULL, fee, 3, hw::get_device("default"));
|
||||
const rct::RCTConfig rct_config { RangeProofBorromean, 0 };
|
||||
return genRctSimple(rct::zero(), sc, pc, destinations, inamounts, outamounts, amount_keys, NULL, NULL, fee, 3, rct_config, hw::get_device("default"));
|
||||
}
|
||||
|
||||
static bool range_proof_test(bool expected_valid,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue