Skip to content

Commit 3e19728

Browse files
committed
refactor: Make field_NxM.h headers self-contained
1 parent e63b5d4 commit 3e19728

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ jobs:
748748

749749
- name: Test script
750750
run: |
751-
./tools/check_header.sh src/field.h
751+
./tools/check_header.sh src/field.h src/field_5x52.h src/field_10x26.h
752752
753753
sage:
754754
name: "SageMath prover"

src/field.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@
2929
* implementation also provides a secp256k1_fe_verify routine to verify that
3030
* these fields match the run-time value and perform internal consistency
3131
* checks. */
32-
#ifdef VERIFY
33-
# define SECP256K1_FE_VERIFY_FIELDS \
34-
int magnitude; \
35-
int normalized;
36-
#else
37-
# define SECP256K1_FE_VERIFY_FIELDS
38-
#endif
3932

4033
#if defined(SECP256K1_WIDEMUL_INT128)
4134
#include "field_5x52.h"

src/field_10x26.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ typedef struct {
3030
* sum(i=0..9, n[i] << (i*26)) < p
3131
* (together these imply n[9] <= 2^22 - 1)
3232
*/
33-
SECP256K1_FE_VERIFY_FIELDS
33+
#ifdef VERIFY
34+
int magnitude;
35+
int normalized;
36+
#endif
3437
} secp256k1_fe;
3538

3639
/* Unpacks a constant into a overlapping multi-limbed FE element. */

src/field_5x52.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ typedef struct {
3030
* sum(i=0..4, n[i] << (i*52)) < p
3131
* (together these imply n[4] <= 2^48 - 1)
3232
*/
33-
SECP256K1_FE_VERIFY_FIELDS
33+
#ifdef VERIFY
34+
int magnitude;
35+
int normalized;
36+
#endif
3437
} secp256k1_fe;
3538

3639
/* Unpacks a constant into a overlapping multi-limbed FE element. */

0 commit comments

Comments
 (0)