An introduction to the algorithmic of p -adic numbers David Lubicz 1 - - PowerPoint PPT Presentation

an introduction to the algorithmic of p adic numbers
SMART_READER_LITE
LIVE PREVIEW

An introduction to the algorithmic of p -adic numbers David Lubicz 1 - - PowerPoint PPT Presentation

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p adic integers Basic operations A point counting algorithm An introduction to the algorithmic of p -adic numbers David Lubicz 1 1 Universt de


slide-1
SLIDE 1

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

An introduction to the algorithmic of p-adic numbers

David Lubicz1

1Universté de Rennes 1, Campus de Beaulieu, 35042 Rennes Cedex, France

  • D. Lubicz

p-adic numbers

slide-2
SLIDE 2

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Outline

1

Introduction

2

Basic definitions

3

First properties

4

Field extensions

5

Newton lift

6

Algorithmic p − adic integers

7

Basic operations

8

A point counting algorithm

  • D. Lubicz

p-adic numbers

slide-3
SLIDE 3

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

When do we need p-adic numbers?

In elliptic curve cryptography, most of time, the important

  • bjects to manipulate are finite fields Fq.

Sometimes, we would like to use formulas coming from the classical theory of elliptic curves over C but they have no meaning in characteristic p because for instance they imply the evaluation of 1/p.

  • D. Lubicz

p-adic numbers

slide-4
SLIDE 4

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Cryptographic applications

Main cryptographic applications of p-adic numbers : point counting algorithms; CM-methods; isogeny computations.

  • D. Lubicz

p-adic numbers

slide-5
SLIDE 5

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

What are the p-adic numbers?

A dictionary : Function fields Number theory C[X] Z C(X) Q a monomial (X − α) p prime finite extension of C(X) finite extension of Q Laurent series about α p-adic numbers

  • D. Lubicz

p-adic numbers

slide-6
SLIDE 6

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Construction of p-adic numbers I

Let p be a prime, let An = Z/pnZ. We have a natural morphism φ : An → An−1 provided by the reduction modulo pn−1. The sequence . . . An → An−1 → . . . → A2 → A1 is an inverse system. Definition The ring of p-adic numbers is by definition Zp = lim

← (An, φn).

  • D. Lubicz

p-adic numbers

slide-7
SLIDE 7

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Construction of p-adic numbers II

An element of a = Zp can be represented as a sequence

  • f elements

a = (a1, a2, . . . , an, . . .) with ai ∈ Z/piZ and ai mod pi−1 = ai−1. The ring structure is the one inherited from that of Z/piZ. The neutral element is (1, . . . , 1, . . .). There exists natural projections pi : Zp → Z/piZ, a → ai = a mod pi.

  • D. Lubicz

p-adic numbers

slide-8
SLIDE 8

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

First properties I

Proposition Let x ∈ Zp, x is invertible if and only if x mod p is

  • invertible. Let x ∈ Zp, there exists a unique (u, n) where u

is an invertible element of Zp and n a positive integer such that x = pnu. The integer n is called the valuation of x and denoted by v(x).

  • D. Lubicz

p-adic numbers

slide-9
SLIDE 9

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

First properties II

Zp is a characteristic 0 ring; Zp is integral; Zp has a unique maximal ideal Op = {x ∈ Zp|v(x) > 0}; There is a canonical isomorphism Zp/Op ≃ Fp.

  • D. Lubicz

p-adic numbers

slide-10
SLIDE 10

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

The field of p-adics

Definition The field of p-adic numbers noted Qp is by definition the field of fractions of Zp. The valuation of Zp extend immediately to Qp by letting v(x/y) = v(x) − v(y) for x, y ∈ Zp; Qp comes with a norm called the p-adic norm given by |x|Qp = p−v(x).

  • D. Lubicz

p-adic numbers

slide-11
SLIDE 11

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Representation as a series I

Definition An element π ∈ Zp is called a uniformizing element if v(π) = 1. Let p1 be the canonical projection from Zp to Fp. A map ω : Fp → Zp is a system of representatives of Fp if for all x ∈ Fp we have p1

  • ω(x)
  • = x.

