Skip to content

Commit 85805b1

Browse files
committed
f pippenger_max_points simplify n_points computation
1 parent 83fb087 commit 85805b1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ecmult_impl.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,10 +1199,9 @@ static size_t secp256k1_pippenger_max_points(const secp256k1_callback* error_cal
11991199
}
12001200
space_for_points = max_alloc - space_constant;
12011201

1202-
/* Compute an upper bound for the number of points after subtracting
1203-
* space for the base point G. It's an upper bound because alignment is
1204-
* not taken into account. */
1205-
n_points = (space_for_points - entry_size)/entry_size;
1202+
/* Compute an upper bound for the number excluding the base point G.
1203+
* It's an upper bound because alignment is not taken into account. */
1204+
n_points = space_for_points / entry_size - 1;
12061205
if (n_points > 0
12071206
&& space_for_points < secp256k1_pippenger_scratch_size_points(n_points, bucket_window, 1)) {
12081207
/* If there's not enough space after alignment is taken into

0 commit comments

Comments
 (0)