Skip to content

Commit

Permalink
More memory fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rumata888 committed Jun 20, 2023
1 parent c715517 commit d9be8d9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cpp/src/barretenberg/srs/scalar_multiplication.test.cpp
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 d9be8d9

Please sign in to comment.