mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
small touchups
This commit is contained in:
parent
21664f99b2
commit
513dae88dc
@ -737,11 +737,11 @@ static PreLeafTuple output_to_pre_leaf_tuple(const OutputPair &output_pair)
|
||||
|
||||
PreLeafTuple plt;
|
||||
if (!fcmp_pp::point_to_pre_wei_x(O, plt.O_pre_x))
|
||||
throw std::runtime_error("failed to get pre wei x scalar from O");
|
||||
throw std::runtime_error("failed to get pre wei x from O");
|
||||
if (!fcmp_pp::point_to_pre_wei_x(rct::pt2rct(I), plt.I_pre_x))
|
||||
throw std::runtime_error("failed to get pre wei x scalar from I");
|
||||
throw std::runtime_error("failed to get pre wei x from I");
|
||||
if (!fcmp_pp::point_to_pre_wei_x(C, plt.C_pre_x))
|
||||
throw std::runtime_error("failed to get pre wei x scalar from C");
|
||||
throw std::runtime_error("failed to get pre wei x from C");
|
||||
|
||||
return plt;
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ bool point_to_pre_wei_x(const rct::key &pub, PreWeiX &pre_wei_x) {
|
||||
return false;
|
||||
fe one;
|
||||
fe_1(one);
|
||||
|
||||
// (1+y),(1-y)
|
||||
fe_add(pre_wei_x.one_plus_y, one, y);
|
||||
fe_sub(pre_wei_x.one_minus_y, one, y);
|
||||
|
@ -377,7 +377,7 @@ TEST(Crypto, batch_inversion)
|
||||
// Memory allocator
|
||||
auto alloc = [](const std::size_t n) -> fe*
|
||||
{
|
||||
fe * ptr = (fe *) malloc(n * sizeof(fe));
|
||||
fe *ptr = (fe *) malloc(n * sizeof(fe));
|
||||
if (!ptr)
|
||||
throw std::runtime_error("failed to malloc fe *");
|
||||
return ptr;
|
||||
@ -391,7 +391,7 @@ TEST(Crypto, batch_inversion)
|
||||
ASSERT_EQ(fe_frombytes_vartime(init_elems[i], (unsigned char*)kp.pub.data), 0);
|
||||
}
|
||||
|
||||
for (std::size_t n_elems : {1, 100, 1000})
|
||||
for (const std::size_t n_elems : test_n_elems)
|
||||
{
|
||||
// Memory allocations
|
||||
fe *batch_inverted = alloc(n_elems);
|
||||
|
Loading…
Reference in New Issue
Block a user