Faster Implementation of Pairings Francisco Rodr guez-Henr quez - - PowerPoint PPT Presentation

faster implementation of pairings
SMART_READER_LITE
LIVE PREVIEW

Faster Implementation of Pairings Francisco Rodr guez-Henr quez - - PowerPoint PPT Presentation

ECC 2010 Redmond, USA Faster Implementation of Pairings Francisco Rodr guez-Henr quez CINVESTAV, IPN, Mexico City, Mexico Joint work with: Jean-Luc Beuchat LCIS, University of Tsukuba, Japan enaire, LIP, Nicolas Brisebarre


slide-1
SLIDE 1

ECC 2010 — Redmond, USA

Faster Implementation of Pairings

Francisco Rodr´ ıguez-Henr´ ıquez

CINVESTAV, IPN, Mexico City, Mexico Joint work with:

Jean-Luc Beuchat LCIS, University of Tsukuba, Japan Nicolas Brisebarre Ar´ enaire, LIP, ´ ENS Lyon, France J´ er´ emie Detrey Caramel, INRIA Nancy Grand-Est, France Nicolas Estibals Caramel, INRIA Nancy Grand-Est, France Jorge Gonz´ alez-D´ ıaz CINVESTAV, IPN, Mexico City, Mexico Emmanuel L´

  • pez-Trejo

Intel Guadalajara Design Center, Mexico Luis Mart´ ınez-Ramos CINVESTAV, IPN, Mexico City, Mexico Shigeo Mitsunari Cybozu Labs, Inc., Tokyo, Japan Eiji Okamoto LCIS, University of Tsukuba, Japan Tadanori Teruya LCIS, University of Tsukuba, Japan

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (1 / 49)

slide-2
SLIDE 2

Outline of the talk

1

Context

2

Hardware accelerator for the Tate pairing over supersingular curves

3

Software accelerator for the Tate pairing over supersingular curves

4

Optimal Ate Pairing over Barreto-Naehrig Curves

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (2 / 49)

slide-3
SLIDE 3

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ

  • Francisco Rodr´

ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-4
SLIDE 4

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ A non-degenerate bilinear pairing is a map ˆ e : ●1 × ●2 → ●τ that satisfies the following conditions:

  • Francisco Rodr´

ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-5
SLIDE 5

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ A non-degenerate bilinear pairing is a map ˆ e : ●1 × ●2 → ●τ that satisfies the following conditions:

◮ non-degeneracy: ˆ

e(P, P) = 1●τ (equivalently ˆ e(P, P) generates ●τ)

  • Francisco Rodr´

ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-6
SLIDE 6

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ A non-degenerate bilinear pairing is a map ˆ e : ●1 × ●2 → ●τ that satisfies the following conditions:

◮ non-degeneracy: ˆ

e(P, P) = 1●τ (equivalently ˆ e(P, P) generates ●τ)

◮ bilinearity:

ˆ e(Q1+Q2, R) = ˆ e(Q1, R)·ˆ e(Q2, R) ˆ e(Q, R1+R2) = ˆ e(Q, R1)·ˆ e(Q, R2)

  • Francisco Rodr´

ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-7
SLIDE 7

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ A non-degenerate bilinear pairing is a map ˆ e : ●1 × ●2 → ●τ that satisfies the following conditions:

◮ non-degeneracy: ˆ

e(P, P) = 1●τ (equivalently ˆ e(P, P) generates ●τ)

◮ bilinearity:

ˆ e(Q1+Q2, R) = ˆ e(Q1, R)·ˆ e(Q2, R) ˆ e(Q, R1+R2) = ˆ e(Q, R1)·ˆ e(Q, R2)

◮ computability: ˆ

e can be efficiently computed

  • Francisco Rodr´

ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-8
SLIDE 8

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ A non-degenerate bilinear pairing is a map ˆ e : ●1 × ●2 → ●τ that satisfies the following conditions:

◮ non-degeneracy: ˆ

e(P, P) = 1●τ (equivalently ˆ e(P, P) generates ●τ)

◮ bilinearity:

ˆ e(Q1+Q2, R) = ˆ e(Q1, R)·ˆ e(Q2, R) ˆ e(Q, R1+R2) = ˆ e(Q, R1)·ˆ e(Q, R2)

◮ computability: ˆ

e can be efficiently computed Immediate property: for any two integers k1 and k2 ˆ e(k1Q, k2R) = ˆ e(Q, R)k1k2

  • Francisco Rodr´

ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-9
SLIDE 9

Bilinear pairings

Let (●1, +), (●2, +) be two additively-written cyclic groups of prime order #●1 = #●2 = ℓ (●τ, ×), a multiplicatively-written cyclic group of order #●τ = ℓ A non-degenerate bilinear pairing is a map ˆ e : ●1 × ●2 → ●τ that satisfies the following conditions:

◮ non-degeneracy: ˆ

e(P, P) = 1●τ (equivalently ˆ e(P, P) generates ●τ)

◮ bilinearity:

ˆ e(Q1+Q2, R) = ˆ e(Q1, R)·ˆ e(Q2, R) ˆ e(Q, R1+R2) = ˆ e(Q, R1)·ˆ e(Q, R2)

◮ computability: ˆ

e can be efficiently computed Immediate property: for any two integers k1 and k2 ˆ e(k1Q, k2R) = ˆ e(Q, R)k1k2 When ●1 = ●2 we say that the pairing is symmetric, otherwise if ●1 = ●2, the pairing is asymmetric.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (3 / 49)

slide-10
SLIDE 10

Pairings in cryptography

At first, used to attack supersingular elliptic curves

◮ Menezes-Okamoto-Vanstone and Frey-R¨

uck attacks, 1993 and 1994 DLP●1 <P DLP●τ kP − → ˆ e(kP, P) = ˆ e(P, P)k

◮ for cryptographic applications, we will also require the DLP in ●τ to be

hard

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (4 / 49)

slide-11
SLIDE 11

Pairings in cryptography

At first, used to attack supersingular elliptic curves

◮ Menezes-Okamoto-Vanstone and Frey-R¨

uck attacks, 1993 and 1994 DLP●1 <P DLP●τ kP − → ˆ e(kP, P) = ˆ e(P, P)k

◮ for cryptographic applications, we will also require the DLP in ●τ to be

hard

One-round three-party key agreement (Joux, 2000)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (4 / 49)

slide-12
SLIDE 12

Pairings in cryptography

At first, used to attack supersingular elliptic curves

◮ Menezes-Okamoto-Vanstone and Frey-R¨

uck attacks, 1993 and 1994 DLP●1 <P DLP●τ kP − → ˆ e(kP, P) = ˆ e(P, P)k

◮ for cryptographic applications, we will also require the DLP in ●τ to be

hard

One-round three-party key agreement (Joux, 2000) Identity-based encryption

◮ Boneh–Franklin, 2001 ◮ Sakai–Kasahara, 2001 Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (4 / 49)

slide-13
SLIDE 13

Pairings in cryptography

At first, used to attack supersingular elliptic curves

◮ Menezes-Okamoto-Vanstone and Frey-R¨

uck attacks, 1993 and 1994 DLP●1 <P DLP●τ kP − → ˆ e(kP, P) = ˆ e(P, P)k

◮ for cryptographic applications, we will also require the DLP in ●τ to be

hard

One-round three-party key agreement (Joux, 2000) Identity-based encryption

◮ Boneh–Franklin, 2001 ◮ Sakai–Kasahara, 2001

Short digital signatures

◮ Boneh–Lynn–Shacham, 2001 ◮ Zang–Safavi-Naini–Susilo, 2004

...

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (4 / 49)

slide-14
SLIDE 14

The Tate Pairing over Supersingular elliptic curves

We first define

◮ ❋q, a finite field, with q = 2m or 3m ◮ E, an elliptic curve defined over ❋q ◮ ℓ, a large prime factor of #E(❋q)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (5 / 49)

slide-15
SLIDE 15

The Tate Pairing over Supersingular elliptic curves

We first define

◮ ❋q, a finite field, with q = 2m or 3m ◮ E, an elliptic curve defined over ❋q ◮ ℓ, a large prime factor of #E(❋q)

  • 1 = E(❋q)[ℓ], the ❋q-rational ℓ-torsion of E:
  • 1 = {P ∈ E(❋q) | ℓP = O}

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (5 / 49)

