]> Git Repo - secp256k1.git/commitdiff
Add SECP256K1_FE_STORAGE_CONST_GET to 5x52 field
authorPieter Wuille <[email protected]>
Mon, 10 Aug 2020 21:32:28 +0000 (14:32 -0700)
committerPieter Wuille <[email protected]>
Mon, 10 Aug 2020 21:34:01 +0000 (14:34 -0700)
So far this has not been needed, as it's only used by the static precomputation
which always builds with 32-bit fields.

This prepares for the ability to have __int128 detected on the C side, breaking
that restriction.

src/field_5x52.h

index fc5bfe357e705d75b1185aa88f9017be2f37cc8e..6a068484c28a0d386fd62cfad107e3ca1b15ae02 100644 (file)
@@ -46,4 +46,10 @@ typedef struct {
     (d6) | (((uint64_t)(d7)) << 32) \
 }}
 
+#define SECP256K1_FE_STORAGE_CONST_GET(d) \
+    (uint32_t)(d.n[3] >> 32), (uint32_t)d.n[3], \
+    (uint32_t)(d.n[2] >> 32), (uint32_t)d.n[2], \
+    (uint32_t)(d.n[1] >> 32), (uint32_t)d.n[1], \
+    (uint32_t)(d.n[0] >> 32), (uint32_t)d.n[0]
+
 #endif /* SECP256K1_FIELD_REPR_H */
This page took 0.025479 seconds and 4 git commands to generate.