Skip to content

Commit

Permalink
fix: check_circuit bug fix (AztecProtocol/barretenberg#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rumata888 authored Jun 20, 2023
1 parent c7dd751 commit 119bc2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ bool TurboCircuitConstructor::check_circuit()
std::vector<fr> alpha_powers;
alpha_powers.push_back(alpha_base);
for (size_t i = 1; i < 7; i++) {
alpha_powers.push_back(alpha_powers[i] * alpha);
alpha_powers.push_back(alpha_powers[i - 1] * alpha);
}

for (size_t i = 0; i < get_num_gates(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ TYPED_TEST(ScalarMultiplicationTests, UndersizedInputs)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr) * num_points);

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * num_points * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (num_points * 2 + 1));

for (size_t i = 0; i < num_points; ++i) {
scalars[i] = Fr::random_element();
Expand Down Expand Up @@ -758,7 +758,7 @@ TYPED_TEST(ScalarMultiplicationTests, PippengerSmall)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr) * num_points);

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * num_points * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (num_points * 2 + 1));

for (size_t i = 0; i < num_points; ++i) {
scalars[i] = Fr::random_element();
Expand Down Expand Up @@ -795,7 +795,7 @@ TYPED_TEST(ScalarMultiplicationTests, PippengerEdgeCaseDbl)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr) * num_points);

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * num_points * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (num_points * 2 + 1));

AffineElement point = AffineElement(Element::random_element());
for (size_t i = 0; i < num_points; ++i) {
Expand Down Expand Up @@ -928,7 +928,7 @@ TYPED_TEST(ScalarMultiplicationTests, PippengerUnsafeShortInputs)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr) * num_points);

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * num_points * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (num_points * 2 + 1));

for (size_t i = 0; i < num_points; ++i) {
points[i] = AffineElement(Element::random_element());
Expand Down Expand Up @@ -986,7 +986,7 @@ TYPED_TEST(ScalarMultiplicationTests, PippengerOne)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr) * 1);

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * num_points * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (num_points * 2 + 1));

for (size_t i = 0; i < num_points; ++i) {
scalars[i] = Fr::random_element();
Expand Down Expand Up @@ -1021,7 +1021,7 @@ TYPED_TEST(ScalarMultiplicationTests, PippengerZeroPoints)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr));

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (2 + 1));

barretenberg::scalar_multiplication::pippenger_runtime_state<Curve> state(0);
Element result = barretenberg::scalar_multiplication::pippenger<Curve>(scalars, points, 0, state);
Expand All @@ -1042,7 +1042,7 @@ TYPED_TEST(ScalarMultiplicationTests, PippengerMulByZero)

Fr* scalars = (Fr*)aligned_alloc(32, sizeof(Fr));

AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * 2 + 1);
AffineElement* points = (AffineElement*)aligned_alloc(32, sizeof(AffineElement) * (2 + 1));

scalars[0] = Fr::zero();
points[0] = Group::affine_one;
Expand Down

0 comments on commit 119bc2c

Please sign in to comment.