slide-16
SLIDE 16

The Tate Pairing over Supersingular elliptic curves

We first define

◮ ❋q, a finite field, with q = 2m or 3m ◮ E, an elliptic curve defined over ❋q ◮ ℓ, a large prime factor of #E(❋q)

  • 1 = E(❋q)[ℓ], the ❋q-rational ℓ-torsion of E:
  • 1 = {P ∈ E(❋q) | ℓP = O}
  • τ = µℓ, the group of ℓ-th roots of unity in ❋×

qk:

  • τ = {U ∈ ❋×

qk | Uℓ = 1}

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (5 / 49)

slide-17
SLIDE 17

The Tate Pairing over Supersingular elliptic curves

We first define

◮ ❋q, a finite field, with q = 2m or 3m ◮ E, an elliptic curve defined over ❋q ◮ ℓ, a large prime factor of #E(❋q)

  • 1 = E(❋q)[ℓ], the ❋q-rational ℓ-torsion of E:
  • 1 = {P ∈ E(❋q) | ℓP = O}
  • τ = µℓ, the group of ℓ-th roots of unity in ❋×

qk:

  • τ = {U ∈ ❋×

qk | Uℓ = 1}

k is the embedding degree, the smallest integer such that µℓ ⊆ ❋×

qk

◮ usually large for ordinary elliptic curves ◮ bounded in the case of supersingular elliptic curves

(4 in characteristic 2; 6 in characteristic 3; and 2 in characteristic > 3)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (5 / 49)

slide-18
SLIDE 18

Security considerations for Symmetric Pairings

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

The discrete logarithm problem should be hard in both ●1 and ●τ ❋ ❋ ❋ ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (6 / 49)

slide-19
SLIDE 19

Security considerations for Symmetric Pairings

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

The discrete logarithm problem should be hard in both ●1 and ●τ Base field (❋pm) ❋2m ❋3m Lower security (∼ 264) m = 239 m = 97 Medium security (∼ 280) m = 373 m = 163 Higher security (∼ 2128) m = 1103 m = 503 ❋2m: simpler finite field arithmetic ❋3m: smaller field extension

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (6 / 49)

slide-20
SLIDE 20

Computation of the Tate pairing

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

❋ ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (7 / 49)

slide-21
SLIDE 21

Computation of the Tate pairing

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

Arithmetic over ❋pm:

◮ polynomial basis: ❋pm ∼

= ❋p[x]/(f (x))

◮ f (x), degree-m polynomial irreducible over ❋p

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (7 / 49)

slide-22
SLIDE 22

Computation of the Tate pairing

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

Arithmetic over ❋pm:

◮ polynomial basis: ❋pm ∼

= ❋p[x]/(f (x))

◮ f (x), degree-m polynomial irreducible over ❋p

Arithmetic over ❋×

pkm:

◮ tower-field representation ◮ only arithmetic over the underlying field ❋pm

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (7 / 49)

slide-23
SLIDE 23

Computation of the Tate pairing

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

Arithmetic over ❋pm:

◮ polynomial basis: ❋pm ∼

= ❋p[x]/(f (x))

◮ f (x), degree-m polynomial irreducible over ❋p

Arithmetic over ❋×

pkm:

◮ tower-field representation ◮ only arithmetic over the underlying field ❋pm

Operations over ❋pm:

◮ O(m) additions / subtractions ◮ O(m) multiplications ◮ O(m) Frobenius maps (a → ap, i.e. squarings or cubings) ◮ 1 inversion Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (7 / 49)

slide-24
SLIDE 24

Computation of the Tate pairing

ˆ e : E(❋pm)[ℓ] × E(❋pm)[ℓ] → µℓ ⊆ ❋×

pkm

Arithmetic over ❋pm:

◮ polynomial basis: ❋pm ∼

= ❋p[x]/(f (x))

◮ f (x), degree-m polynomial irreducible over ❋p

Arithmetic over ❋×

pkm:

◮ tower-field representation ◮ only arithmetic over the underlying field ❋pm

Operations over ❋pm:

◮ O(m) additions / subtractions ◮ O(m) multiplications ◮ O(m) Frobenius maps (a → ap, i.e. squarings or cubings) ◮ 1 inversion

A first idea: an all-in-one unified operator:

◮ shared resources ◮ scalable architecture Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (7 / 49)

slide-25
SLIDE 25

Motivations

High speed is more important than low resources for some cryptographic applications Explore the other end of the area vs. time tradeoff:

◮ faster but larger than the unified operator ◮ what about the area-time product? Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (8 / 49)

slide-26
SLIDE 26

Motivations

High speed is more important than low resources for some cryptographic applications Explore the other end of the area vs. time tradeoff:

◮ faster but larger than the unified operator ◮ what about the area-time product?

Accelerate the computation by extracting as much parallelism as possible... ... Without increasing dramatically the resource requirements

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (8 / 49)

slide-27
SLIDE 27

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q)

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-28
SLIDE 28

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q) = ηT(P, Q)

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-29
SLIDE 29

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q) = ηT(P, Q)M

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-30
SLIDE 30

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q) = ηT(P, Q)M Computation of the ηT pairing

◮ via Miller’s algorithm: loop of (m + 1)/2 iterations ◮ result only defined modulo N-th powers in ❋×

pkm, with N = #E(❋pm)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-31
SLIDE 31

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q) = ηT(P, Q)M Computation of the ηT pairing

◮ via Miller’s algorithm: loop of (m + 1)/2 iterations ◮ result only defined modulo N-th powers in ❋×

pkm, with N = #E(❋pm)

Final exponentiation by M = (pkm − 1)/N

◮ required to obtain a unique value for each congruence class ◮ example in characteristic 3 (k = 6 and N = 3m + 1 ± 3(m+1)/2):

M = 36m − 1 3m + 1 ± 3(m+1)/2 =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

◮ exploit the special form of the exponent: ad-hoc algorithm Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-32
SLIDE 32

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q) = ηT(P, Q)M Computation of the ηT pairing

◮ via Miller’s algorithm: loop of (m + 1)/2 iterations ◮ result only defined modulo N-th powers in ❋×

pkm, with N = #E(❋pm)

Final exponentiation by M = (pkm − 1)/N

◮ required to obtain a unique value for each congruence class ◮ example in characteristic 3 (k = 6 and N = 3m + 1 ± 3(m+1)/2):

M = 36m − 1 3m + 1 ± 3(m+1)/2 =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

◮ exploit the special form of the exponent: ad-hoc algorithm

Two distinct computational requirements

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-33
SLIDE 33

Computation of the ηT pairing

The Tate pairing over E(❋pm) is computed in two main steps ˆ e(P, Q) = ηT(P, Q)M Computation of the ηT pairing

◮ via Miller’s algorithm: loop of (m + 1)/2 iterations ◮ result only defined modulo N-th powers in ❋×

pkm, with N = #E(❋pm)

Final exponentiation by M = (pkm − 1)/N

◮ required to obtain a unique value for each congruence class ◮ example in characteristic 3 (k = 6 and N = 3m + 1 ± 3(m+1)/2):

M = 36m − 1 3m + 1 ± 3(m+1)/2 =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

◮ exploit the special form of the exponent: ad-hoc algorithm

Two distinct computational requirements ⇒ use two distinct coprocessors

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (9 / 49)

slide-34
SLIDE 34

Reduced Tate pairing

Reduced Tate pairing ❋ ❋ ❋ ❋ ❋ ❋ ❋

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-35
SLIDE 35

Reduced Tate pairing

Reduced Tate pairing E(❋3m)[ℓ] E(❋3m)[ℓ] ❋ ❋ ❋ ❋ ❋

Input: two points P and Q in E(❋3m)[ℓ] ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-36
SLIDE 36

Reduced Tate pairing

Reduced Tate pairing E(❋3m)[ℓ] E(❋3m)[ℓ] µℓ ⊆ ❋×

36m

❋ ❋ ❋ ❋

Input: two points P and Q in E(❋3m)[ℓ] Output: an ℓ-th root of unity in the extension ❋×

36m

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-37
SLIDE 37

Reduced Tate pairing

Reduced Tate pairing E(❋3m)[ℓ] E(❋3m)[ℓ] µℓ ⊆ ❋×

36m

❋ ❋ ❋ ❋