Definition An element x ∈ Zp is called a lift of an element x0 ∈ Fp if p1(x) = x0. Consequently, for all x ∈ Fp, ω(x) is a lift of x.

  • D. Lubicz

p-adic numbers

slide-12
SLIDE 12

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Representation as a series II

Let π be a uniformizing element of Zp, ω a system of representatives of Fp in Zp and x ∈ Zp. Let n = v(x), then x/πn is an invertible element of Zp and there exists a unique xn ∈ Fp such that v

  • x − πnω(xn)
  • = n + 1. Iterating this process, we
  • btain that

Proposition There exists a unique sequence (xi)i0 of elements of Fp such that x =

  • i=0

ω(xi)πi.

  • D. Lubicz

p-adic numbers

slide-13
SLIDE 13

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Field extensions I

Let K be a finite extension of Qp defined by an irreducible polynomial m ∈ Qp[X]. There exists a unique norm | · |K on K extending the p-adic norm on Qp. R = {x ∈ K | |x|K ≤ 1} is the valuation ring of K. M = {x ∈ R | |x|K < 1} is be the unique maximal ideal of R.

  • D. Lubicz

p-adic numbers

slide-14
SLIDE 14

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Field extension II

Definition Keeping the notation from above : The field Fq = R/M is an algebraic extension of Fp, the degree of which is called the inertia degree of K and is denoted by f. The absolute ramification index of K is the integer e = vK

  • ψ(p)
  • , where ψ : Z → K is the canonical

embedding of Z into K.

  • D. Lubicz

p-adic numbers

slide-15
SLIDE 15

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Unramified extensions I

We have the Theorem Let d be the degree of K/Qp, then d = ef. Definition Let K/Qp be a finite extension. Then K is called absolutely unramified if e = 1. An absolutely unramified extension of degree d is denoted by Qq with q = pd and its valuation ring by Zq.

  • D. Lubicz

p-adic numbers

slide-16
SLIDE 16

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Unramified extensions II

Proposition Let K be a finite extension of Qp defined by an irreducible polynomial m ∈ Qp[X]. Denote by P1 the reduction morphism R[X] → Fq[X] induced by p1 and let m be the irreducible polynomial defined by P1(m). The extension K/Qp is absolutely unramified if and only if deg m = deg m. Let d = deg m and Fq = Fpd the finite field defined by m, then we have p1(R) = Fq.

  • D. Lubicz

p-adic numbers

slide-17
SLIDE 17

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Unramified extensions III

The classification of unramified extension is given by their degree. Proposition Let K1 and K2 be two unramified extensions of Qp defined respectively by m1 and m2 then K1 ≃ K2 if and only if deg m1 = deg m2.

  • D. Lubicz

p-adic numbers

slide-18
SLIDE 18

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Unramified extensions IV

The Galois properties of unramified extensions of Qp is the same as that of finite fields. Proposition An unramified extension K of Qp is Galois and its Galois group is cyclic generated by an element Σ that reduces to the Frobenius morphism on the residue field. We call this automorphism the Frobenius substitution on K.

  • D. Lubicz

p-adic numbers

slide-19
SLIDE 19

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Lefschetz principle I

The field Qp and its unramified extensions enjoy several important properties: Their Galois groups reflect the structure of finite field extensions; Their are big enough to be characteristic 0 fields... ...but small enough so that there exists an field morphism K → C for any K finite extension of Qp. Warning : Qp/Q is NOT an algebraic extension.

  • D. Lubicz

p-adic numbers

slide-20
SLIDE 20

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Lefschetz principle II

The so-called Lefschetz principle consists in lifting objects defined over finite fields over the p-adics, then embedding the p-adics into C where we can obtain algebraic relations using analytic methods, and then interpret these relations over finite fields by reduction modulo p.

  • D. Lubicz

p-adic numbers

slide-21
SLIDE 21

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Newton lift I

