Skip to content

Commit

Permalink
Simplify types
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Sep 7, 2021
1 parent 97460a1 commit 021635b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/sigma/sigmaplus_prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ void SigmaPlusProver<Exponent, GroupElement>::proof(
std::vector<std::vector<Exponent>> partial_p_s;

// Pre-calculate product parts and calculate p_s(x) at the same time, put the latter into p_i_sum
for (std::size_t j = m_; j > 0; j--) {
for (std::ptrdiff_t j = m_ - 1; j >= 0; j--) {
partial_p_s.push_back(p_i_sum);
SigmaPrimitives<Exponent, GroupElement>::new_factor(sigma[(j - 1) * n_ + I[j - 1]], a[(j - 1) * n_ + I[j - 1]], p_i_sum);
SigmaPrimitives<Exponent, GroupElement>::new_factor(sigma[j*n_ + I[j]], a[j*n_ + I[j]], p_i_sum);
}

for (std::size_t j = 0; j < m_; j++) {
Expand Down
12 changes: 6 additions & 6 deletions src/sigma/sigmaplus_verifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ bool SigmaPlusVerifier<Exponent, GroupElement>::batch_verify(
std::vector<Scalar> commit_scalars; // associated to commitment list
h_scalars.reserve(n * m);
h_scalars.resize(n * m);
for (size_t i = 0; i < n * m; i++) {
for (std::size_t i = 0; i < n * m; i++) {
h_scalars[i] = Scalar(uint64_t(0));
}
commit_scalars.reserve(commits.size());
commit_scalars.resize(commits.size());
for (size_t i = 0; i < commits.size(); i++) {
for (std::size_t i = 0; i < commits.size(); i++) {
commit_scalars[i] = Scalar(uint64_t(0));
}

Expand Down Expand Up @@ -174,18 +174,18 @@ bool SigmaPlusVerifier<Exponent, GroupElement>::batch_verify(

Scalar f_i(uint64_t(1));
Scalar e;
size_t size = setSizes[t];
size_t start = commits.size() - size;
std::size_t size = setSizes[t];
std::size_t start = commits.size() - size;

std::vector<Scalar>::iterator ptr = commit_scalars.begin() + start;
compute_batch_fis(f_i, m, f_, w3, e, ptr, ptr, ptr + size - 1);

if(fPadding[t]) {
Scalar pow(uint64_t(1));
std::vector <Scalar> f_part_product;
for (std::size_t j = m; j > 0; j--) {
for (std::ptrdiff_t j = m - 1; j >= 0; j--) {
f_part_product.push_back(pow);
pow *= f_[(j - 1) * n + I_[size - 1][j - 1]];
pow *= f_[j*n + I_[size - 1][j]];
}

NthPower<Exponent> xj(x);
Expand Down

0 comments on commit 021635b

Please sign in to comment.