Input: two points P and Q in E(❋3m)[ℓ] Output: an ℓ-th root of unity in the extension ❋×

36m

Two very different steps

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-38
SLIDE 38

Reduced Tate pairing

Reduced Tate pairing E(❋3m)[ℓ] E(❋3m)[ℓ] µℓ ⊆ ❋×

36m

❋×

36m

algorithm) Non-reduced pairing (iterative ❋ ❋ ❋

Input: two points P and Q in E(❋3m)[ℓ] Output: an ℓ-th root of unity in the extension ❋×

36m

Two very different steps

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-39
SLIDE 39

Reduced Tate pairing

Reduced Tate pairing E(❋3m)[ℓ] E(❋3m)[ℓ] µℓ ⊆ ❋×

36m

❋×

36m

algorithm) Non-reduced pairing (iterative (irregular exponentiation computation) Final ❋ ❋ ❋

Input: two points P and Q in E(❋3m)[ℓ] Output: an ℓ-th root of unity in the extension ❋×

36m

Two very different steps

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-40
SLIDE 40

Reduced Tate pairing

Reduced Tate pairing E(❋3m)[ℓ] E(❋3m)[ℓ] µℓ ⊆ ❋×

36m

❋×

36m

algorithm) Non-reduced pairing (iterative (irregular exponentiation computation) Final E(❋3m)[ℓ] E(❋3m)[ℓ] µℓ ⊆ ❋×

36m

Non-reduced pairing (iterative computation) (irregular exponentiation Final algorithm)

Input: two points P and Q in E(❋3m)[ℓ] Output: an ℓ-th root of unity in the extension ❋×

36m

Two very different steps

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (10 / 49)

slide-41
SLIDE 41

Two coprocessors for the ηT pairing

The two operations are purely sequential Only one active coprocessor at every moment

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (11 / 49)

slide-42
SLIDE 42

Two coprocessors for the ηT pairing

The two operations are purely sequential Only one active coprocessor at every moment Pipeline the data between the two coprocessors

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (11 / 49)

slide-43
SLIDE 43

Two coprocessors for the ηT pairing

The two operations are purely sequential Only one active coprocessor at every moment Pipeline the data between the two coprocessors

◮ both of them are kept busy ◮ higher throughput Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (11 / 49)

slide-44
SLIDE 44

Two coprocessors for the ηT pairing

The two operations are purely sequential Only one active coprocessor at every moment Pipeline the data between the two coprocessors

◮ both of them are kept busy ◮ higher throughput

Balance the computation time between the two coprocessors

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (11 / 49)

slide-45
SLIDE 45

ηT pairing algorithm

ηT : E(❋3m)[ℓ] × E(❋3m)[ℓ] → ❋×

36m

Three tasks per iteration:

➀ update the coordinates ➁ compute the line equation ➂ accumulate the new factor

Total cost: 17 ×, 4 Frobenius/inverse Frobenius and 30 + over ❋3m

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (12 / 49)

slide-46
SLIDE 46

ηT pairing algorithm

ηT : E(❋3m)[ℓ] × E(❋3m)[ℓ] → ❋×

36m

Three tasks per iteration:

➀ update the coordinates ➁ compute the line equation ➂ accumulate the new factor

Total cost: 17 ×, 4 Frobenius/inverse Frobenius and 30 + over ❋3m Cost of the inverse Frobenius: Same as the Frobenius

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (12 / 49)

slide-47
SLIDE 47

Accelerating the ηT pairing

Total cost: 17 ×, 2 Frobenius and inverse Frobenius and 30 + over ❋3m per iteration

◮ Frobenius/inverse Frobenius and +: cheap and fast operations Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (13 / 49)

slide-48
SLIDE 48

Accelerating the ηT pairing

Total cost: 17 ×, 2 Frobenius and inverse Frobenius and 30 + over ❋3m per iteration

◮ Frobenius/inverse Frobenius and +: cheap and fast operations ◮ critical operation: ×

Need for a fast parallel multiplier: Karatsuba

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (13 / 49)

slide-49
SLIDE 49

Accelerating the ηT pairing

Total cost: 17 ×, 2 Frobenius and inverse Frobenius and 30 + over ❋3m per iteration

◮ Frobenius/inverse Frobenius and +: cheap and fast operations ◮ critical operation: ×

Need for a fast parallel multiplier: Karatsuba

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (13 / 49)

slide-50
SLIDE 50

A parallel Karatsuba multiplier

◮ fully parallel: all sub-products are computed in parallel ◮ pipelined architecture: higher clock frequency, one product per cycle Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (14 / 49)

slide-51
SLIDE 51

A parallel Karatsuba multiplier

◮ fully parallel: all sub-products are computed in parallel ◮ pipelined architecture: higher clock frequency, one product per cycle ◮ sub-products recursively implemented as Karatsuba-Ofman multipliers Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (14 / 49)

slide-52
SLIDE 52

A parallel Karatsuba multiplier

◮ fully parallel: all sub-products are computed in parallel ◮ pipelined architecture: higher clock frequency, one product per cycle ◮ sub-products recursively implemented as Karatsuba-Ofman multipliers ◮ support for other variants: odd-even split, 3-way split, ... Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (14 / 49)

slide-53
SLIDE 53

A parallel Karatsuba multiplier

◮ fully parallel: all sub-products are computed in parallel ◮ pipelined architecture: higher clock frequency, one product per cycle ◮ sub-products recursively implemented as Karatsuba-Ofman multipliers ◮ support for other variants: odd-even split, 3-way split, ... ◮ final reduction modulo the irreducible polynomial f Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (14 / 49)

slide-54
SLIDE 54

Accelerating the ηT pairing

ηT coprocessor based on a single large multiplier:

◮ parallel Karatsuba architecture ◮ 7-stage pipeline ◮ one product per cycle Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (15 / 49)

slide-55
SLIDE 55

Accelerating the ηT pairing

ηT coprocessor based on a single large multiplier:

◮ parallel Karatsuba architecture ◮ 7-stage pipeline ◮ one product per cycle

Challenge: keep the multiplier busy at all times

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (15 / 49)

slide-56
SLIDE 56

Accelerating the ηT pairing

ηT coprocessor based on a single large multiplier:

◮ parallel Karatsuba architecture ◮ 7-stage pipeline ◮ one product per cycle

Challenge: keep the multiplier busy at all times Careful scheduling to avoid pipeline bubbles (idle cycles):

◮ ensure that multiplication operands are always available ◮ avoid memory congestion issues

We managed to accomplish that: our processor computes Miller loop in just 17 · (m + 3)/2 clock cycles (considering the initialization phase)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (15 / 49)

slide-57
SLIDE 57

A parallel operator for the ηT pairing

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (16 / 49)

slide-58
SLIDE 58

The final exponentiation

Compute ˆ e(P, Q) as ηT(P, Q)M with ηT(P, Q) ∈ ❋×

36m and

M =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (17 / 49)

slide-59
SLIDE 59

The final exponentiation

Compute ˆ e(P, Q) as ηT(P, Q)M with ηT(P, Q) ∈ ❋×

36m and

M =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

Operations over ❋3m: 73 ×, 3m + 3 Frobenius, 3m + 175 +, and 1 inversion

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (17 / 49)

slide-60
SLIDE 60

The final exponentiation

Compute ˆ e(P, Q) as ηT(P, Q)M with ηT(P, Q) ∈ ❋×

36m and

M =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

Operations over ❋3m: 73 ×, 3m + 3 Frobenius, 3m + 175 +, and 1 inversion (∼ log m × and m − 1 Frobenius)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (17 / 49)

slide-61
SLIDE 61

The final exponentiation

Compute ˆ e(P, Q) as ηT(P, Q)M with ηT(P, Q) ∈ ❋×

36m and

M =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

Operations over ❋3m: 73 ×, 3m + 3 Frobenius, 3m + 175 +, and 1 inversion (∼ log m × and m − 1 Frobenius) Cost of the ηT pairing:

◮ (m + 1)/2 iterations ◮ 17 ×, 10 Frobenius and 30 + over ❋3m per iteration Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (17 / 49)

slide-62
SLIDE 62

The final exponentiation

Compute ˆ e(P, Q) as ηT(P, Q)M with ηT(P, Q) ∈ ❋×

36m and

M =

  • 33m − 1
  • (3m + 1)
  • 3m + 1 ∓ 3(m+1)/2

Operations over ❋3m: 73 ×, 3m + 3 Frobenius, 3m + 175 +, and 1 inversion (∼ log m × and m − 1 Frobenius) Cost of the ηT pairing:

◮ (m + 1)/2 iterations ◮ 17 ×, 10 Frobenius and 30 + over ❋3m per iteration

The final exponentiation is much cheaper than the ηT pairing Challenge for the final exponentiation:

◮ computation in the same time as the ηT pairing ◮ ... using as few resources as possible Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (17 / 49)

slide-63
SLIDE 63

The final exponentiation

Design the smallest architecture possible supporting all the required

  • perations over ❋3m

purely sequential scheduling

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (18 / 49)

slide-64
SLIDE 64

The final exponentiation

Design the smallest architecture possible supporting all the required

  • perations over ❋3m

purely sequential scheduling Although some parallelism is required.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (18 / 49)

slide-65
SLIDE 65

The final exponentiation

Design the smallest architecture possible supporting all the required

  • perations over ❋3m

purely sequential scheduling Although some parallelism is required. We found out that the usage of the inverse Frobenius operator is advantageous for computing the final exponentiation (as long as the irreducible polynomials are inverse-Frobenius friendly)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (18 / 49)

slide-66
SLIDE 66

The final exponentiation

Design the smallest architecture possible supporting all the required

  • perations over ❋3m

purely sequential scheduling Although some parallelism is required. We found out that the usage of the inverse Frobenius operator is advantageous for computing the final exponentiation (as long as the irreducible polynomials are inverse-Frobenius friendly) New coprocessor with two arithmetic units:

◮ a standalone multiplier, based on a parallel-serial scheme ◮ a unified operator supporting addition/subtraction, inverse Frobenius

map and inverse double Frobenius map

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (18 / 49)

slide-67
SLIDE 67

A coprocessor for the final exponentiation

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (19 / 49)

slide-68
SLIDE 68

Agenda

1

Context

2

Hardware accelerator for the Tate pairing over supersingular curves Implementation Results in Hardware

3

Software accelerator for the Tate pairing over supersingular curves Computing the non-reduced pairing Final exponentiation Implementation results

4

Optimal Ate Pairing over Barreto-Naehrig Curves Barreto–Naehrig Curves

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (20 / 49)

slide-69
SLIDE 69

Hardware accelerators

10 100 1000 60 65 70 75 80 85 90 95 100 105 110

Security [bits] Calculation time [µs]

Virtex-II Pro Virtex-4 LX 6.2 µs / ❋397 12.8 µs / ❋3193 16.9 µs / ❋3313 20.9 µs / ❋397 100.8 µs / ❋2457 675.5 µs / ❋2557

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (21 / 49)

slide-70
SLIDE 70

Hardware implementation notes

Our Xilinx FPGA implementation, significantly improved the computation time of all the hardware pairing coprocessors for supersingular curves previously published

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (22 / 49)

slide-71
SLIDE 71

Hardware implementation notes

Our Xilinx FPGA implementation, significantly improved the computation time of all the hardware pairing coprocessors for supersingular curves previously published (a bit Surprisingly) our architecture also enjoys the best area/time trade-off performance among supersingular pairing accelerators

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (22 / 49)

slide-72
SLIDE 72

Hardware implementation notes

Our Xilinx FPGA implementation, significantly improved the computation time of all the hardware pairing coprocessors for supersingular curves previously published (a bit Surprisingly) our architecture also enjoys the best area/time trade-off performance among supersingular pairing accelerators However, because we exceeded the FPGA’s capacity, we could only achieve up to 109 bits of security

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (22 / 49)

slide-73
SLIDE 73

Hardware implementation notes

Our Xilinx FPGA implementation, significantly improved the computation time of all the hardware pairing coprocessors for supersingular curves previously published (a bit Surprisingly) our architecture also enjoys the best area/time trade-off performance among supersingular pairing accelerators However, because we exceeded the FPGA’s capacity, we could only achieve up to 109 bits of security Although it was not discussed here, we also implemented the Tate pairing over char 2. Experimentally, we observed that our char 2 and char 3 accelerators achieve almost the same time performance

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (22 / 49)

slide-74
SLIDE 74

Hardware implementation notes

Our Xilinx FPGA implementation, significantly improved the computation time of all the hardware pairing coprocessors for supersingular curves previously published (a bit Surprisingly) our architecture also enjoys the best area/time trade-off performance among supersingular pairing accelerators However, because we exceeded the FPGA’s capacity, we could only achieve up to 109 bits of security Although it was not discussed here, we also implemented the Tate pairing over char 2. Experimentally, we observed that our char 2 and char 3 accelerators achieve almost the same time performance In the design process of our char 2 accelerator we found the following undocumented family of square-root friendly irreducible pentanomials: f (x) = xm + xm−d + xm−2d + xd + 1. all technical details of these designs can be found in the preprint manuscripts eprint 2009/122 and eprint 2009/398

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (22 / 49)

slide-75
SLIDE 75

Agenda

1

Context

2

Hardware accelerator for the Tate pairing over supersingular curves Implementation Results in Hardware

3

Software accelerator for the Tate pairing over supersingular curves Computing the non-reduced pairing Final exponentiation Implementation results

4

Optimal Ate Pairing over Barreto-Naehrig Curves Barreto–Naehrig Curves

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (23 / 49)

slide-76
SLIDE 76

Computing the non-reduced pairing

ηT pairing: shorter loop ❋

for i ← 0 to (m − 1)/2 do end for ❋

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-77
SLIDE 77

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm: ❋

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ ❋

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-78
SLIDE 78

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ ❋

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-79
SLIDE 79

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates ➁ computation of line equation

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ 2 ×, 2 + ➁ ; t ← xP + xQ u ← yPyQ S ← −t2 ± uσ − tρ − ρ2 ❋

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-80
SLIDE 80

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates ➁ computation of line equation ➂ accumulation of the new factor

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ 2 ×, 2 + ➁ ; t ← xP + xQ u ← yPyQ S ← −t2 ± uσ − tρ − ρ2 1 × (❋36m) R ← R · S ➂

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-81
SLIDE 81

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates ➁ computation of line equation ➂ accumulation of the new factor

Multiplication is critical Comb right-to-left multiplier over ❋3m

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ 2 ×, 2 + ➁ ; t ← xP + xQ u ← yPyQ S ← −t2 ± uσ − tρ − ρ2 1 × (❋36m) R ← R · S ➂ bar

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-82
SLIDE 82

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates ➁ computation of line equation ➂ accumulation of the new factor

Multiplication is critical Comb right-to-left multiplier over ❋3m

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ 2 ×, 2 + ➁ ; t ← xP + xQ u ← yPyQ S ← −t2 ± uσ − tρ − ρ2 1 × (❋36m) R ← R · S ➂ bar foo

Sparse multiplication over ❋36m

❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-83
SLIDE 83

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates ➁ computation of line equation ➂ accumulation of the new factor

Multiplication is critical Comb right-to-left multiplier over ❋3m

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ 2 ×, 2 + ➁ ; t ← xP + xQ u ← yPyQ S ← −t2 ± uσ − tρ − ρ2 1 × (❋36m) R ← R · S ➂ bar foo 15 ×, 29 +

Sparse multiplication over ❋36m

◮ 15 × and 29 + over ❋3m (Beuchat et al., ARITH 18)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-84
SLIDE 84

Computing the non-reduced pairing

ηT pairing: shorter loop Based on Miller’s algorithm:

➀ update of point coordinates ➁ computation of line equation ➂ accumulation of the new factor

Multiplication is critical Comb right-to-left multiplier over ❋3m

for i ← 0 to (m − 1)/2 do end for yP ←

3

√yP yQ ← y 3

Q

xQ ← x3

Q

; ; xP ←

3

√xP R ← R · S t ← xP + xQ S ← −t2 ± uσ − tρ − ρ2 u ← yPyQ 2

3

√ · 2 (·)3 yP ←

3

√yP ; ; yQ ← y 3

Q

xP ←

3

√xP xQ ← x3

Q

➀ 2 ×, 2 + ➁ ; t ← xP + xQ u ← yPyQ S ← −t2 ± uσ − tρ − ρ2 1 × (❋36m) R ← R · S ➂ bar foo 15 ×, 29 + 12 ×, 59 +

Sparse multiplication over ❋36m

◮ 15 × and 29 + over ❋3m (Beuchat et al., ARITH 18) ◮ 12 × and 59 + over ❋3m (Gorla et al., SAC 2007) Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (24 / 49)

slide-85
SLIDE 85

Computing the non-reduced pairing

R ← R · S 12 ×, 59 + end for ➂ end for for i ← 1 to (m − 1)/2 do ; 2 (·)3 2

3

√ · yP[i] ←

3

  • yP[i − 1]

yQ[i] ← yQ[i − 1]3 xP[i] ←

3

  • xP[i − 1]

xQ[i] ← xQ[i − 1]3 ➀ First core ; ➁ 1 ×, 1 + 1 × 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 t ← xP[i] + xQ[i] for i ← 1 to (m − 1)/2 do Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (25 / 49)

slide-86
SLIDE 86

Computing the non-reduced pairing

R ← R · S 12 ×, 59 + end for ➂ end for for i ← 1 to (m − 1)/2 do ; 2 (·)3 2

3

√ · yP[i] ←

3

  • yP[i − 1]

yQ[i] ← yQ[i − 1]3 xP[i] ←

3

  • xP[i − 1]

xQ[i] ← xQ[i − 1]3 ➀ First core ; ➁ 1 ×, 1 + 1 × 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 t ← xP[i] + xQ[i] for i ← 1 to (m − 1)/2 do 1 × 1 ×, 1 + for i ← (m − 1)/4 + 1 to (m − 1)/2 do t ← xP[i] + xQ[i] Second core 12 ×, 59 + end for R0 ← R0 · S ➂ ➁ 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 1 ×, 1 + ➁ ➂ R1 ← R1 · S end for 12 ×, 59 + for i ← 1 to (m − 1)/4 do t ← xP[i] + xQ[i] S ← −t2 ± uσ − tρ − ρ2 u ← yP[i]yQ[i] 1 + 1 × Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (25 / 49)

slide-87
SLIDE 87

Computing the non-reduced pairing

R ← R · S 12 ×, 59 + end for ➂ end for for i ← 1 to (m − 1)/2 do ; 2 (·)3 2

3

√ · yP[i] ←

3

  • yP[i − 1]

yQ[i] ← yQ[i − 1]3 xP[i] ←

3

  • xP[i − 1]

xQ[i] ← xQ[i − 1]3 ➀ First core ; ➁ 1 ×, 1 + 1 × 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 t ← xP[i] + xQ[i] for i ← 1 to (m − 1)/2 do 1 × 1 ×, 1 + for i ← (m − 1)/4 + 1 to (m − 1)/2 do t ← xP[i] + xQ[i] Second core 12 ×, 59 + end for R0 ← R0 · S ➂ ➁ 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 1 ×, 1 + ➁ ➂ R1 ← R1 · S end for 12 ×, 59 + for i ← 1 to (m − 1)/4 do t ← xP[i] + xQ[i] S ← −t2 ± uσ − tρ − ρ2 u ← yP[i]yQ[i] 1 + 1 × 15 ×, 67 + R ← R0 · R1 Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (25 / 49)

slide-88
SLIDE 88

Computing the non-reduced pairing

R ← R · S 12 ×, 59 + end for ➂ end for for i ← 1 to (m − 1)/2 do ; 2 (·)3 2

3

√ · yP[i] ←

3

  • yP[i − 1]

yQ[i] ← yQ[i − 1]3 xP[i] ←

3

  • xP[i − 1]

xQ[i] ← xQ[i − 1]3 ➀ First core ; ➁ 1 ×, 1 + 1 × 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 t ← xP[i] + xQ[i] for i ← 1 to (m − 1)/2 do 1 × 1 ×, 1 + for i ← (m − 1)/4 + 1 to (m − 1)/2 do t ← xP[i] + xQ[i] Second core 12 ×, 59 + end for R0 ← R0 · S ➂ ➁ 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 1 ×, 1 + ➁ ➂ R1 ← R1 · S end for 12 ×, 59 + for i ← 1 to (m − 1)/4 do t ← xP[i] + xQ[i] S ← −t2 ± uσ − tρ − ρ2 u ← yP[i]yQ[i] 1 + 1 × 15 ×, 67 + R ← R0 · R1 ➁ 1 + 1 × 1 + 1 × 1 ×, 1 + 12 ×, 59 + 1 ×, 1 + 12 ×, 59 + end for ➂ R1 ← R1 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i]yQ[2i] t ← xP[2i] + xQ[2i] ➂ R1 ← R1 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i − 1]yQ[2i − 1] t ← xP[2i − 1] + xQ[2i − 1] for i ← (m − 1)/8 + 1 to (m − 1)/4 do 1 + 1 × 1 + 1 × 1 ×, 1 + 12 ×, 59 + 1 ×, 1 + 12 ×, 59 + end for ➂ R0 ← R0 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i]yQ[2i] t ← xP[2i] + xQ[2i] ➂ R0 ← R0 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i − 1]yQ[2i − 1] t ← xP[2i − 1] + xQ[2i − 1] for i ← 1 to (m − 1)/8 do ➁ ➁ ➁ Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (25 / 49)