Proposition Let K be an unramified extension of Qp with valuation ring R and norm | · |K. Let f ∈ R[X] and let x0 ∈ R be such that |f(x0)|K < |f ′(x0)|2

K

then the sequence xn+1 = xn − f(xn) f ′(xn) (1) converges quadratically towards a zero of f in R.

  • D. Lubicz

p-adic numbers

slide-22
SLIDE 22

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Newton lift II

The quadratic convergence implies that the precision of the approximation nearly doubles at each iteration. More precisely, let k = vK

  • f ′(x0)
  • and let x be the limit of

the sequence (1). Suppose that xi is an approximation of x to precision n, i.e. vK(x − xi) ≥ n, then xi+1 = xi − f(xi)/f ′(xi) is an approximation of x to precision 2n − k.

  • D. Lubicz

p-adic numbers

slide-23
SLIDE 23

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Hensel lift

Lemma (Hensel) Let f, Ak, Bk, U, V be polynomials with coefficients in R such that f ≡ AkBk (mod Mk), U(X)Ak(X) + V(X)Bk(X) = 1, with Ak monic and deg U(X) < deg Bk(X) and deg V(X) < deg Ak(X) then there exist polynomials Ak+1 and Bk+1 satisfying the same conditions as above with k replaced by k + 1 and Ak+1 ≡ Ak (mod Mk), Bk+1 ≡ Bk (mod Mk).

  • D. Lubicz

p-adic numbers

slide-24
SLIDE 24

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Representation of p − adic integers

In practice, one computes with p-adic integers up to some precision N. An element a ∈ Zp is approximated by pN(a) ∈ Z/pNZ. The arithmetic reduces to the arithmetic modulo pN. For a given precision N, each element takes O(N log p) space.

  • D. Lubicz

p-adic numbers

slide-25
SLIDE 25

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Polynomial representation I

Let Qq be the unramified extension of Qp of degree d. By proposition 3, Qq is defined by any polynomial M[X] ∈ Zp[X] such that m = P1(M) ∈ Fp[X] is an irreducible degree d polynomial. We can assume that M is monic. As a consequence every a ∈ Qq can be written as a = d−1

i=0 aiX i with ai ∈ Qp and every b ∈ Zq can be

written as b = d−1

i=0 biX i with bi ∈ Zp.

In order to make the reduction modulo M very fast, we choose M sparse.

  • D. Lubicz

p-adic numbers

slide-26
SLIDE 26

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Polynomial representation II

In general, we work with Zq up to precision N. This can be done by computing in (Z/NZ)[X]/(MN) where MN is the reduction of M modulo pN. The size of an object is O(dN log(p)).

  • D. Lubicz

p-adic numbers

slide-27
SLIDE 27

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Polynomials representation III

Two common choices to speed up arithmetic in Zq : sparse modulus representation : we deduce M by lifting in a trivial way the coefficients of m. The reduction modulo M

  • f a polynomial of degree less than 2(d − 1) takes

d(w − 1) multiplication of a Z/NZ element by a small integer and dw subtractions in Zp where w is the number

  • f non zero coefficients in M.

Teichmüller modulus representation : We define M as the unique polynomial over Zp such that M(X)|X q − X and M(X) mod p = m(X). In this representation we have Σ(X) = X p.

  • D. Lubicz

p-adic numbers

slide-28
SLIDE 28

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Multiplication I

The arithmetic in Zp with precision N is the same thing as the arithmetic in Z/pNZ. The multiplication of two elements of Zp takes O(Nµ) where µ is the exponent in the multiplication estimate of two integers (µ = 1 + ǫ with FFT, µ = log 3 with Karatsuba, and µ = 2 with school book method);

  • D. Lubicz

p-adic numbers

slide-29
SLIDE 29

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Multiplication II

The multiplications of two elements of Zq is equivalent to the multiplication of two polynomials in (Z/NZ)[X] which take O(dνNµ) time (here ν is the exponent of the complexity function for the multiplication of two polynomials). In all the complexity of the multiplication of two p-adics is O(dνNµ).

  • D. Lubicz

