Skip to content

Commit 54120ad

Browse files
committed
Fix dependencies
1 parent e2da759 commit 54120ad

File tree

4 files changed

+44
-30
lines changed

4 files changed

+44
-30
lines changed

src/group_impl.h

+30
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,36 @@ static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {
669669
return secp256k1_fe_is_quad_var(&yz);
670670
}
671671

672+
static void secp256k1_point_save(unsigned char *data, secp256k1_ge *ge) {
673+
if (sizeof(secp256k1_ge_storage) == 64) {
674+
secp256k1_ge_storage s;
675+
secp256k1_ge_to_storage(&s, ge);
676+
memcpy(data, &s, sizeof(s));
677+
} else {
678+
VERIFY_CHECK(!secp256k1_ge_is_infinity(ge));
679+
secp256k1_fe_normalize_var(&ge->x);
680+
secp256k1_fe_normalize_var(&ge->y);
681+
secp256k1_fe_get_b32(data, &ge->x);
682+
secp256k1_fe_get_b32(data + 32, &ge->y);
683+
}
684+
}
685+
686+
static void secp256k1_point_load(secp256k1_ge *ge, const unsigned char *data) {
687+
if (sizeof(secp256k1_ge_storage) == 64) {
688+
/* When the secp256k1_ge_storage type is exactly 64 byte, use its
689+
* representation as conversion is very fast. */
690+
secp256k1_ge_storage s;
691+
memcpy(&s, data, sizeof(s));
692+
secp256k1_ge_from_storage(ge, &s);
693+
} else {
694+
/* Otherwise, fall back to 32-byte big endian for X and Y. */
695+
secp256k1_fe x, y;
696+
secp256k1_fe_set_b32(&x, data);
697+
secp256k1_fe_set_b32(&y, data + 32);
698+
secp256k1_ge_set_xy(ge, &x, &y);
699+
}
700+
}
701+
672702
static int secp256k1_ge_is_in_correct_subgroup(const secp256k1_ge* ge) {
673703
#ifdef EXHAUSTIVE_TEST_ORDER
674704
secp256k1_gej out;

src/modules/frost/keygen_impl.h

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
#define SECP256K1_MODULE_FROST_KEYGEN_IMPL_H
99

1010
#include "keygen.h"
11+
#include "../../ecmult.h"
12+
#include "../../field.h"
13+
#include "../../group.h"
14+
#include "../../scalar.h"
15+
#include "../../hash.h"
1116

1217
/* Generate polynomial coefficients, coefficient commitments, and shares, from
1318
* a seed and a secret key. */

src/modules/frost/session_impl.h

+9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
#ifndef SECP256K1_MODULE_FROST_SESSION_IMPL_H
88
#define SECP256K1_MODULE_FROST_SESSION_IMPL_H
99

10+
#include <string.h>
11+
1012
#include "session.h"
13+
#include "../../eckey.h"
14+
#include "../../ecmult.h"
15+
#include "../../field.h"
16+
#include "../../group.h"
17+
#include "../../hash.h"
18+
#include "../../scalar.h"
19+
#include "../../util.h"
1120

1221
static const unsigned char secp256k1_frost_secnonce_magic[4] = { 0x84, 0x7d, 0x46, 0x25 };
1322

src/modules/musig/keyagg_impl.h

-30
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,6 @@
1717
#include "../../hash.h"
1818
#include "../../util.h"
1919

20-
static void secp256k1_point_save(unsigned char *data, secp256k1_ge *ge) {
21-
if (sizeof(secp256k1_ge_storage) == 64) {
22-
secp256k1_ge_storage s;
23-
secp256k1_ge_to_storage(&s, ge);
24-
memcpy(data, &s, sizeof(s));
25-
} else {
26-
VERIFY_CHECK(!secp256k1_ge_is_infinity(ge));
27-
secp256k1_fe_normalize_var(&ge->x);
28-
secp256k1_fe_normalize_var(&ge->y);
29-
secp256k1_fe_get_b32(data, &ge->x);
30-
secp256k1_fe_get_b32(data + 32, &ge->y);
31-
}
32-
}
33-
34-
static void secp256k1_point_load(secp256k1_ge *ge, const unsigned char *data) {
35-
if (sizeof(secp256k1_ge_storage) == 64) {
36-
/* When the secp256k1_ge_storage type is exactly 64 byte, use its
37-
* representation as conversion is very fast. */
38-
secp256k1_ge_storage s;
39-
memcpy(&s, data, sizeof(s));
40-
secp256k1_ge_from_storage(ge, &s);
41-
} else {
42-
/* Otherwise, fall back to 32-byte big endian for X and Y. */
43-
secp256k1_fe x, y;
44-
secp256k1_fe_set_b32(&x, data);
45-
secp256k1_fe_set_b32(&y, data + 32);
46-
secp256k1_ge_set_xy(ge, &x, &y);
47-
}
48-
}
49-
5020
static const unsigned char secp256k1_musig_keyagg_cache_magic[4] = { 0xf4, 0xad, 0xbb, 0xdf };
5121

5222
/* A keyagg cache consists of

0 commit comments

Comments
 (0)