Skip to content

Commit e57f2e1

Browse files
committed
pubkey_load: replace ARG_CHECK with VERIFY_CHECK
This change prepares for the addition of ge_from_bytes and ge_to_bytes which do not take a context. This change should be inconsequential because it's very unlikely to land in the `sizeof(secp256k1_ge_storage) != 64` branch and the other branch does not have an ARG_CHECK either.
1 parent 33be375 commit e57f2e1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/secp256k1.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,15 @@ static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge,
247247
} else {
248248
/* Otherwise, fall back to 32-byte big endian for X and Y. */
249249
secp256k1_fe x, y;
250-
ARG_CHECK(secp256k1_fe_set_b32_limit(&x, pubkey->data));
251-
ARG_CHECK(secp256k1_fe_set_b32_limit(&y, pubkey->data + 32));
250+
int ret = 1;
251+
252+
ret &= secp256k1_fe_set_b32_limit(&x, pubkey->data);
253+
ret &= secp256k1_fe_set_b32_limit(&y, pubkey->data + 32);
254+
#ifdef VERIFY
255+
VERIFY_CHECK(ret);
256+
#else
257+
(void) ret;
258+
#endif
252259
secp256k1_ge_set_xy(ge, &x, &y);
253260
}
254261
ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));

0 commit comments

Comments
 (0)