Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
proj.h
Go to the documentation of this file.
1
#ifndef proj_h
2
#define proj_h
3
4
#include <string.h>
5
6
#if defined AVX2
7
#include "../common/fp/avx2/fp-avx2.h"
8
#elif defined GMP
9
#include "../common/fp/gmp/fp-gmp.h"
10
#elif defined KARATSUBA
11
#include "../common/fp/karatsuba/fp-karatsuba.h"
12
#else
13
#include "../common/fp/mulx/fp.h"
14
#endif
15
16
/* P^1 over fp. */
17
typedef
struct
proj
18
{
19
fp
x
;
20
fp
z
;
21
}
proj
;
22
23
static
inline
void
proj_cswap(
proj
*
P
,
proj
*
Q
,
long
long
c)
24
{
25
fp_cswap
(
P
->x,
Q
->x,
c
);
26
fp_cswap
(
P
->z,
Q
->z,
c
);
27
}
28
29
static
inline
void
proj_cmov(
proj
*
P
,
const
proj
*
Q
,
long
long
c)
30
{
31
fp_cmov
(&
P
->x, &
Q
->x, c);
32
fp_cmov
(&
P
->z, &
Q
->z, c);
33
}
34
35
static
inline
void
proj_copy(
proj
*
P
,
const
proj
*
Q
)
36
{
37
fp_copy
(
P
->x,
Q
->x);
38
fp_copy
(
P
->z,
Q
->z);
39
}
40
41
static
inline
int
proj_equal(
proj
*A,
proj
*
B
)
42
{
43
fp
AxBz
;
44
fp
AzBx
;
45
fp_mul3(&
AxBz
, (
const
fp
*) &
A
->x, (
const
fp
*) &
B
->z);
46
fp_mul3(&
AzBx
, (
const
fp
*) &
A
->z, (
const
fp
*) &
B
->x);
47
return
!
memcmp
(&
AxBz
, &
AzBx
,
sizeof
AzBx
);
48
}
49
50
#endif
fp
uint64_t fp[NUMBER_OF_WORDS]
Definition
fp-gmp.h:22
fp_cmov
#define fp_cmov
Definition
fp-gmp.h:323
fp_copy
#define fp_copy
Definition
fp-gmp.h:79
fp_cswap
#define fp_cswap
Definition
fp-gmp.h:82
pip._vendor.pygments.unistring.c
c
Definition
unistring.py:122
tests.A
A
Definition
tests.py:29
i
for i
Definition
prime_search.m:10
proj
Definition
proj.h:18
proj::z
fp z
Definition
proj.h:20
proj::x
fp x
Definition
proj.h:19
dCTIDH
src
common
proj.h
Generated by
1.9.8