slide-89
SLIDE 89

Computing the non-reduced pairing

R ← R · S 12 ×, 59 + end for ➂ end for for i ← 1 to (m − 1)/2 do ; 2 (·)3 2

3

√ · yP[i] ←

3

  • yP[i − 1]

yQ[i] ← yQ[i − 1]3 xP[i] ←

3

  • xP[i − 1]

xQ[i] ← xQ[i − 1]3 ➀ First core ; ➁ 1 ×, 1 + 1 × 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 t ← xP[i] + xQ[i] for i ← 1 to (m − 1)/2 do 1 × 1 ×, 1 + for i ← (m − 1)/4 + 1 to (m − 1)/2 do t ← xP[i] + xQ[i] Second core 12 ×, 59 + end for R0 ← R0 · S ➂ ➁ 1 + u ← yP[i]yQ[i] S ← −t2 ± uσ − tρ − ρ2 1 ×, 1 + ➁ ➂ R1 ← R1 · S end for 12 ×, 59 + for i ← 1 to (m − 1)/4 do t ← xP[i] + xQ[i] S ← −t2 ± uσ − tρ − ρ2 u ← yP[i]yQ[i] 1 + 1 × 15 ×, 67 + R ← R0 · R1 ➁ 1 + 1 × 1 + 1 × 1 ×, 1 + 12 ×, 59 + 1 ×, 1 + 12 ×, 59 + end for ➂ R1 ← R1 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i]yQ[2i] t ← xP[2i] + xQ[2i] ➂ R1 ← R1 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i − 1]yQ[2i − 1] t ← xP[2i − 1] + xQ[2i − 1] for i ← (m − 1)/8 + 1 to (m − 1)/4 do 1 + 1 × 1 + 1 × 1 ×, 1 + 12 ×, 59 + 1 ×, 1 + 12 ×, 59 + end for ➂ R0 ← R0 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i]yQ[2i] t ← xP[2i] + xQ[2i] ➂ R0 ← R0 · S S ← −t2 ± uσ − tρ − ρ2 u ← yP[2i − 1]yQ[2i − 1] t ← xP[2i − 1] + xQ[2i − 1] for i ← 1 to (m − 1)/8 do ➁ ➁ ➁ 1 + 1 × 1 + ➁ u1 ← yP[2i]yQ[2i] t1 ← xP[2i] + xQ[2i] u0 ← yP[2i − 1]yQ[2i − 1] t0 ← xP[2i − 1] + xQ[2i − 1] t1 ← xP[2i] + xQ[2i] u1 ← yP[2i]yQ[2i] ➁ 1 + 1 × 1 + 1 × 8 ×, 13 + for i ← 1 to (m − 1)/8 do ➂ 15 ×, 67 + R0 ← R0 · S (−t2

1 ± u1σ − t1ρ − ρ2)

