Bitcoin ABC
0.31.2
P2P Digital Currency
Toggle main menu visibility
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
f
g
h
i
k
m
n
o
p
s
t
u
v
w
Typedefs
Enumerations
Enumerator
a
b
c
d
e
h
i
l
m
n
p
q
r
s
t
u
v
w
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
!
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
!
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
m
n
o
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
f
g
i
o
p
r
s
t
u
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
b
c
d
e
h
i
k
l
m
n
p
r
s
t
u
v
Enumerations
b
c
d
e
f
g
h
i
j
m
n
o
p
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
u
v
w
x
y
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
secp256k1
src
field_5x52.h
Go to the documentation of this file.
1
/***********************************************************************
2
* Copyright (c) 2013, 2014 Pieter Wuille *
3
* Distributed under the MIT software license, see the accompanying *
4
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
5
***********************************************************************/
6
7
#ifndef SECP256K1_FIELD_REPR_H
8
#define SECP256K1_FIELD_REPR_H
9
10
#include <stdint.h>
11
12
typedef
struct
{
13
/* X = sum(i=0..4, n[i]*2^(i*52)) mod p
14
* where p = 2^256 - 0x1000003D1
15
*/
16
uint64_t n[5];
17
#ifdef VERIFY
18
int
magnitude;
19
int
normalized;
20
#endif
21
}
secp256k1_fe
;
22
23
/* Unpacks a constant into a overlapping multi-limbed FE element. */
24
#define SECP256K1_FE_CONST_INNER(d7, d6, d5, d4, d3, d2, d1, d0) { \
25
(d0) | (((uint64_t)(d1) & 0xFFFFFUL) << 32), \
26
((uint64_t)(d1) >> 20) | (((uint64_t)(d2)) << 12) | (((uint64_t)(d3) & 0xFFUL) << 44), \
27
((uint64_t)(d3) >> 8) | (((uint64_t)(d4) & 0xFFFFFFFUL) << 24), \
28
((uint64_t)(d4) >> 28) | (((uint64_t)(d5)) << 4) | (((uint64_t)(d6) & 0xFFFFUL) << 36), \
29
((uint64_t)(d6) >> 16) | (((uint64_t)(d7)) << 16) \
30
}
31
32
#ifdef VERIFY
33
#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0)), 1, 1}
34
#else
35
#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0))}
36
#endif
37
38
typedef
struct
{
39
uint64_t n[4];
40
}
secp256k1_fe_storage
;
41
42
#define SECP256K1_FE_STORAGE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{ \
43
(d0) | (((uint64_t)(d1)) << 32), \
44
(d2) | (((uint64_t)(d3)) << 32), \
45
(d4) | (((uint64_t)(d5)) << 32), \
46
(d6) | (((uint64_t)(d7)) << 32) \
47
}}
48
49
#define SECP256K1_FE_STORAGE_CONST_GET(d) \
50
(uint32_t)(d.n[3] >> 32), (uint32_t)d.n[3], \
51
(uint32_t)(d.n[2] >> 32), (uint32_t)d.n[2], \
52
(uint32_t)(d.n[1] >> 32), (uint32_t)d.n[1], \
53
(uint32_t)(d.n[0] >> 32), (uint32_t)d.n[0]
54
55
#endif
/* SECP256K1_FIELD_REPR_H */
secp256k1_fe_storage
Definition:
field_10x26.h:43
secp256k1_fe
Definition:
field_10x26.h:12
Generated on Sat Apr 26 2025 20:55:23 for Bitcoin ABC by
1.9.4