From ae0aeaf33d4433bc4c25e10bffc59cf7f1aa6650 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Wed, 1 Mar 2023 03:52:44 -0700 Subject: [PATCH] Remove duplicate p1_on_curve check (#107) Co-authored-by: George Kadianakis --- src/c_kzg_4844.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/c_kzg_4844.c b/src/c_kzg_4844.c index a4cf64b..32c18b9 100644 --- a/src/c_kzg_4844.c +++ b/src/c_kzg_4844.c @@ -646,14 +646,13 @@ static C_KZG_RET bytes_to_bls_field(fr_t *out, const Bytes32 *b) { static C_KZG_RET validate_kzg_g1(g1_t *out, const Bytes48 *b) { /* Convert the bytes to a p1 point */ blst_p1_affine p1_affine; + /* The uncompress routine also checks that the point is on the curve */ if (blst_p1_uncompress(&p1_affine, b->bytes) != BLST_SUCCESS) return C_KZG_BADARGS; blst_p1_from_affine(out, &p1_affine); /* The point at infinity is accepted! */ if (blst_p1_is_inf(out)) return C_KZG_OK; - /* The point must be on the curve */ - if (!blst_p1_on_curve(out)) return C_KZG_BADARGS; /* The point must be on the right subgroup */ if (!blst_p1_in_g1(out)) return C_KZG_BADARGS;