Primality Proving with Elliptic Curves Laurent Thry Marelle - - PowerPoint PPT Presentation

primality proving with elliptic curves
SMART_READER_LITE
LIVE PREVIEW

Primality Proving with Elliptic Curves Laurent Thry Marelle - - PowerPoint PPT Presentation

Primality Proving with Elliptic Curves Laurent Thry Marelle Project 29/03/2007 p.1 Prime Number Inductive N := O: N | S ( n : N ): N Definition m + n := if m is S m then S ( m + n ) else n Definition m * n := if m is S m then


slide-1
SLIDE 1

Primality Proving with Elliptic Curves

Laurent Théry Marelle Project

29/03/2007 – p.1

slide-2
SLIDE 2

Prime Number

Inductive N := O: N | S (n: N): N Definition m + n := if m is S m′ then S (m′ + n) else n Definition m * n := if m is S m′ then n + (m′ * n) else O Definition m | n := ∃q, n = q * m Definition prime p := ∀m, m | p ⇒ m = 1 ∨ m = p ∧ p = 1

29/03/2007 – p.2

slide-3
SLIDE 3

Prime Number

Theorem ex1: prime 1234567891. Proof. Qed.

29/03/2007 – p.3

slide-4
SLIDE 4

Fermat little theorem

bk−1 bk−1a bk−1a2 . . . bk−1ai . . . bk−1am−1 . . . . . . . . . . . . . . . . . . . . . bi bia bia2 . . . biai . . . biam−1 . . . . . . . . . . . . . . . . . . . . . b1 b1a b1a2 . . . b1ai . . . b1am−1 1 a a2 . . . ai . . . am−1 am = 1 mod n an−1 = amk = (am)k = 1 mod n

29/03/2007 – p.4

slide-5
SLIDE 5

Pocklington Certificate

m is the order of a: am = 1 mod n ∧ ∀k, k | m ⇒ am/k = 1 mod n Projection from Z/nZ to Z/pZ (p | n): gcd(u, n) = 1 ∧ u = 0 mod n ⇒ u = 0 mod p

29/03/2007 – p.5

slide-6
SLIDE 6

Pocklington Certificate

Let N be an integer. Assume that there exists a coprime to n and m such that am = 1 mod n ∀p, prime p ∧ p | m ⇒ gcd(am/p − 1, n) = 1 Then, if m ≥ √n, n is prime.

29/03/2007 – p.6

slide-7
SLIDE 7

Elliptic Curve

Cubic curve: y2 = x3 + Ax + B (4A3 + 27B2 = 0) Example: y2 = x3 − x

29/03/2007 – p.7

slide-8
SLIDE 8

Formalisation

Inductive elt: Set := | inf_elt: elt | curve_elt (x: K) (y: K) (H: y2 = x3 + A * x + B): elt.

29/03/2007 – p.8

slide-9
SLIDE 9

Elliptic Curve

p q r

29/03/2007 – p.9

slide-10
SLIDE 10

Elliptic Curve

p

  • p

29/03/2007 – p.10

slide-11
SLIDE 11

Formalisation

Definition -p := match p with | inf_elt ⇒ inf_elt | curve_elt x y H ⇒ curve_elt x (-y) opp lem end.

29/03/2007 – p.11

slide-12
SLIDE 12

Elliptic Curve

p q p q p q p+q

29/03/2007 – p.12

slide-13
SLIDE 13

Formalisation

Definition p1 + p2 := match p1, p2 with | inf_elt, _ ⇒ p2 | _, inf_elt ⇒ p1 | curve_elt x1 y1 H1, curve_elt x2 y2 H2 ⇒ if x1 = = x2 then if (y1 = = -y2) then inf_elt else let l = (3 * x2

1 + A)/(2 * y1) in

let x3 = l2 - 2 * x1 in curve_elt x3 (-y1 - l * (x3 - x1)) add lem1 ⊕t else let l = (y2 - y1)/(x2 - x1) in let x3 = l2 - x1 - x2 in curve_elt x3 (-y1 - l * (x3 - x1)) add lem2 ⊕g

29/03/2007 – p.13

slide-14
SLIDE 14

Formalisation

(elt, +) is a commutative group The difficult part: p1 + (p2 + p3) = (p1 + p2) + p3 Reduce to p1 ⊕ (p2 ⊕ p3) = (p1 ⊕ p2) ⊕ p3 Further reduce to

  • 1. p1 ⊕g (p2 ⊕g p3) = (p1 ⊕g p2) ⊕g p3.
  • 2. p1 ⊕g (p2 ⊕t p2) = (p1 ⊕g p2) ⊕g p2.
  • 3. p1 ⊕g (p1 ⊕g (p1 ⊕t p1)) = (p1 ⊕t p1) ⊕t (p1 ⊕t p1)
  • 4. p1 ⊕g (p2 ⊕g (p1 ⊕g p2)) = (p1 ⊕g p2)⊕t (p1 ⊕g p2)

29/03/2007 – p.14

slide-15
SLIDE 15

Explicit computation

y2 = x3 + Ax + B ∧ l = (3x2 + A)/2y ∧ x1 = l2 − 2x ∧ y1 = −y − l(x1 − x) ∧ ⇒ y2

1 = x3 1 + Ax1 + B

Common denominator: 210y8 − 210y6x3 − 210Ay6x − 210By6 = 0

29/03/2007 – p.15

slide-16
SLIDE 16

Explicit computation