S ← (−t2

0 ± u0σ − t0ρ − ρ2)·

end for u0 ← yP[2i − 1]yQ[2i − 1] t0 ← xP[2i − 1] + xQ[2i − 1] S ← (−t2

0 ± u0σ − t0ρ − ρ2)·

(−t2

1 ± u1σ − t1ρ − ρ2)

15 ×, 67 + R1 ← R1 · S ➂ end for for i ← (m − 1)/8 + 1 to (m − 1)/4 do 8 ×, 13 + 1 × Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (25 / 49)

slide-90
SLIDE 90

Agenda

1

Context

2

Hardware accelerator for the Tate pairing over supersingular curves Implementation Results in Hardware

3

Software accelerator for the Tate pairing over supersingular curves Computing the non-reduced pairing Final exponentiation Implementation results

4

Optimal Ate Pairing over Barreto-Naehrig Curves Barreto–Naehrig Curves

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (26 / 49)

slide-91
SLIDE 91

Final exponentiation

Final exponentiation consists of raising ˆ e(P, Q) to the exponent, M = 24m − 1 N = (22m − 1) · (2m + 1 − ν2(m+1)/2), where ν = (−1)b when m ≡ 1, 7 (mod 8) and ν = (−1)1−b in all

  • ther cases.

Highly sequential computation, Very heterogeneous

