mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 01:42:27 +00:00
ringct: reorder a bit to check quicker tests first
This commit is contained in:
parent
71ac698b78
commit
6cc7d26140
1 changed files with 17 additions and 17 deletions
|
@ -797,23 +797,6 @@ namespace rct {
|
||||||
tools::thread_group threadpool(tools::thread_group::optimal_with_max(threads));
|
tools::thread_group threadpool(tools::thread_group::optimal_with_max(threads));
|
||||||
|
|
||||||
if (semantics) {
|
if (semantics) {
|
||||||
results.clear();
|
|
||||||
results.resize(rv.outPk.size());
|
|
||||||
tools::task_region(threadpool, [&] (tools::task_region_handle& region) {
|
|
||||||
for (size_t i = 0; i < rv.outPk.size(); i++) {
|
|
||||||
region.run([&, i] {
|
|
||||||
results[i] = verRange(rv.outPk[i].mask, rv.p.rangeSigs[i]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (size_t i = 0; i < results.size(); ++i) {
|
|
||||||
if (!results[i]) {
|
|
||||||
LOG_PRINT_L1("Range proof verified failed for output " << i);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
key sumOutpks = identity();
|
key sumOutpks = identity();
|
||||||
for (size_t i = 0; i < rv.outPk.size(); i++) {
|
for (size_t i = 0; i < rv.outPk.size(); i++) {
|
||||||
addKeys(sumOutpks, sumOutpks, rv.outPk[i].mask);
|
addKeys(sumOutpks, sumOutpks, rv.outPk[i].mask);
|
||||||
|
@ -833,6 +816,23 @@ namespace rct {
|
||||||
LOG_PRINT_L1("Sum check failed");
|
LOG_PRINT_L1("Sum check failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
results.clear();
|
||||||
|
results.resize(rv.outPk.size());
|
||||||
|
tools::task_region(threadpool, [&] (tools::task_region_handle& region) {
|
||||||
|
for (size_t i = 0; i < rv.outPk.size(); i++) {
|
||||||
|
region.run([&, i] {
|
||||||
|
results[i] = verRange(rv.outPk[i].mask, rv.p.rangeSigs[i]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (size_t i = 0; i < results.size(); ++i) {
|
||||||
|
if (!results[i]) {
|
||||||
|
LOG_PRINT_L1("Range proof verified failed for output " << i);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const key message = get_pre_mlsag_hash(rv);
|
const key message = get_pre_mlsag_hash(rv);
|
||||||
|
|
Loading…
Reference in a new issue