p-adic numbers

slide-30
SLIDE 30

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Computing inverse with Newton lift

In order to inverse a ∈ Zq can be done by computing an inverse of p1(a) ∈ Fq; taking any lift z1 ∈ Zq of 1/p1(a) ∈ Fq; z1 is an approximation to precision 1 of the root of the polynomial f(X) = 1 − aX; lifting the root z1 to a given precision with Newton.

  • D. Lubicz

p-adic numbers

slide-31
SLIDE 31

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Computing inverse with Newton lift

Inverse Input: A unit a ∈ Zq and a precision N Output: The inverse of a to precision N

1

If N = 1 Then

2

z ← 1/a mod p

3

Else

4

z ← Inverse(a, ⌈ N

2 ⌉ )

5

z ← z + z(1 − az) mod pN

6

Return z

  • D. Lubicz

p-adic numbers

slide-32
SLIDE 32

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Computing inverse with Newton lift

We go through the log(N) iterations; The dominant operation is a multiplication of elements of Zq with precision N : this can be done in O(dνNµ) time; The overall complexity is O(log(N)dνNµ).

  • D. Lubicz

p-adic numbers

slide-33
SLIDE 33

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Computing square root with Newton lift

In the same way it, one can compute the inverse square root of a ∈ Zq to precision N in time O(log(N)dνNµ); Principle: compute the square root mod p and then do a Newton lift with the polynomial f(X) = 1 − aX 2; For a reference ([CFA+06] pp. 248).

  • D. Lubicz

p-adic numbers

slide-34
SLIDE 34

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

The AGM algorithm I

Elliptic curve AGM Input: An ordinary elliptic curve E : y2 + xy = x3 + c over F2d with j(E) = 0. Output: The number of points on E(F2d).

1

N ← ⌈ d

2⌉ + 3

2

a ← 1 and b ← (1 + 8c) mod 24

3

For i = 5 To N Do

4

(a, b) ←

  • (a + b)/2,

√ ab

  • mod 2i

5

a0 ← a

  • D. Lubicz

p-adic numbers

slide-35
SLIDE 35

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

The AGM algorithm II

1

For i = 0 To d − 1 Do

2

(a, b) ←

  • (a + b)/2,

√ ab

  • mod 2N

3

t ← a0 a mod 2N−1

4

If t2 > 2d+2 Then t ← t − 2N−1

5

Return 2d + 1 − t

  • D. Lubicz

p-adic numbers

slide-36
SLIDE 36

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Complexity of the AGM algorithm

You know everything you need to see that the complexity is quasi-cubic.

  • D. Lubicz

p-adic numbers

slide-37
SLIDE 37

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

The End

Thank you for your attention. Any question?

  • D. Lubicz

p-adic numbers

slide-38
SLIDE 38

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

Henri Cohen, Gerhard Frey, Roberto Avanzi, Christophe Doche, Tanja Lange, Kim Nguyen, and Frederik Vercauteren, editors. Handbook of elliptic and hyperelliptic curve cryptography. Discrete Mathematics and its Applications (Boca Raton). Chapman & Hall/CRC, Boca Raton, FL, 2006. Neal Koblitz. p-adic numbers, p-adic analysis, and zeta-functions, volume 58 of Graduate Texts in Mathematics. Springer-Verlag, New York, second edition, 1984. Alain M. Robert.

  • D. Lubicz

p-adic numbers

slide-39
SLIDE 39

Introduction Basic definitions First properties Field extensions Newton lift Algorithmic p − adic integers Basic operations A point counting algorithm

A course in p-adic analysis, volume 198 of Graduate Texts in Mathematics. Springer-Verlag, New York, 2000. J.-P . Serre. A course in arithmetic. Springer-Verlag, New York, 1973. Translated from the French, Graduate Texts in Mathematics, No. 7. Jean-Pierre Serre. Local fields, volume 67 of Graduate Texts in Mathematics. Springer-Verlag, New York, 1979. Translated from the French by Marvin Jay Greenberg.

  • D. Lubicz

p-adic numbers