]>
Commit | Line | Data |
---|---|---|
b394396b PW |
1 | #ifndef _SECP256K1_GROUP_ |
2 | #define _SECP256K1_GROUP_ | |
3 | ||
607884fc | 4 | #include "num.h" |
b394396b PW |
5 | #include "field.h" |
6 | ||
254327e4 PW |
7 | typedef struct { |
8 | secp256k1_fe_t x; | |
9 | secp256k1_fe_t y; | |
10 | int infinity; | |
11 | } secp256k1_ge_t; | |
12 | ||
13 | typedef struct { | |
14 | secp256k1_fe_t x; | |
15 | secp256k1_fe_t y; | |
16 | secp256k1_fe_t z; | |
17 | int infinity; | |
18 | } secp256k1_gej_t; | |
19 | ||
20 | typedef struct { | |
21 | secp256k1_num_t order; | |
22 | secp256k1_ge_t g; | |
23 | secp256k1_fe_t beta; | |
24 | secp256k1_num_t lambda, a1b2, b1, a2; | |
25 | } secp256k1_ge_consts_t; | |
26 | ||
27 | static secp256k1_ge_consts_t *secp256k1_ge_consts = NULL; | |
28 | ||
29 | void static secp256k1_ge_start(void); | |
30 | void static secp256k1_ge_stop(void); | |
31 | void static secp256k1_ge_set_infinity(secp256k1_ge_t *r); | |
32 | void static secp256k1_ge_set_xy(secp256k1_ge_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y); | |
33 | int static secp256k1_ge_is_infinity(const secp256k1_ge_t *a); | |
34 | void static secp256k1_ge_neg(secp256k1_ge_t *r, const secp256k1_ge_t *a); | |
35 | void static secp256k1_ge_get_hex(char *r, int *rlen, const secp256k1_ge_t *a); | |
f11ff5be | 36 | void static secp256k1_ge_set_gej(secp256k1_ge_t *r, secp256k1_gej_t *a); |
254327e4 PW |
37 | |
38 | void static secp256k1_gej_set_infinity(secp256k1_gej_t *r); | |
39 | void static secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y); | |
f11ff5be | 40 | void static secp256k1_gej_set_xo(secp256k1_gej_t *r, const secp256k1_fe_t *x, int odd); |
254327e4 PW |
41 | void static secp256k1_gej_set_ge(secp256k1_gej_t *r, const secp256k1_ge_t *a); |
42 | void static secp256k1_gej_get_x(secp256k1_fe_t *r, const secp256k1_gej_t *a); | |
43 | void static secp256k1_gej_neg(secp256k1_gej_t *r, const secp256k1_gej_t *a); | |
44 | int static secp256k1_gej_is_infinity(const secp256k1_gej_t *a); | |
f11ff5be | 45 | int static secp256k1_gej_is_valid(const secp256k1_gej_t *a); |
254327e4 PW |
46 | void static secp256k1_gej_double(secp256k1_gej_t *r, const secp256k1_gej_t *a); |
47 | void static secp256k1_gej_add(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_gej_t *b); | |
48 | void static secp256k1_gej_add_ge(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_ge_t *b); | |
49 | void static secp256k1_gej_get_hex(char *r, int *rlen, const secp256k1_gej_t *a); | |
50 | void static secp256k1_gej_mul_lambda(secp256k1_gej_t *r, const secp256k1_gej_t *a); | |
51 | void static secp256k1_gej_split_exp(secp256k1_num_t *r1, secp256k1_num_t *r2, const secp256k1_num_t *a); | |
52 | ||
b394396b | 53 | #endif |