Minor prover simplification

This commit is contained in:
Sarang Noether 2019-10-28 09:34:49 -04:00
parent 4c9fd8d86d
commit 277003f145

View file

@ -601,21 +601,16 @@ try_again:
rct::keyV l0 = vector_subtract(aL, z); rct::keyV l0 = vector_subtract(aL, z);
const rct::keyV &l1 = sL; const rct::keyV &l1 = sL;
// This computes the ugly sum/concatenation from PAPER LINE 65
rct::keyV zero_twos(MN); rct::keyV zero_twos(MN);
const rct::keyV zpow = vector_powers(z, M+2); const rct::keyV zpow = vector_powers(z, M+2);
for (size_t i = 0; i < MN; ++i) for (size_t j = 0; j < M; ++j)
{ {
zero_twos[i] = rct::zero(); for (size_t i = 0; i < N; ++i)
for (size_t j = 1; j <= M; ++j)
{
if (i >= (j-1)*N && i < j*N)
{ {
CHECK_AND_ASSERT_THROW_MES(1+j < zpow.size(), "invalid zpow index"); CHECK_AND_ASSERT_THROW_MES(j+2 < zpow.size(), "invalid zpow index");
CHECK_AND_ASSERT_THROW_MES(i-(j-1)*N < twoN.size(), "invalid twoN index"); CHECK_AND_ASSERT_THROW_MES(i < twoN.size(), "invalid twoN index");
sc_muladd(zero_twos[i].bytes, zpow[1+j].bytes, twoN[i-(j-1)*N].bytes, zero_twos[i].bytes); sc_mul(zero_twos[j*N+i].bytes,zpow[j+2].bytes,twoN[i].bytes);
} }
}
} }
rct::keyV r0 = vector_add(aR, z); rct::keyV r0 = vector_add(aR, z);