❋ ❋ ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (27 / 49)

slide-92
SLIDE 92

Final exponentiation

Final exponentiation consists of raising ˆ e(P, Q) to the exponent, M = 24m − 1 N = (22m − 1) · (2m + 1 − ν2(m+1)/2), where ν = (−1)b when m ≡ 1, 7 (mod 8) and ν = (−1)1−b in all

  • ther cases.

Highly sequential computation, Very heterogeneous We perform this operation according to a slightly optimized version:

◮ Raising to the (2m + 1)-th power. Raising the outcome of Miller’s

algorithm to the

  • 22m − 1
  • th power produces an element U ∈ ❋24m of
  • rder 22m + 1. This property allows one to save a multiplication over

❋24m when raising U to the (2m + 1)-th power. ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (27 / 49)

slide-93
SLIDE 93

Final exponentiation

Final exponentiation consists of raising ˆ e(P, Q) to the exponent, M = 24m − 1 N = (22m − 1) · (2m + 1 − ν2(m+1)/2), where ν = (−1)b when m ≡ 1, 7 (mod 8) and ν = (−1)1−b in all

  • ther cases.

Highly sequential computation, Very heterogeneous We perform this operation according to a slightly optimized version:

◮ Raising to the (2m + 1)-th power. Raising the outcome of Miller’s

algorithm to the

  • 22m − 1
  • th power produces an element U ∈ ❋24m of
  • rder 22m + 1. This property allows one to save a multiplication over

❋24m when raising U to the (2m + 1)-th power.

◮ Raising to the 2

m+1 2 -th power. raising an element of ❋24m to the 2i-th

power involves 4i squarings and at most four additions over ❋2m

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (27 / 49)

slide-94
SLIDE 94

Final exponentiation

Final exponentiation consists of raising ˆ e(P, Q) to the exponent, M = 24m − 1 N = (22m − 1) · (2m + 1 − ν2(m+1)/2), where ν = (−1)b when m ≡ 1, 7 (mod 8) and ν = (−1)1−b in all

  • ther cases.

Highly sequential computation, Very heterogeneous We perform this operation according to a slightly optimized version:

◮ Raising to the (2m + 1)-th power. Raising the outcome of Miller’s

algorithm to the

  • 22m − 1
  • th power produces an element U ∈ ❋24m of
  • rder 22m + 1. This property allows one to save a multiplication over

❋24m when raising U to the (2m + 1)-th power.

◮ Raising to the 2

m+1 2 -th power. raising an element of ❋24m to the 2i-th

power involves 4i squarings and at most four additions over ❋2m

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (27 / 49)

slide-95
SLIDE 95

Finite field arithmetic

Target: multi-core architectures ❋ ❋ ❋ ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (28 / 49)

slide-96
SLIDE 96

Finite field arithmetic

Target: multi-core architectures Arithmetic over ❋2m and ❋3m: SSE instruction set ❋ ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (28 / 49)

slide-97
SLIDE 97

Finite field arithmetic

Target: multi-core architectures Arithmetic over ❋2m and ❋3m: SSE instruction set Timings are given in clock cycles and were measured on an Intel Core 2 processor working at 2.4 GHz. Field xp

p

√x Mult Aranha et al. CT-RSA’10 ❋21223 160 166 4030 Our work CANS’10 ❋21223 480 749 5438 ❋3509 900 974 4128

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (28 / 49)

slide-98
SLIDE 98

Agenda

1

Context

2

Hardware accelerator for the Tate pairing over supersingular curves Implementation Results in Hardware

3

Software accelerator for the Tate pairing over supersingular curves Computing the non-reduced pairing Final exponentiation Implementation results

4

Optimal Ate Pairing over Barreto-Naehrig Curves Barreto–Naehrig Curves

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (29 / 49)

slide-99
SLIDE 99

Implementation results

Timings achieved on an Intel Core2 are given in millions of clock cycles Windows XP 64-bit SP2 environment

❋ ❋ ❋ ❋ ❋ ❋

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (30 / 49)

slide-100
SLIDE 100

Implementation results

Timings achieved on an Intel Core2 are given in millions of clock cycles Windows XP 64-bit SP2 environment

Curve Security # of Freq. Calc. [bits] cores [GHz] time [Mcycles] E(❋21223) 128 1 2.4 18.76 Aranha et al. E(❋21223) 128 2 2.4 10.08 CT-RSA’10 E(❋21223) 128 4 2.4 5.72 Our work E(❋3509) 128 1 2.4 18.2 CANS’10 E(❋3509) 128 2 2.4 10.34 E(❋3509) 128 4 2.4 7.06

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (30 / 49)

slide-101
SLIDE 101

Software implementation notes: The supersingular case

Significantly faster implementation (for a while)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (31 / 49)

slide-102
SLIDE 102

Software implementation notes: The supersingular case

Significantly faster implementation (for a while) How many cores?

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (31 / 49)

slide-103
SLIDE 103

Software implementation notes: The supersingular case

Significantly faster implementation (for a while) How many cores?

◮ acceleration always less than the ideal speedup factor ◮ best choice: dual-core implementation Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (31 / 49)

slide-104
SLIDE 104

Software implementation notes: The supersingular case

Significantly faster implementation (for a while) How many cores?

◮ acceleration always less than the ideal speedup factor ◮ best choice: dual-core implementation

Characteristic 3 performs better than characteristic 2

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (31 / 49)

slide-105
SLIDE 105

Software implementation notes: The supersingular case

Significantly faster implementation (for a while) How many cores?

◮ acceleration always less than the ideal speedup factor ◮ best choice: dual-core implementation

Characteristic 3 performs better than characteristic 2

◮ at least on Intel Core2 and Intel Core i7 Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (31 / 49)

slide-106
SLIDE 106

Software implementation notes: The supersingular case

Significantly faster implementation (for a while) How many cores?

◮ acceleration always less than the ideal speedup factor ◮ best choice: dual-core implementation

Characteristic 3 performs better than characteristic 2

◮ at least on Intel Core2 and Intel Core i7 ◮ next generation of processors: built-in carry-less 64-bit multiplier ◮ the battle is not over! Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (31 / 49)

slide-107
SLIDE 107

Agenda

1

Context

2

Hardware accelerator for the Tate pairing over supersingular curves Implementation Results in Hardware

3

Software accelerator for the Tate pairing over supersingular curves Computing the non-reduced pairing Final exponentiation Implementation results

4

Optimal Ate Pairing over Barreto-Naehrig Curves Barreto–Naehrig Curves

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (32 / 49)

slide-108
SLIDE 108

Barreto–Naehrig Curves

Defined by the equation E : y2 = x3 + b, where b = 0. Their embedding degree k is equal to 12. The characteristic p of the prime field, the group

  • rder r, and the trace of Frobenius tr of the curve are parametrized as

follows: p(t) = 36t4 + 36t3 + 24t2 + 6t + 1, r(t) = 36t4 + 36t3 + 18t2 + 6t + 1, (1) tr(t) = 6t2 + 1, where t ∈ Z is an arbitrary integer such that p = p(t) and r = r(t) are both prime numbers. For efficiency purposes, t must have a low Hamming weight. In this work we used, t = 262 − 254 + 244

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (33 / 49)

slide-109
SLIDE 109

Barreto–Naehrig Curves

Let E[r] denote the r-torsion subgroup of E and πp be the Frobenius endomorphism πp : E → E given by πp(x, y) = (xp, yp). We define, G1 = E(Fp)[r], G2 ⊆ E(Fp12)[r], Gτ = µr ⊂ F∗