Common denominator: 210y8 − 210y6x3 − 210Ay6x − 210By6 = 0 Rewriting: 210(x3 + Ax + B)4 − 210(x3 + Ax + B)3x3 −210A(x3 + Ax + B)3x − 210B(x3 + Ax + B)3 = 0 Ring Equality: Qed

29/03/2007 – p.16

slide-17
SLIDE 17

First equation

x1 − x2 = 0 ∧ x4 − x3 = 0 ∧ x2 − x3 = 0 ∧ x5 − x1 = 0 ∧ y2

1 = x3 1 + A ∗ x1 + B

∧ y2

2 = x3 2 + A ∗ x2 + B

∧ y2

3 = x3 3 + A ∗ x3 + B

∧ x4 = (y1 − y2)2/(x1 − x2)2 − x1 − x2 ∧ y4 = −(y1 − y2)/(x1 − x2) ∗ (x4 − x1) − y1 ∧ x6 = (y4 − y3)2/(x4 − x3)2 − x4 − x3 ∧ y6 = −(y4 − y3)/(x4 − x3) ∗ (x6 − x3) − y3 ∧ x5 = (y2 − y3)2/(x2 − x3)2 − x2 − x3 ∧ y5 = −(y2 − y3)/(x2 − x3) ∗ (x5 − x2) − y2 ∧ x7 = (y5 − y1)2/(x5 − x1)2 − x5 − x1 ∧ y7 = −(y5 − y1)/(x5 − x1) ∗ (x7 − x1) − y1 ⇒ x6 − x7 = 0

29/03/2007 – p.17

slide-18
SLIDE 18

First equation

  • (2) * y8

2 * x7 3 * x6 2 +

2 * (2 * (1 + 2)) * y8

2 * x7 3 * x5 2 * x1 -

2 * (1 + 2 * (1 + 2 * (1 + 2))) * y8

2 * x7 3 * x4 2 * x2 1 +

2 * (2 * (2 * (1 + 4))) * y8

2 * x7 3 * x3 2 * x3 1 -

2 * (1 + 2 * (1 + 2 * (1 + 2))) * y8

2 * x7 3 * x2 2 * x4 1 +

2 * (2 * (1 + 2)) * y8

2 * x7 3 * x2 * x5 1 -

2 * y8

2 * x7 3 * x6 1 + 2 * (2 * (1 + 2)) * y8 2 * x6 3 * x7 2 -

2 * (1 + 2 * (1 + 2 * (2 * 4))) * y8

2 * x6 3 * x6 2 * x1 +

2 * (2 * (2 * (1 + 2 * (2 * (1 + 4))))) * y8

2 * x6 3 * x5 2 * x2 1 -

2 * (1 + 2 * (2 * (2 * (1 + 2 * (2 * (1 + 2)))))) * y8

2 * x6 3 * x4 2 * x3 1 +

2 * (2 * (1 + 2 * (1 + 2 * (2 * 4)))) * y8

2 * x6 3 * x3 2 * x4 1 -

2 * (1 + 2 * (2 * (1 + 4))) * y8

2 * x6 3 * x2 2 * x5 1 +

2 * y8

2 * x6 3 * x7 1 -

................................................... ................................................... ...................................................

20000 lines!!

29/03/2007 – p.18

slide-19
SLIDE 19

Reflection

One Reification Ring Horner Representation: P ❀ P ′ + xiQ′ Rewrite [m = R] Naive: P ❀ P = P ′ + mQ′ ❀ P ′ + RQ′ Common denominator P1/Q1 + P2/Q2 ❀ (P ′

1Q′ 2 + P ′ 2Q′ 1)/Q′ 1Q′ 2

Result: field[H1; H2] 80 seconds.

29/03/2007 – p.19

slide-20
SLIDE 20

Elliptic Certificate

Order of a point: m.P = P + · · · + P

  • m

= 0 Projective coordinate: (3/4, 1/3) ❀ (9 : 4 : 12)

29/03/2007 – p.20

slide-21
SLIDE 21

Elliptic Certificate

Let n be an integer. Assume that there exist an elliptic curve y2 = x3 + Ax + B with A, B ∈ Z and gcd(4A3 + 27B2, n) = 1, a point P = (xP : yP : 1) such that y2

P = x3 P + AxP + B mod n, and an integer m such that

  • m.P = (0 : 1 : 0) mod n ;
  • for all prime p|m, (m/p).P = (xp : yp : zp) mod n with

gcd(zp, n) = 1. Then, if 4n < (m − 1)2, n is prime

29/03/2007 – p.21

slide-22
SLIDE 22

Elliptic Certificate

{ 329719147332060395689499, −94080, 9834496, 0, 3136, 8209062, [(40165264598163841, 1)] }

with the curve y2 = x3 − 94080x + 9834496 and the point 8209062.(0, 3136) whose order is 40165264598163841, 329719147332060395689499 is prime if 40165264598163841 is prime .

29/03/2007 – p.22

slide-23
SLIDE 23

Checking certificates

Definition double(p1, sc1) = if p1 = 0 then (0, sc1) else let (x1 : y1 : z1) = p1 in if y1 = 0 then (0, z1sc1) else let m = 3x2

1 + Az2 1 and l = 2y1z1 in

let l2 = l2 and x2 = m2z1 − 2x1l2 in ((x2l : l2(x1m − y1l) − x2m : z1l2l), sc1)

29/03/2007 – p.23

slide-24
SLIDE 24

A Demo

29/03/2007 – p.24

slide-25
SLIDE 25

Conclusions

Proving Primality Proving Ubiquity of computing

29/03/2007 – p.25