]> Git Repo - secp256k1.git/blame - src/group.h
10x26 field implementation
[secp256k1.git] / src / group.h
CommitLineData
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
7typedef struct {
8 secp256k1_fe_t x;
9 secp256k1_fe_t y;
10 int infinity;
11} secp256k1_ge_t;
12
13typedef struct {
14 secp256k1_fe_t x;
15 secp256k1_fe_t y;
16 secp256k1_fe_t z;
17 int infinity;
18} secp256k1_gej_t;
19
20typedef 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
27static secp256k1_ge_consts_t *secp256k1_ge_consts = NULL;
28
29void static secp256k1_ge_start(void);
30void static secp256k1_ge_stop(void);
31void static secp256k1_ge_set_infinity(secp256k1_ge_t *r);
32void static secp256k1_ge_set_xy(secp256k1_ge_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y);
33int static secp256k1_ge_is_infinity(const secp256k1_ge_t *a);
34void static secp256k1_ge_neg(secp256k1_ge_t *r, const secp256k1_ge_t *a);
35void static secp256k1_ge_get_hex(char *r, int *rlen, const secp256k1_ge_t *a);
f11ff5be 36void static secp256k1_ge_set_gej(secp256k1_ge_t *r, secp256k1_gej_t *a);
254327e4
PW
37
38void static secp256k1_gej_set_infinity(secp256k1_gej_t *r);
39void static secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y);
f11ff5be 40void static secp256k1_gej_set_xo(secp256k1_gej_t *r, const secp256k1_fe_t *x, int odd);
254327e4
PW
41void static secp256k1_gej_set_ge(secp256k1_gej_t *r, const secp256k1_ge_t *a);
42void static secp256k1_gej_get_x(secp256k1_fe_t *r, const secp256k1_gej_t *a);
43void static secp256k1_gej_neg(secp256k1_gej_t *r, const secp256k1_gej_t *a);
44int static secp256k1_gej_is_infinity(const secp256k1_gej_t *a);
f11ff5be 45int static secp256k1_gej_is_valid(const secp256k1_gej_t *a);
254327e4
PW
46void static secp256k1_gej_double(secp256k1_gej_t *r, const secp256k1_gej_t *a);
47void static secp256k1_gej_add(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_gej_t *b);
48void static secp256k1_gej_add_ge(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_ge_t *b);
49void static secp256k1_gej_get_hex(char *r, int *rlen, const secp256k1_gej_t *a);
50void static secp256k1_gej_mul_lambda(secp256k1_gej_t *r, const secp256k1_gej_t *a);
51void static secp256k1_gej_split_exp(secp256k1_num_t *r1, secp256k1_num_t *r2, const secp256k1_num_t *a);
52
b394396b 53#endif
This page took 0.026526 seconds and 4 git commands to generate.