7#ifndef SECP256K1_FIELD_INNER5X52_IMPL_H
8#define SECP256K1_FIELD_INNER5X52_IMPL_H
13#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0)
15#define VERIFY_BITS(x, n) do { } while(0)
20 uint64_t t3, t4, tx, u0;
21 uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
22 const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;
43 d = (uint128_t)a0 * b[3]
44 + (uint128_t)a1 * b[2]
45 + (uint128_t)a2 * b[1]
46 + (uint128_t)a3 * b[0];
49 c = (uint128_t)a4 * b[4];
52 d += (c & M) * R; c >>= 52;
61 d += (uint128_t)a0 * b[4]
62 + (uint128_t)a1 * b[3]
63 + (uint128_t)a2 * b[2]
64 + (uint128_t)a3 * b[1]
65 + (uint128_t)a4 * b[0];
75 tx = (t4 >> 48); t4 &= (M >> 4);
80 c = (uint128_t)a0 * b[0];
83 d += (uint128_t)a1 * b[4]
84 + (uint128_t)a2 * b[3]
85 + (uint128_t)a3 * b[2]
86 + (uint128_t)a4 * b[1];
97 c += (uint128_t)u0 * (R >> 4);
100 r[0] = c & M; c >>= 52;
105 c += (uint128_t)a0 * b[1]
106 + (uint128_t)a1 * b[0];
109 d += (uint128_t)a2 * b[4]
110 + (uint128_t)a3 * b[3]
111 + (uint128_t)a4 * b[2];
114 c += (d & M) * R; d >>= 52;
118 r[1] = c & M; c >>= 52;
123 c += (uint128_t)a0 * b[2]
124 + (uint128_t)a1 * b[1]
125 + (uint128_t)a2 * b[0];
128 d += (uint128_t)a3 * b[4]
129 + (uint128_t)a4 * b[3];
132 c += (d & M) * R; d >>= 52;
138 r[2] = c & M; c >>= 52;
145 r[3] = c & M; c >>= 52;
159 uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
160 int64_t t3, t4, tx, u0;
161 const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;
174 d = (uint128_t)(a0*2) * a3
175 + (uint128_t)(a1*2) * a2;
178 c = (uint128_t)a4 * a4;
181 d += (c & M) * R; c >>= 52;
185 t3 = d & M; d >>= 52;
191 d += (uint128_t)a0 * a4
192 + (uint128_t)(a1*2) * a3
193 + (uint128_t)a2 * a2;
199 t4 = d & M; d >>= 52;
203 tx = (t4 >> 48); t4 &= (M >> 4);
208 c = (uint128_t)a0 * a0;
211 d += (uint128_t)a1 * a4
212 + (uint128_t)(a2*2) * a3;
215 u0 = d & M; d >>= 52;
223 c += (uint128_t)u0 * (R >> 4);
226 r[0] = c & M; c >>= 52;
232 c += (uint128_t)a0 * a1;
235 d += (uint128_t)a2 * a4
236 + (uint128_t)a3 * a3;
239 c += (d & M) * R; d >>= 52;
243 r[1] = c & M; c >>= 52;
248 c += (uint128_t)a0 * a2
249 + (uint128_t)a1 * a1;
252 d += (uint128_t)a3 * a4;
255 c += (d & M) * R; d >>= 52;
259 r[2] = c & M; c >>= 52;
267 r[3] = c & M; c >>= 52;
static SECP256K1_INLINE void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t *SECP256K1_RESTRICT b)
#define VERIFY_BITS(x, n)
static SECP256K1_INLINE void secp256k1_fe_sqr_inner(uint64_t *r, const uint64_t *a)
#define VERIFY_CHECK(cond)
#define SECP256K1_RESTRICT