p12 (i.e. the group of r-th roots of unity).

The optimal ate pairing on the BN curve E is given as, aopt : G2 × G1 − → G3 (Q, P) − →

  • f6t+2,Q(P) · l[6t+2]Q,πp(Q)(P) ·

l[6t+2]Q+πp(Q),−π2

p(Q)(P)

p12−1

r

, In practice, pairing computations can be restricted to points P and Q′ that belong to E(Fp) and E ′(Fp2), respectively, where, E ′/Fp2 : y2 = x3 + b/ξ.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (34 / 49)

slide-110
SLIDE 110

Optimal ate pairing algorithm

Input: P ∈ ●1 y Q ∈ ●2. Output: aopt(Q, P).

  • 1. Write s = 6t + 2 as s = L−1

i=0 si2i, where si ∈ {−1, 0, 1};

  • 2. T ← Q, f ← 1;
  • 3. for i = L − 2 to 0 do

4.

f ← f 2 · lT,T(P); T ← 2T;

5.

if si = −1 then

6.

f ← f · lT,−Q(P); T ← T − Q;

7.

else if si = 1 then

8.

f ← f · lT,Q(P); T ← T + Q;

9.

end if

  • 10. end for
  • 11. Q1 ← πp(Q); Q2 ← πp2(Q);
  • 12. f ← f · lT,Q1(P); T ← T + Q1;
  • 13. f ← f · lT,−Q2(P); T ← T − Q2;
  • 14. f ← f (p12−1)/r;
  • 15. return f ;

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (35 / 49)

slide-111
SLIDE 111

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

❋ ❋ ❋ ❋ Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-112
SLIDE 112

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

❋ ❋ ❋ ❋ Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-113
SLIDE 113

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

❋ ❋ ❋ ❋ β = −5 Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-114
SLIDE 114

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

❋ ❋ ❋ ❋ β = −5 ξ = u Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-115
SLIDE 115

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

❋ ❋ ❋ ❋ β = −5 ξ = u γ = v Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-116
SLIDE 116

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

❋ f = g + hw ∈ ❋p12, with g, h ∈ ❋p6. but also g = g0+g1v+g2v2, h = h0+h1v +h2v2, where gi, hi ∈ ❋p2, for i = 1, 2, 3. Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-117
SLIDE 117

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (36 / 49)

hence, we can write f ∈ ❋p12 as f = g + hw = g + hw = g0 + h0W + g1W 2 + h1W 3 + g2W 4 + h2W 5. ❋ ❋ ❋ Since p mod 12 ≡ 1 we can build the towering up to the twelfth extension by adjoining irreducible binomial only.

slide-118
SLIDE 118

Let (a, m, s, i), (˜ a, ˜ m,˜ s,˜ i), and (A, M, S, I) denote the cost of field addition, multiplication, squaring, and inversion in ❋p, ❋p2, and ❋p6, respectively we sometimes need to compute the multiplication in the base field by the constant coefficient β ∈ Fp of the irreducible binomial f (u) = u2 − β. We refer to this operation as mβ we sometimes need to compute the multiplication of an arbitrary element in Fp2 times the constant ξ = u ∈ Fp at a cost of one multiplication by the constant β. We refer to this operation as mξ, but it is noticed that the cost of mξ is essentially the same of that of mβ.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (37 / 49)

slide-119
SLIDE 119

Computational costs of the tower extension field arithmetic

Field Add/Sub Mult Squaring Inversion Fp2 ˜ a = 2a ˜ m = 3m + 3a + mβ ˜ s = 2m + 3a + mβ ˜ i = 4m + mβ +2a + i Fp6 3˜ a 6 ˜ m + 2mξ + 15˜ a 2 ˜ m + 3˜ s + 2mξ + 8˜ a 9 ˜ m + 3˜ s + 4mξ +4˜ a +˜ i Fp12 6˜ a 18 ˜ m + 6mξ + 60˜ a 12 ˜ m + 4mξ + 45˜ a 25 ˜ m + 9˜ s + 12mξ +61˜ a +˜ i GΦ6(Fp2) 6˜ a 18 ˜ m + 6mξ + 60˜ a 9˜ s + 4mξ Conjugate +30˜ a

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (38 / 49)

slide-120
SLIDE 120

We took advantage of the following design decisions, The bit-length of 6t + 2 is L = 65

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (39 / 49)

slide-121
SLIDE 121

We took advantage of the following design decisions, The bit-length of 6t + 2 is L = 65

◮ This implies that we require 64 point doubling in the Miller loop. Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (39 / 49)

slide-122
SLIDE 122

We took advantage of the following design decisions, The bit-length of 6t + 2 is L = 65

◮ This implies that we require 64 point doubling in the Miller loop.

The Hamming weight of 6t + 2 is 7

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (39 / 49)

slide-123
SLIDE 123

We took advantage of the following design decisions, The bit-length of 6t + 2 is L = 65

◮ This implies that we require 64 point doubling in the Miller loop.

The Hamming weight of 6t + 2 is 7

◮ This implies that we require 6 point addition/subtraction in the Miller

loop.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (39 / 49)

slide-124
SLIDE 124

We took advantage of the following design decisions, The bit-length of 6t + 2 is L = 65

◮ This implies that we require 64 point doubling in the Miller loop.

The Hamming weight of 6t + 2 is 7

◮ This implies that we require 6 point addition/subtraction in the Miller

loop.

The low Hamming weight of t allows us to save arithmetic operations in the hard part of the final exponentiation

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (39 / 49)

slide-125
SLIDE 125

Mille Loop Cost

Miller Loop = 64 · (28 ˜ m + 8˜ s + 100˜ a + 4m + 6mβ) + 6 · (20 ˜ m + 7˜ s + 64˜ a + 4m + 2mβ) + 40 ˜ m + 14˜ s + 128˜ a + 14m + 4mβ = 1952 ˜ m + 568˜ s + 6912˜ a + 294m + 400mβ.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (40 / 49)

slide-126
SLIDE 126

Calculating the final Exponentiation

We must compute f ∈ Fp12 raised to the power e = (p12 − 1)/r

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (41 / 49)

slide-127
SLIDE 127

Calculating the final Exponentiation

We must compute f ∈ Fp12 raised to the power e = (p12 − 1)/r e = p12 − 1 r = (p6 − 1) · (p2 + 1) · p4 − p2 + 1 r .

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (41 / 49)

slide-128
SLIDE 128

Calculating the final Exponentiation

We must compute f ∈ Fp12 raised to the power e = (p12 − 1)/r e = p12 − 1 r = (p6 − 1) · (p2 + 1) · p4 − p2 + 1 r . Raising to f (p6−1) = ¯ f · f −1 costs one conjugation, one inversion and

  • ne multiplication over Fp12.

After this step, f becomes an element of the cyclotomic group GΦ6(Fp2).

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (41 / 49)

slide-129
SLIDE 129

Calculating the final Exponentiation

We must compute f ∈ Fp12 raised to the power e = (p12 − 1)/r e = p12 − 1 r = (p6 − 1) · (p2 + 1) · p4 − p2 + 1 r . Raising to f (p6−1) = ¯ f · f −1 costs one conjugation, one inversion and

  • ne multiplication over Fp12.

After this step, f becomes an element of the cyclotomic group GΦ6(Fp2). Raising to the power p2 + 1 costs 5 multiplications over Fp, and one multiplication over Fp12.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (41 / 49)

slide-130
SLIDE 130

Calculating the final Exponentiation

We must compute f ∈ Fp12 raised to the power e = (p12 − 1)/r e = p12 − 1 r = (p6 − 1) · (p2 + 1) · p4 − p2 + 1 r . Raising to f (p6−1) = ¯ f · f −1 costs one conjugation, one inversion and

  • ne multiplication over Fp12.

After this step, f becomes an element of the cyclotomic group GΦ6(Fp2). Raising to the power p2 + 1 costs 5 multiplications over Fp, and one multiplication over Fp12. Raising to the power m(p4−p2+1)/r is referred as the hard part of the final exponentiation

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (41 / 49)

slide-131
SLIDE 131

Hard part of the final exponentiation

We used the addition chain proposed by Scott et al. at Pairing’09 mt, mt2, mt3, mp, mp2, mp3, m(tp), m(t2p), m(t3p), m(t2p2),

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (42 / 49)

