Skip to content

Commit

Permalink
chore: reorderd functions, beautified comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dderjoel committed Jul 27, 2023
1 parent 21e95b4 commit dff1160
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions src/field_5x52_int128_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@
#include "int128.h"
#include "util.h"

/* Autogenerated: 'src/ExtractionOCaml/dettman_multiplication' --inline --static
* --use-value-barrier secp256k1_dettman 64 5 48 2 '2^256 - 4294968273' mul
* square */
/* curve description: secp256k1_dettman */
/* machine_wordsize = 64 (from "64") */
/* requested operations: mul, square */
/* n = 5 (from "5") */
/* last_limb_width = 48 (from "48") */
/* last_reduction = 2 (from "2") */
/* s-c = 2^256 - [(1, 4294968273)] (from "2^256 - 4294968273") */
/* inbounds_multiplier: None (from "") */
/* */
/* Computed values: */
/* */
/* */

#if defined(__GNUC__) || defined(__clang__)
# define FIAT_SECP256K1_DETTMAN_FIAT_EXTENSION __extension__
# define FIAT_SECP256K1_DETTMAN_FIAT_INLINE __inline__
Expand All @@ -30,16 +14,6 @@
# define FIAT_SECP256K1_DETTMAN_FIAT_INLINE
#endif

FIAT_SECP256K1_DETTMAN_FIAT_EXTENSION typedef secp256k1_uint128
fiat_secp256k1_dettman_uint128;

#define secp256k1_fe_sqr_inner fiat_secp256k1_dettman_square
#define secp256k1_fe_mul_inner fiat_secp256k1_dettman_mul

#if (-1 & 3) != 3
#error "This code only works on a two's complement system"
#endif

static FIAT_SECP256K1_DETTMAN_FIAT_INLINE secp256k1_uint128 u128_mul_u64_u64(uint64_t a, uint64_t b) {
secp256k1_uint128 r;
secp256k1_u128_mul(&r, a, b);
Expand Down Expand Up @@ -68,6 +42,28 @@ static FIAT_SECP256K1_DETTMAN_FIAT_INLINE secp256k1_uint128 u128_add_u64_u128(ui
secp256k1_u128_accum_u64(&r, a);
return r;
}

/* Autogenerated: 'src/ExtractionOCaml/dettman_multiplication' --inline --static -use-value-barrier secp256k1_dettman 64 5 48 2 '2^256 - 4294968273' mul square
* curve description: secp256k1_dettman
* machine_wordsize = 64 (from "64")
* requested operations: mul, square
* n = 5 (from "5")
* last_limb_width = 48 (from "48")
* last_reduction = 2 (from "2")
* s-c = 2^256 - [(1, 4294968273)] (from "2^256 - 4294968273")
* inbounds_multiplier: None (from "")
*/


FIAT_SECP256K1_DETTMAN_FIAT_EXTENSION typedef secp256k1_uint128 fiat_secp256k1_dettman_uint128;

#define secp256k1_fe_sqr_inner fiat_secp256k1_dettman_square
#define secp256k1_fe_mul_inner fiat_secp256k1_dettman_mul

#if (-1 & 3) != 3
#error "This code only works on a two's complement system"
#endif

/*
* The function fiat_secp256k1_dettman_mul multiplies two field elements.
*
Expand Down

0 comments on commit dff1160

Please sign in to comment.