Skip to content

Commit 677c04b

Browse files
committed
batch_verify: don't run strauss_batch if batch->result = 0
1 parent 8130569 commit 677c04b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/modules/batch/main_impl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ int secp256k1_batch_verify(const secp256k1_context *ctx, secp256k1_batch *batch)
170170
VERIFY_CHECK(ctx != NULL);
171171
ARG_CHECK(batch != NULL);
172172

173+
if(batch->result == 0) {
174+
return 0;
175+
}
176+
173177
if (batch->len > 0) {
174178
if(batch->scalars != NULL && batch->points != NULL) {
175179
mid_res = secp256k1_ecmult_strauss_batch_prealloc_scratch(&ctx->error_callback, batch->data, &resj, batch->scalars, batch->points, &batch->sc_g, batch->len) && secp256k1_gej_is_infinity(&resj);

0 commit comments

Comments
 (0)