slide-132
SLIDE 132

Hard part of the final exponentiation

We used the addition chain proposed by Scott et al. at Pairing’09 mt, mt2, mt3, mp, mp2, mp3, m(tp), m(t2p), m(t3p), m(t2p2), Taking advantage of the Frobenius, we can easily compute, mp, mp2, mp3, m(tp), m(t2p), m(t3p), y m(t2p2) at a cost of 35 multiplications in the base field Fp.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (42 / 49)

slide-133
SLIDE 133

Hard part of the final exponentiation

We used the addition chain proposed by Scott et al. at Pairing’09 mt, mt2, mt3, mp, mp2, mp3, m(tp), m(t2p), m(t3p), m(t2p2), Taking advantage of the Frobenius, we can easily compute, mp, mp2, mp3, m(tp), m(t2p), m(t3p), y m(t2p2) at a cost of 35 multiplications in the base field Fp. The most costly part of this procedure consists on the computation of mt, mt2 = (mt)t, mt3 = (mt2)t. Since t = 262 − 254 + 244, these exponentiations can be computed at a cost of 62 · 3 = 186 cyclotomic squarings plus 2 · 3 = 6 multiplications over Fp12.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (42 / 49)

slide-134
SLIDE 134

Final exponentiation computational cost

  • Exp. Final

= (25 ˜ m + 9˜ s + 12mβ + 61˜ a +˜ i) + (18 ˜ m + 6mβ + 60˜ a) + (18 ˜ m + 6mβ + 60˜ a) + 10m + 13 · (18 ˜ m + 6mβ + 60˜ a) + 4 · (9˜ s + 4mβ + 30˜ a) + 70m + 186 · (9˜ s + 4mβ + 30˜ a) + 6 · (18 ˜ m + 6mβ + 60˜ a) = 403 ˜ m + 1719˜ s + 7021˜ a + 80m + 898mβ +˜ i.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (43 / 49)

slide-135
SLIDE 135

A Comparison of arithmetic operations required by the computation of the ate pairing variants.

˜ m ˜ s ˜ a ˜ i mξ Hankerson et al.

[Book chapter, 2007]

Miller Loop 2277 356 6712 1 412 R-ate pairing Final Exp. 1616 1197 8977 1 1062 Total 3893 1553 15689 2 1474 Naehrig et al.

[LatinCrypt 2010]

Miller Loop 2022 590 7140 410 Optimal ate pairing Final Exp. 678 1719 7921 1 988 Total 2700 2309 15061 1 1398 This work [Pairing 2010] Miller Loop 1954 568 6912 400 Optimal ate pairing Final Exp 443 1719 7021 1 898 Total 2397 2287 13933 1 1298

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (44 / 49)

slide-136
SLIDE 136

Library Implementation

We use the mul operation included in the x86-64 instruction set. It multiplies two 64-bit unsigned integers in about 3 clock cycles on Intel Core i7 and AMD Opteron processors An element x ∈ Fp is represented as x = (x3, x2, x1, x0), where xi, 0 ≤ i ≤ 3, are 64-bit integers Multiplication and inversion over Fp are accomplished according to the well-known Montgomery multiplication and Montgomery inversion algorithms, respectively The 256-bit integer multiplication and Montgomery reduction are computed in 55 and 100 clock cycles, respectively

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (45 / 49)

slide-137
SLIDE 137

Cycle counts of multiplication over Fp2, squaring over Fp2, and optimal ate pairing on different machines

Our results Core i7a Opteronb Core 2 Duoc Athlon 64 X2d Multiplication over Fp2 435 443 558 473 Squaring over Fp2 342 355 445 376 Miller loop 1,330,000 1,360,000 1,680,000 1,480,000 Final exponentiation 1,000,000 1,040,000 1,270,000 1,150,000 Optimal ate pairing 2,330,000 2,400,000 2,950,000 2,630,000

a Intel Core i7 860 (2.8GHz), Windows 7, Visual Studio 2008 Professional b Quad-Core AMD Opteron 2376 (2.3GHz), Linux 2.6.18, gcc 4.4.1 c Intel Core 2 Duo T7100 (1.8GHz), Windows 7, Visual Studio 2008 Professional d Athlon 64 X2 Dual Core 6000+(3GHz), Linux 2.6.23, gcc 4.1.2 e Intel Core 2 Quad Q6600 (2394MHz), Linux 2.6.28, gcc 4.3.3 Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (46 / 49)

slide-138
SLIDE 138

Comparison Table

A comparison of cycles and timings required by the computation of the ate pairing variants. The frequency is given in GHz and the timings are in milliseconds.

Alg. Architecture Cycles Freq. Calc. time Aranha et al. [CT-RSA 2010] ηT Intel Xeon 45nm (1 core) 17,400,000 2.0 8.70 Intel Xeon 45nm (8 cores) 3,020,000 1.51 Beuchat et al. [CANS 2009] ηT Intel Core i7 (1 core) 15,138,000 2.9 5.22 Intel Core i7 (8 cores) 5,423,000 1.87 Hankerson et al. R-ate Intel Core 2 10,000,000 2.4 4.10 Naehrig et al. eprint 2010/526, April.6.2010 aopt Intel Core 2 Quad Q6600 4,470,000 2.4 1.80 Fan et al. CHES’09 “R-ate” 130 nm ASIC 59,976 .204 2.91 This Work eprint 2010/526, jun.17.2010 aopt Intel Core i7 2,330,000 2.8 0.83 Aranha et al. eprint 2010/526, oct.19.2010 aopt Intel Core i7 1,703,000 2.8 0.608 Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (47 / 49)

slide-139
SLIDE 139

Software Implementation notes on ordinary curves

records do not last long in software!

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (48 / 49)

slide-140
SLIDE 140

Software Implementation notes on ordinary curves

records do not last long in software!

However, in hardware the performance records hold longer: Fan et al. CHES’09 and Beuchat et al. CHES’09 are still the fastest hardware accelerators for ordinary and supersingular curves, respectively.

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (48 / 49)

slide-141
SLIDE 141

Software Implementation notes on ordinary curves

records do not last long in software!

However, in hardware the performance records hold longer: Fan et al. CHES’09 and Beuchat et al. CHES’09 are still the fastest hardware accelerators for ordinary and supersingular curves, respectively. Future projects/open problems,

◮ To target higher security levels in software implementation of pairings

(e.g, 192 bits of security)

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (48 / 49)

slide-142
SLIDE 142

Software Implementation notes on ordinary curves

records do not last long in software!

However, in hardware the performance records hold longer: Fan et al. CHES’09 and Beuchat et al. CHES’09 are still the fastest hardware accelerators for ordinary and supersingular curves, respectively. Future projects/open problems,

◮ To target higher security levels in software implementation of pairings

(e.g, 192 bits of security)

◮ To design a hardware accelerator faster than any software library for

asymmetric pairings over BN curves at 128-bit of security

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (48 / 49)

slide-143
SLIDE 143

Software Implementation notes on ordinary curves

records do not last long in software!

However, in hardware the performance records hold longer: Fan et al. CHES’09 and Beuchat et al. CHES’09 are still the fastest hardware accelerators for ordinary and supersingular curves, respectively. Future projects/open problems,

◮ To target higher security levels in software implementation of pairings

(e.g, 192 bits of security)

◮ To design a hardware accelerator faster than any software library for

asymmetric pairings over BN curves at 128-bit of security

◮ to implement efficient pairing-based protocols in software and/or

hardware

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (48 / 49)

slide-144
SLIDE 144

Software Implementation notes on ordinary curves

records do not last long in software!

However, in hardware the performance records hold longer: Fan et al. CHES’09 and Beuchat et al. CHES’09 are still the fastest hardware accelerators for ordinary and supersingular curves, respectively. Future projects/open problems,

◮ To target higher security levels in software implementation of pairings

(e.g, 192 bits of security)

◮ To design a hardware accelerator faster than any software library for

asymmetric pairings over BN curves at 128-bit of security

◮ to implement efficient pairing-based protocols in software and/or

hardware

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (48 / 49)

slide-145
SLIDE 145

Thank you for your attention

Questions?

Francisco Rodr´ ıguez-Henr´ ıquez Faster Implementation of Pairings (49 / 49)