@@ -258,25 +258,13 @@ static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx,
258
258
}
259
259
260
260
static int secp256k1_pubkey_load (const secp256k1_context * ctx , secp256k1_ge * ge , const secp256k1_pubkey * pubkey ) {
261
- secp256k1_ge_storage s ;
262
-
263
- /* We require that the secp256k1_ge_storage type is exactly 64 bytes.
264
- * This is formally not guaranteed by the C standard, but should hold on any
265
- * sane compiler in the real world. */
266
- STATIC_ASSERT (sizeof (secp256k1_ge_storage ) == 64 );
267
- memcpy (& s , & pubkey -> data [0 ], 64 );
268
- secp256k1_ge_from_storage (ge , & s );
261
+ secp256k1_ge_from_bytes (ge , pubkey -> data );
269
262
ARG_CHECK (!secp256k1_fe_is_zero (& ge -> x ));
270
263
return 1 ;
271
264
}
272
265
273
266
static void secp256k1_pubkey_save (secp256k1_pubkey * pubkey , secp256k1_ge * ge ) {
274
- secp256k1_ge_storage s ;
275
-
276
- STATIC_ASSERT (sizeof (secp256k1_ge_storage ) == 64 );
277
- VERIFY_CHECK (!secp256k1_ge_is_infinity (ge ));
278
- secp256k1_ge_to_storage (& s , ge );
279
- memcpy (& pubkey -> data [0 ], & s , 64 );
267
+ secp256k1_ge_to_bytes (pubkey -> data , ge );
280
268
}
281
269
282
270
int secp256k1_ec_pubkey_parse (const secp256k1_context * ctx , secp256k1_pubkey * pubkey , const unsigned char * input , size_t inputlen ) {
0 commit comments