File: addlaws.h

package info (click to toggle)
gmp-ecm 7.0.4+ds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,728 kB
  • sloc: asm: 36,431; ansic: 34,057; xml: 885; python: 799; sh: 698; makefile: 348
file content (54 lines) | stat: -rw-r--r-- 3,093 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#define USE_ADD_SUB_CHAINS 1

#define pt_is_equal(P, Q) (mpz_cmp((P)->x, (Q)->x) == 0 \
	                     && mpz_cmp((P)->y, (Q)->y) == 0 \
			     && mpz_cmp((P)->z, (Q)->z) == 0)

void pt_print(ell_curve_t E, ell_point_t P, mpmod_t n);
int pt_is_zero(ell_point_t P, ATTRIBUTE_UNUSED mpmod_t n);
void pt_set_to_zero(ell_point_t P, mpmod_t n);
void pt_assign(ell_point_t Q, ell_point_t P, ATTRIBUTE_UNUSED mpmod_t n);
void pt_neg(ell_point_t P, mpmod_t n);
void pt_many_set_to_zero(ell_point_t *tP, int nE, mpmod_t n);
void pt_many_neg(ell_point_t *tP, int nE, mpmod_t n);
void pt_many_assign(ell_point_t *tQ, ell_point_t *tP, int nE, mpmod_t n);
void pt_many_print(ell_curve_t *tE, ell_point_t *tP, int nE, mpmod_t n);
void print_mpz_from_mpres(mpres_t x, mpmod_t n);
int pt_many_duplicate(ell_point_t *tQ, ell_point_t *tP, ell_curve_t *tE, int nE, mpmod_t n, mpres_t *num, mpres_t *den, mpres_t *inv, char *ok);
int pt_many_mul(ell_point_t *tQ, ell_point_t *tP, ell_curve_t *tE, int nE,
	    mpz_t e, mpmod_t n, 
	    mpres_t *num, mpres_t *den, mpres_t *inv, char *ok);

int hessian_to_weierstrass(mpz_t f, mpres_t x, mpres_t y, mpres_t D, mpmod_t n);

int build_MO_chain(short *S, size_t Slen, mpz_t e, int w);
int build_add_sub_chain(short *S, size_t Slen, mpz_t e, int w);
int compute_s_4_add_sub(mpz_t s, ecm_uint B1, int disc);

int mult_by_3(mpz_t f, mpres_t x, mpres_t y, mpres_t A, mpmod_t n);
void ell_point_init(ell_point_t P, ell_curve_t E, mpmod_t n);
void ell_point_clear(ell_point_t P, ATTRIBUTE_UNUSED ell_curve_t E, mpmod_t n);
void ell_point_print(ell_point_t P, ell_curve_t E, mpmod_t n);
void ell_point_set(ell_point_t Q, ell_point_t P,
		  ATTRIBUTE_UNUSED ell_curve_t E, ATTRIBUTE_UNUSED mpmod_t n);
void ell_curve_init(ell_curve_t E, int etype, int law, mpmod_t n);
void ell_curve_init_set(ell_curve_t E, int type, int law, mpres_t A, mpmod_t n);
void ell_curve_set_z(ell_curve_t E, ell_curve_t zE, mpmod_t n);
void ell_curve_clear(ell_curve_t E, mpmod_t n);
void ell_curve_print(ell_curve_t E, mpmod_t n);
int ell_point_is_on_curve(ell_point_t P, ell_curve_t E, mpmod_t n);
int ell_point_is_zero(ell_point_t P, ell_curve_t E, mpmod_t n);
void ell_point_set_to_zero(ell_point_t P, ell_curve_t E, mpmod_t n);
int ell_point_add(ell_point_t R, ell_point_t P, ell_point_t Q, ell_curve_t E, mpmod_t n);
int ell_point_sub(ell_point_t R, ell_point_t P, ell_point_t Q, ell_curve_t E, mpmod_t n);
int ell_point_duplicate(ell_point_t R, ell_point_t P, ell_curve_t E, mpmod_t n);
void ell_point_negate(ell_point_t P, ell_curve_t E, mpmod_t n);
int ell_point_mul_plain (ell_point_t Q, mpz_t e, ell_point_t P, ell_curve_t E, mpmod_t n);
int get_add_sub_w(mpz_t e);
void add_sub_pack(mpz_t s, int w, short *S, int iS);
void add_sub_unpack(int *w, short **S, int *iS, mpz_t s);
int ell_point_mul_add_sub_with_S(ell_point_t Q, ell_point_t P, ell_curve_t E,
				mpmod_t n, int w, short *S, int iS);
int ell_point_mul_add_sub (ell_point_t Q, mpz_t e, ell_point_t P,
			  ell_curve_t E, mpmod_t n);
int ell_point_mul(ell_point_t Q, mpz_t e, ell_point_t P, ell_curve_t E, mpmod_t n);