@@ -238,25 +238,13 @@ static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx,
238238}
239239
240240static int secp256k1_pubkey_load (const secp256k1_context * ctx , secp256k1_ge * ge , const secp256k1_pubkey * pubkey ) {
241- secp256k1_ge_storage s ;
242-
243- /* We require that the secp256k1_ge_storage type is exactly 64 bytes.
244- * This is formally not guaranteed by the C standard, but should hold on any
245- * sane compiler in the real world. */
246- STATIC_ASSERT (sizeof (secp256k1_ge_storage ) == 64 );
247- memcpy (& s , & pubkey -> data [0 ], 64 );
248- secp256k1_ge_from_storage (ge , & s );
241+ secp256k1_ge_from_bytes (ge , pubkey -> data );
249242 ARG_CHECK (!secp256k1_fe_is_zero (& ge -> x ));
250243 return 1 ;
251244}
252245
253246static void secp256k1_pubkey_save (secp256k1_pubkey * pubkey , secp256k1_ge * ge ) {
254- secp256k1_ge_storage s ;
255-
256- STATIC_ASSERT (sizeof (secp256k1_ge_storage ) == 64 );
257- VERIFY_CHECK (!secp256k1_ge_is_infinity (ge ));
258- secp256k1_ge_to_storage (& s , ge );
259- memcpy (& pubkey -> data [0 ], & s , 64 );
247+ secp256k1_ge_to_bytes (pubkey -> data , ge );
260248}
261249
262250int secp256k1_ec_pubkey_parse (const secp256k1_context * ctx , secp256k1_pubkey * pubkey , const unsigned char * input , size_t inputlen ) {
0 commit comments