Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
tests Namespace Reference

Functions

 test_3div_poly (a1, a3)

Variables

int runs = 25
 setup = setup_fq(arguments(sys.argv[1:]).bits)
 Fq = setup['Fq']
 p = Fq.characteristic()
 A = Fq(6)
int elapsed_time = 0
 hash_input = hex(randrange(0, p))[2:].encode()
 start_time = time.perf_counter()
 j = cgl_hash2(hash_input, setup, verbose=False)
 end_time = time.perf_counter()
 xs = get_order3_points(A, setup)
 yk = setup['sqrt'](xk**3 + A * xk**2 + xk)
 a1
 a3
 Fp = setup['Fp']

Function Documentation

◆ test_3div_poly()

test_3div_poly ( a1,
a3 )

Definition at line 67 of file tests.py.

67 def test_3div_poly(a1, a3):
68 j = EllipticCurve(Fq, [a1, 0, a3, 0, 0]).j_invariant()
69 F_ = EllipticCurve(Fq, [a1, 0, a3, -5 * a1 * a3, -a1**3 * a3 - 7 * a3**2])
70 j_ = F_.j_invariant()
71 assert(j != j_)
72
73 alpha = setup['curt'](-a3)
74 assert alpha**3 == -a3
75 a1_, a3_ = isogeny3(alpha, a1, a3)
76 j0 = EllipticCurve(Fq, [a1_, 0, a3_, -5 * a1_ * a3_, -a1_**3 * a3_ - 7 * a3_**2]).j_invariant()
77
78 alpha *= setup['ζ₃']
79 assert alpha**3 == -a3
80 a1_, a3_ = isogeny3(alpha, a1, a3)
81 j1 = EllipticCurve(Fq, [a1_, 0, a3_, -5 * a1_ * a3_, -a1_**3 * a3_ - 7 * a3_**2]).j_invariant()
82
83 alpha *= setup['ζ₃']
84 assert alpha**3 == -a3
85 a1_, a3_ = isogeny3(alpha, a1, a3)
86 j2 = EllipticCurve(Fq, [a1_, 0, a3_, -5 * a1_ * a3_, -a1_**3 * a3_ - 7 * a3_**2]).j_invariant()
87
88 # Checking we have three non-isomorphic 3-isogenous curves
89 assert(j0 != j1)
90 assert(j0 != j2)
91 assert(j1 != j2)
92 # Checking non-backtracking
93 assert(j0 != j_)
94 assert(j1 != j_)
95 assert(j2 != j_)
96 # Checking non-backtracking
97 assert(j0 != j)
98 assert(j1 != j)
99 assert(j2 != j)
100
assert(var1 eq var2)

References assert().

Here is the call graph for this function:

Variable Documentation

◆ A

A = Fq(6)

Definition at line 29 of file tests.py.

◆ a1

a1

Definition at line 104 of file tests.py.

◆ a3

a3

Definition at line 104 of file tests.py.

◆ elapsed_time

int elapsed_time = 0

Definition at line 35 of file tests.py.

◆ end_time

end_time = time.perf_counter()

Definition at line 41 of file tests.py.

◆ Fp

Fp = setup['Fp']

Definition at line 144 of file tests.py.

◆ Fq

Fq = setup['Fq']

Definition at line 27 of file tests.py.

◆ hash_input

hash_input = hex(randrange(0, p))[2:].encode()

Definition at line 38 of file tests.py.

◆ j

j = cgl_hash2(hash_input, setup, verbose=False)

Definition at line 40 of file tests.py.

◆ p

p = Fq.characteristic()

Definition at line 28 of file tests.py.

◆ runs

int runs = 25

Definition at line 23 of file tests.py.

◆ setup

setup = setup_fq(arguments(sys.argv[1:]).bits)

Definition at line 26 of file tests.py.

◆ start_time

start_time = time.perf_counter()

Definition at line 39 of file tests.py.

◆ xs

xs = get_order3_points(A, setup)

Definition at line 101 of file tests.py.

◆ yk

yk = setup['sqrt'](xk**3 + A * xk**2 + xk)

Definition at line 103 of file tests.py.