SlideShare a Scribd company logo
Efficient Implementation of
Cryptographic pairings
Mike Scott
Dublin City University
First Steps
 To do Pairing based Crypto we need
two things
 Efficient algorithms
 Suitable elliptic curves
 We have got both! (Maybe not quite
enough suitable curves?)
What’s a Pairing?
 e(P,Q) where P and Q are points on
an elliptic curve.
 It has the property of bilinearity
 e(aP,bQ) = e(bP,aQ) = e(P,Q)ab
 We use the Tate pairing.
Hard problems…
1. Given aP and P, its hard to find a
2. Given e(P,Q)a and e(P,Q) its hard
to find a.
3. Given {P,sP,aP,Q,sQ,bQ} its hard
to find e(P,Q)sab
Making it secure
 Recall that on a pairing friendly
elliptic curve E(Fq), the curve order
has a large prime divisor r, and
where k is the smallest integer such
that r|qk-1
 k is the embedding degree, a.k.a.
the security multiplier
 Pairings evaluates as element in Fqk
Making it secure
 If r is 160-bits, then Pohlig-Hellman
attacks will take ~ 280 steps
 If k.lg(q) ~ 1024 bits, Discrete Log
attacks will also take ~ 280 steps
 So we can achieve appropriate
levels of cryptographic security
Modified Tate Pairing
 Supersingular curves support a distortion
map, Φ(Q) which evaluates as a point on
E(Fqk) if Q is on E(Fq).
 So choose P and Q on E(Fq), then
ê(P,Q) =e(P, Φ(Q))
 Is an alternative, nicer (Type 1) pairing,
with the extra property ê(P,Q) = ê(Q,P)
A quick protocol..
 Sakai and Kasahara non-interactive
ID-based key exchange.
 A trusted authority with secret s
give Alice sA, where A is derived in
a public way from Alices identity.
 The trusted authority gives Bob sB.
 They share a key ê (sA,B)=ê (sB,A)!
 No interaction required!
What choices?
 If q=p a prime, maximum k=2
 If q=2m, maximum k=4
 If q=3m, maximum k=6
 We need group size r ≥ 160 bits
 We need qk ~ 1024 bits
 We know r | q+1-t
 (t is trace of the Frobenius ≤ 2 √q)
Constrained…
 These constraints are… well…
constraining!
 I have an irrational aversion to F3m!
 So what about Hyperelliptic curves…?
 Not very promising in practice…
 Fortunately, we have an alternative
choice – certain families of ordinary
elliptic curves over Fp
Ordinary Elliptic Curves
 There are the MNT curves, with
k={3,4,6}
 There are Freeman curves with
k=10
 There are Barreto-Naehrig curves
with k=12
Ordinary Elliptic Curves
 These curves all have r~p, which is
nice, as it means P can be over the
smallest possible field for given
level of security
 If we relax this, many more families
can be found (e.g. Brezing-Weng)
 If we allow lg(r) ≤ 2.lg(p) then
curves for any k are plentiful
(Cocks-Pinch)
The bad news..
 No distortion map  (Type 3 pairing)
 In e(P,Q), while P can be in E(Fp), Q
cannot.
 The best we can do is to put Q on a
lower order “twist” E(Fpk/w), where always
w=2, (but w=4 and w=6 are possible).
 For example for BN curves we can use
w=6 and put Q on E(Fp2)
 e(P,Q) ≠ e(Q,P)
Implementation
 For simplicity (for now)
 Assume k=2d, d=1, p=3 mod 4
 Elements in Fp2 can be represented
as (a+ib), where a and b are in Fp
and i=√-1 because -1 is a quadratic
non-residue (think “imaginary
number”)
 Assume P is in E(Fp), Q in E(Fp2)
Basic Algorithm for e(P,Q)
m ← 1, T ← P
for i=lg(r)-1 downto 0 do
m ← m2.lT,T (Q)/v2T(Q)
T ← 2.T
if ri = 1
m ← m.lT,P(Q)/vT+P(Q)
T=T+P
end if
end for Millers Algorithm
m ← m(p-1) Final Exponentiation
return m(p+1)/r
lT,T(Q) = (yq-yj) – λj(xq-xj)
v2T(Q) =xq-xj+1
Explaining the Algorithm
Q(xq,yq)
T=(xj,yj)
xq-xj
yq-yj
Line of slope λj
xj+1,yj+1
Optimizations
 Choose r to have a low Hamming weight
 By cunning choice of Q as a point on the
twisted curve and using only even k=2d,
the v(.) functions become elements in Fpd
and hence get “wiped out” by the final
exponentiation, which always includes pd-1
as a factor of the exponent.
 Now the algorithm simplifies to…
Improved Algorithm
m ← 1, T ← P
for i=lg(r)-1 downto 0 do
m ← m2.lT,T (Q)
T ← 2.T
if ri = 1
m ← m.lT,P(Q)
T=T+P
end if
end for
m ← m(p-1)
return m(p+1)/r
A useful Observation..
 Observe the line m ← m(p-1)
 Part of the final exponentiation –
raising to the power of (pk-1)/r
 Now for any c in Fp, c(p-1) = 1 mod p
(Fermat)
 Therefore m can be multiplied by
any constant at any time in the
Miller loop without effecting the
final result!
Further optimization ideas
 Truncate the loop in Miller’s
algorithm, and still get a viable
pairing.
 Optimize the final exponentiation
 Exploit the Frobenius – an element
of any extension field Fqk can easily
be raised to any power of q. For
example in Fp2
(a+ib)p = (a-ib)
Further optimization ideas
 Precomputation!
 If P is fixed, all the T values can be
precomputed and stored – with
significant savings.
 P may be a fixed public value or a
fixed secret key – depends on the
protocol.
The ηT pairing - 1
 For the supersingular curves of low
characteristic, the basic algorithm
can be drastically simplified by
integrating the distortion map, the
point multiplication, and the action
of the Frobenius directly into the
main Miller loop. Also exploits the
simple group order. This is a Type 1
pairing.
The ηT pairing - 2
 In characteristic 2, k=4.
 r =2m ± 2[(m+1)]/2 + 1
 Elements in F2m are represented as a
polynomial with m coefficients in F2
 Elements in the extension field F24m are
represented as a polynomial with 4
coefficients in F2m
 e.g. a+bX+cX2+dX3 represented as
[a,b,c,d].
The ηT pairing - 3
 Let s=[0,1,1,0] and t=[0,1,0,0] (derived
from the distortion map)
 Then on the supersingular curve
y2+y=x3+x+b, where b=0 or 1
 And m= 3 mod 8
 A pairing e(P,Q), where P=(xP,yP) and
Q=(xQ,yQ), can be calculated as
The ηT pairing - 4
u←xP+1
f←u(xP+xQ+1)+yP+yQ+b+1+(u+xQ)s+t
for i=1 to (m+1)/2 do
u←xP xP←√xP yP←√yP
g←u(xP+xQ)+yP+yQ+xP+(u+xQ)s+t
f←f.g xQ←xQ
2 yQ←yQ
2
end for
return f(22m-1)(2m-2(m+1)/2 +1)
The ηT pairing - 5
 This is very fast! <5 seconds on an
msp430 wireless sensor network
node, with m=271 (C – no asm)
 Note truncated loop (m+1)/2.
 Final exponentiation very fast using
Frobenius.
 Ideal in low power, resource
constrained environment.
Ate Pairing for ordinary curves E(Fp)
 Truncated Loop pairing, related to Tate pairing.
 Number of iterations in Miller loop may be much
shorter – lg(t-1) instead of lg(r), and for some
families of curves t can be much less than r
 Parameters “change sides”, now P is on the
twisted curve and Q is on the curve over the
base field.
 Works particularly well with curves that allow a
higher order (sextic) twist.
Extension Field Arithmetic
 For non-supersingular curves over
Fpk there is a need to implement
very efficient extension field
arithmetic.
 A new challenge for cryptographers
(although XTR and OEFs require it)
 Simple generic polynomial
representation will be slow, and
misses optimization opportunities.
Towering extensions
 Consider p=5 mod 8
 Then a suitable representation for
Fp2 would be (a+xb), where a,b are
in Fp, x=(-2)1/2, as -2 will be a QNR.
 Then a suitable representation for
Fp4 would be (a+xb), where a,b are
in Fp2, x=(-2)1/4
 Etc!
Towering extensions
 In practise it may be sufficient to
restrict k=2i3j for i≥1, j≥0, as this
covers most useful cases.
 So only need to deal with cubic and
quadratic towering.
 These need only be efficiently
developed once (using Karatsuba,
fast squaring, inversion, square
roots etc.)
Multiplication & Squaring
(quadratic extension)
 Using Karatsuba..
 (a+ib)(c+id) = ac-
bd+i[(a+b)(c+d)-ac-bd]
 Requires 3 modmuls…
 OR 3 multiplications and 2 modular
reductions (“lazy” reduction)
 (a+ib)(a+ib)=(a+b)(a-b)+i.2ab
Multiplication & Squaring
(cubic extension)
 Toom-Cook for multiplication?
 Chung-Hasan for squaring?
 A problem with both methods is the
requirement for division by small
constants…
 Not a problem thanks to the “useful
observation”!
Choice of irreducible polynomial
 A binomial is the simplest, xn+δ,
and the easiest to tower over.
 For example for k=12 BN curves
 X6+(1+√-2) as a sextic tower over
x2+2, where (1+√-2) is neither a
cube nor a square.
 ..and so the sextic extension can be
constructed as a cubic over a
quadratic
Choice of irreducible polynomial
 In general the k-th extension can
often be constructed as
xk/2+(α+√β) towered over x2+√β,
where α, β in {-1,+1,-2,+2}
 In practise this seems to work well,
and the small values for α, β lead to
useful speed-ups.
 Not too restrictive..
The Final Exponentiation - 1
 Note that the exponent is (pk-1)/r
 This is a number dependent only on
fixed, system parameters
 So maybe we can choose p, k and r
to make it easier (Low Hamming
Weight?)
 If k=2d is even then
(pk-1)/r = (pd-1).[(pd+1)/r]
The Final Exponentiation - 2
 We know that r divides (pd+1) and
not (pd-1) from the definition of k.
 Exponentiation to the power of pd is
“for free” using the Frobenius, so
exponentiation to the power of pd-1
costs just a Frobenius and a single
extension field division – cheap!
The Final Exponentiation - 3
 In fact we know that the
factorisation of (pk-1) always
includes Φk(p), where Φk(.) is the k-
th cyclotomic polynomial, and that
r|Φk(p).
 For example
p6-1 = (p3-1)(p+1)(p2-p+1)
 Where Φ6(p) = p2-p+1
The Final Exponentiation - 4
 So the final exponent is general
breaks down as…
(pd-1).[(pd+1)/Φk(p)].Φk(p)/r
 All except the final Φk(p)/r part can
be easily dealt with using the
Frobenius.
The Final Exponentiation - 5
 However this “hard” exponent e can
always be represented to base p as
e=e0+e1p+e2p2…
fe = fe0
+e1
p+e2
p2… = fe0 .(fp)e1.(fp2
)e2…
 Which can be calculated using the
Frobenius and the well known method of
multi-exponentiation.
The Final Exponentiation - 6
 Another idea is to exploit the special
form of the “hard part” of the final
exponentiation for a particular curve
 If k is divisible by 2 the pairing
value can be “compressed” times 2
and Lucas exponentiation used.
 If k is divisible by 3 the pairing
value can be “compressed” times 3
and XTR exponentiation used.
Case study – k=6 MNT curves
 Assuming a prime order curve, then
the hard part of the final exponent
is (p2-p+1)/r, where r=p+1-t
 Then the exponent is p±σ, where σ
~ t
 So the final exponentiation is fp.f±σ
 Which just costs a Frobenius and
one half-length exponentiation!
Products of pairings
 Arises in many protocols
 e(P,Q).e(R,S)  3 ideas
 The multiplication of P and R by r occur
in “lock-step”, so use Montgomery’s
trick, affine coordinates, only one
modular inversion
 Share the “Miller variable” m (so only
one squaring of m in the Miller loop)
 Share the final exponentiation
Implementation – more complex than RSA or ECC!
 There are many choices of curves,
and of embedding degrees, and of
pairings. It is not at all obvious
which is “best” for any given
application. The optimal pairing to
use depends not just on the
security level, but also on the
protocol to be implemented.
Implementation – more complex than RSA or ECC!
 For example (a) p~512 bits and k=2, or
(b) p~170 bits and k=6 MNT curve?
 On the face of it same security.
 Smaller p size means faster base field point
multiplications – so (b) looks better
 Which is important only if point multiplications are
required by the protocol.
 (a) pairing is much faster if precomputation is possible
 (b) must be used for short signatures
 (b) requires Q on the twist E’(Fp3) which is more complicated than
(a) for which Q can be on E’(Fp)
 The (b) curves are hard to find, whereas (a) types are plentiful.
 (a) is much simpler to implement with the smaller extension.. Smaller code
Implementation – more complex than RSA or ECC!
 For maximum efficiency each
implementation must be highly
specialised according to its
parameters.
 A k=2 Cocks-Pinch implementation
will be quite different from a k=6
MNT implementation.
Some timings – 80-bit security
 32-bit 3GHz PIV
 Tate Pairing
 k=2, p~512 bits Cocks-Pinch
 w/o precomp. = 6.7ms
 With precomp. = 3.0ms
 Point mul. = 2.9ms
Some timings – 80-bit security
 32-bit 3GHz PIV
 Tate Pairing
 k=2, p~512 bits with Efficient
Endomorphism (Scott ’05)
 w/o precomp. = 5.1ms
 With precomp. = 3.0ms
 Point mul. = 1.9ms
Some timings – 80-bit security
 32-bit 3GHz PIV
 Ate pairing
 k=4, p~256 bits FST curve
 w/o precomp. = 9.1ms
 With precomp. = 3.1ms
 Point mul. = 1.1ms
Some timings – 80-bit security
 32-bit 3GHz PIV
 Tate pairing
 k=6, p~160 bits MNT curve
 w/o precomp. = 6.2ms
 With precomp. = 4.5ms
 Point mul. = 0.6ms
Some timings – 80-bit security
 8-bit 16MHz Atmel128
 Tate pairing
 k=4, p~256 bits MNT curve
 With precomp. = 7.75 seconds
Some timings – 80-bit security
 8-bit 16MHz Atmel128
 ηT pairing
 k=4, m=271 bits, supersingular
curve
 w/o precomp = 2.6 seconds
Some timings – 128-bit security
 3.4GHz PIV 32-bit
 Tate pairing
 k=12, p~256 bits BN curve
 w/o precomp. = 34.0ms
 Ate pairing
 w/o precomp. = 23.2ms
Questions Anyone?

More Related Content

What's hot

P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
S.Shayan Daneshvar
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Sahil Kumar
 
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithmno U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
Christian Robert
 
A Note on TopicRNN
A Note on TopicRNNA Note on TopicRNN
A Note on TopicRNN
Tomonari Masada
 
Bachelor_Defense
Bachelor_DefenseBachelor_Defense
Bachelor_Defense
Teja Turk
 
Nyquist criterion for zero ISI
Nyquist criterion for zero ISINyquist criterion for zero ISI
Nyquist criterion for zero ISI
Gunasekara Reddy
 
Ultrasound Modular Architecture
Ultrasound Modular ArchitectureUltrasound Modular Architecture
Ultrasound Modular Architecture
Jose Miguel Moreno
 
Optics Fourier Transform Ii
Optics Fourier Transform IiOptics Fourier Transform Ii
Optics Fourier Transform Ii
diarmseven
 
Prim algorithm
Prim algorithmPrim algorithm
Prim algorithm
University of Potsdam
 
Theoretical Spectroscopy Lectures: real-time approach 1
Theoretical Spectroscopy Lectures: real-time approach 1Theoretical Spectroscopy Lectures: real-time approach 1
Theoretical Spectroscopy Lectures: real-time approach 1
Claudio Attaccalite
 
CVPR2010: Advanced ITinCVPR in a Nutshell: part 6: Mixtures
CVPR2010: Advanced ITinCVPR in a Nutshell: part 6: MixturesCVPR2010: Advanced ITinCVPR in a Nutshell: part 6: Mixtures
CVPR2010: Advanced ITinCVPR in a Nutshell: part 6: Mixtures
zukun
 
Admission in india 2015
Admission in india 2015Admission in india 2015
Admission in india 2015
Edhole.com
 
The discrete fourier transform (dsp) 4
The discrete fourier transform  (dsp) 4The discrete fourier transform  (dsp) 4
The discrete fourier transform (dsp) 4
HIMANSHU DIWAKAR
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Physics Research Summer2009
Physics Research Summer2009Physics Research Summer2009
Physics Research Summer2009
Ryan Melvin
 
Fourier analysis
Fourier analysisFourier analysis
Fourier analysis
AyzaJabeen
 
Fourier Transform
Fourier TransformFourier Transform
Fourier Transform
Nidhi Baranwal
 
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian MotionReproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
IJMERJOURNAL
 

What's hot (18)

P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithmno U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
 
A Note on TopicRNN
A Note on TopicRNNA Note on TopicRNN
A Note on TopicRNN
 
Bachelor_Defense
Bachelor_DefenseBachelor_Defense
Bachelor_Defense
 
Nyquist criterion for zero ISI
Nyquist criterion for zero ISINyquist criterion for zero ISI
Nyquist criterion for zero ISI
 
Ultrasound Modular Architecture
Ultrasound Modular ArchitectureUltrasound Modular Architecture
Ultrasound Modular Architecture
 
Optics Fourier Transform Ii
Optics Fourier Transform IiOptics Fourier Transform Ii
Optics Fourier Transform Ii
 
Prim algorithm
Prim algorithmPrim algorithm
Prim algorithm
 
Theoretical Spectroscopy Lectures: real-time approach 1
Theoretical Spectroscopy Lectures: real-time approach 1Theoretical Spectroscopy Lectures: real-time approach 1
Theoretical Spectroscopy Lectures: real-time approach 1
 
CVPR2010: Advanced ITinCVPR in a Nutshell: part 6: Mixtures
CVPR2010: Advanced ITinCVPR in a Nutshell: part 6: MixturesCVPR2010: Advanced ITinCVPR in a Nutshell: part 6: Mixtures
CVPR2010: Advanced ITinCVPR in a Nutshell: part 6: Mixtures
 
Admission in india 2015
Admission in india 2015Admission in india 2015
Admission in india 2015
 
The discrete fourier transform (dsp) 4
The discrete fourier transform  (dsp) 4The discrete fourier transform  (dsp) 4
The discrete fourier transform (dsp) 4
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Physics Research Summer2009
Physics Research Summer2009Physics Research Summer2009
Physics Research Summer2009
 
Fourier analysis
Fourier analysisFourier analysis
Fourier analysis
 
Fourier Transform
Fourier TransformFourier Transform
Fourier Transform
 
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian MotionReproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
Reproducing Kernel Hilbert Space of A Set Indexed Brownian Motion
 

Similar to Pairing scott

lecture6.ppt
lecture6.pptlecture6.ppt
lecture6.ppt
AbhiYadav655132
 
Number Theory for Security
Number Theory for SecurityNumber Theory for Security
Number Theory for Security
Abhijit Mondal
 
Muchtadi
MuchtadiMuchtadi
PCA on graph/network
PCA on graph/networkPCA on graph/network
PCA on graph/network
Daisuke Yoneoka
 
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment ProblemA Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
Mary Calkins
 
Kolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametriclineKolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametricline
Alina Barbulescu
 
Mit2 092 f09_lec23
Mit2 092 f09_lec23Mit2 092 f09_lec23
Mit2 092 f09_lec23
Rahman Hakim
 
A Level Set Method For Multiobjective Combinatorial Optimization Application...
A Level Set Method For Multiobjective Combinatorial Optimization  Application...A Level Set Method For Multiobjective Combinatorial Optimization  Application...
A Level Set Method For Multiobjective Combinatorial Optimization Application...
Scott Faria
 
Heuristics for counterexamples to the Agrawal Conjecture
Heuristics for counterexamples to the Agrawal ConjectureHeuristics for counterexamples to the Agrawal Conjecture
Heuristics for counterexamples to the Agrawal Conjecture
Amshuman Hegde
 
math camp
math campmath camp
math camp
ssuser8cde591
 
Proof of Fermat's Last Theorem (Using 6 Methods)
Proof of Fermat's Last Theorem (Using 6 Methods)Proof of Fermat's Last Theorem (Using 6 Methods)
Proof of Fermat's Last Theorem (Using 6 Methods)
nikos mantzakouras
 
Block Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherBlock Cipher vs. Stream Cipher
Block Cipher vs. Stream Cipher
Amirul Wiramuda
 
Quadrature
QuadratureQuadrature
Quadrature
Linh Tran
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
Kai Katsumata
 
Orthogonal_Polynomials
Orthogonal_PolynomialsOrthogonal_Polynomials
Orthogonal_Polynomials
Indre Skripkauskaite
 
Tucker tensor analysis of Matern functions in spatial statistics
Tucker tensor analysis of Matern functions in spatial statistics Tucker tensor analysis of Matern functions in spatial statistics
Tucker tensor analysis of Matern functions in spatial statistics
Alexander Litvinenko
 
LPS talk notes
LPS talk notesLPS talk notes
LPS talk notes
Matt Hawthorn
 
Kumegawa russia
Kumegawa russiaKumegawa russia
Kumegawa russia
Kazuki Kumegawa
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
VjekoslavKovac1
 
An Algorithm For The Combined Distribution And Assignment Problem
An Algorithm For The Combined Distribution And Assignment ProblemAn Algorithm For The Combined Distribution And Assignment Problem
An Algorithm For The Combined Distribution And Assignment Problem
Andrew Parish
 

Similar to Pairing scott (20)

lecture6.ppt
lecture6.pptlecture6.ppt
lecture6.ppt
 
Number Theory for Security
Number Theory for SecurityNumber Theory for Security
Number Theory for Security
 
Muchtadi
MuchtadiMuchtadi
Muchtadi
 
PCA on graph/network
PCA on graph/networkPCA on graph/network
PCA on graph/network
 
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment ProblemA Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
 
Kolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametriclineKolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametricline
 
Mit2 092 f09_lec23
Mit2 092 f09_lec23Mit2 092 f09_lec23
Mit2 092 f09_lec23
 
A Level Set Method For Multiobjective Combinatorial Optimization Application...
A Level Set Method For Multiobjective Combinatorial Optimization  Application...A Level Set Method For Multiobjective Combinatorial Optimization  Application...
A Level Set Method For Multiobjective Combinatorial Optimization Application...
 
Heuristics for counterexamples to the Agrawal Conjecture
Heuristics for counterexamples to the Agrawal ConjectureHeuristics for counterexamples to the Agrawal Conjecture
Heuristics for counterexamples to the Agrawal Conjecture
 
math camp
math campmath camp
math camp
 
Proof of Fermat's Last Theorem (Using 6 Methods)
Proof of Fermat's Last Theorem (Using 6 Methods)Proof of Fermat's Last Theorem (Using 6 Methods)
Proof of Fermat's Last Theorem (Using 6 Methods)
 
Block Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherBlock Cipher vs. Stream Cipher
Block Cipher vs. Stream Cipher
 
Quadrature
QuadratureQuadrature
Quadrature
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
 
Orthogonal_Polynomials
Orthogonal_PolynomialsOrthogonal_Polynomials
Orthogonal_Polynomials
 
Tucker tensor analysis of Matern functions in spatial statistics
Tucker tensor analysis of Matern functions in spatial statistics Tucker tensor analysis of Matern functions in spatial statistics
Tucker tensor analysis of Matern functions in spatial statistics
 
LPS talk notes
LPS talk notesLPS talk notes
LPS talk notes
 
Kumegawa russia
Kumegawa russiaKumegawa russia
Kumegawa russia
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
 
An Algorithm For The Combined Distribution And Assignment Problem
An Algorithm For The Combined Distribution And Assignment ProblemAn Algorithm For The Combined Distribution And Assignment Problem
An Algorithm For The Combined Distribution And Assignment Problem
 

Recently uploaded

MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 

Recently uploaded (20)

MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 

Pairing scott

  • 1. Efficient Implementation of Cryptographic pairings Mike Scott Dublin City University
  • 2. First Steps  To do Pairing based Crypto we need two things  Efficient algorithms  Suitable elliptic curves  We have got both! (Maybe not quite enough suitable curves?)
  • 3. What’s a Pairing?  e(P,Q) where P and Q are points on an elliptic curve.  It has the property of bilinearity  e(aP,bQ) = e(bP,aQ) = e(P,Q)ab  We use the Tate pairing.
  • 4. Hard problems… 1. Given aP and P, its hard to find a 2. Given e(P,Q)a and e(P,Q) its hard to find a. 3. Given {P,sP,aP,Q,sQ,bQ} its hard to find e(P,Q)sab
  • 5. Making it secure  Recall that on a pairing friendly elliptic curve E(Fq), the curve order has a large prime divisor r, and where k is the smallest integer such that r|qk-1  k is the embedding degree, a.k.a. the security multiplier  Pairings evaluates as element in Fqk
  • 6. Making it secure  If r is 160-bits, then Pohlig-Hellman attacks will take ~ 280 steps  If k.lg(q) ~ 1024 bits, Discrete Log attacks will also take ~ 280 steps  So we can achieve appropriate levels of cryptographic security
  • 7. Modified Tate Pairing  Supersingular curves support a distortion map, Φ(Q) which evaluates as a point on E(Fqk) if Q is on E(Fq).  So choose P and Q on E(Fq), then ê(P,Q) =e(P, Φ(Q))  Is an alternative, nicer (Type 1) pairing, with the extra property ê(P,Q) = ê(Q,P)
  • 8. A quick protocol..  Sakai and Kasahara non-interactive ID-based key exchange.  A trusted authority with secret s give Alice sA, where A is derived in a public way from Alices identity.  The trusted authority gives Bob sB.  They share a key ê (sA,B)=ê (sB,A)!  No interaction required!
  • 9. What choices?  If q=p a prime, maximum k=2  If q=2m, maximum k=4  If q=3m, maximum k=6  We need group size r ≥ 160 bits  We need qk ~ 1024 bits  We know r | q+1-t  (t is trace of the Frobenius ≤ 2 √q)
  • 10. Constrained…  These constraints are… well… constraining!  I have an irrational aversion to F3m!  So what about Hyperelliptic curves…?  Not very promising in practice…  Fortunately, we have an alternative choice – certain families of ordinary elliptic curves over Fp
  • 11. Ordinary Elliptic Curves  There are the MNT curves, with k={3,4,6}  There are Freeman curves with k=10  There are Barreto-Naehrig curves with k=12
  • 12. Ordinary Elliptic Curves  These curves all have r~p, which is nice, as it means P can be over the smallest possible field for given level of security  If we relax this, many more families can be found (e.g. Brezing-Weng)  If we allow lg(r) ≤ 2.lg(p) then curves for any k are plentiful (Cocks-Pinch)
  • 13. The bad news..  No distortion map  (Type 3 pairing)  In e(P,Q), while P can be in E(Fp), Q cannot.  The best we can do is to put Q on a lower order “twist” E(Fpk/w), where always w=2, (but w=4 and w=6 are possible).  For example for BN curves we can use w=6 and put Q on E(Fp2)  e(P,Q) ≠ e(Q,P)
  • 14. Implementation  For simplicity (for now)  Assume k=2d, d=1, p=3 mod 4  Elements in Fp2 can be represented as (a+ib), where a and b are in Fp and i=√-1 because -1 is a quadratic non-residue (think “imaginary number”)  Assume P is in E(Fp), Q in E(Fp2)
  • 15. Basic Algorithm for e(P,Q) m ← 1, T ← P for i=lg(r)-1 downto 0 do m ← m2.lT,T (Q)/v2T(Q) T ← 2.T if ri = 1 m ← m.lT,P(Q)/vT+P(Q) T=T+P end if end for Millers Algorithm m ← m(p-1) Final Exponentiation return m(p+1)/r
  • 16. lT,T(Q) = (yq-yj) – λj(xq-xj) v2T(Q) =xq-xj+1 Explaining the Algorithm Q(xq,yq) T=(xj,yj) xq-xj yq-yj Line of slope λj xj+1,yj+1
  • 17. Optimizations  Choose r to have a low Hamming weight  By cunning choice of Q as a point on the twisted curve and using only even k=2d, the v(.) functions become elements in Fpd and hence get “wiped out” by the final exponentiation, which always includes pd-1 as a factor of the exponent.  Now the algorithm simplifies to…
  • 18. Improved Algorithm m ← 1, T ← P for i=lg(r)-1 downto 0 do m ← m2.lT,T (Q) T ← 2.T if ri = 1 m ← m.lT,P(Q) T=T+P end if end for m ← m(p-1) return m(p+1)/r
  • 19. A useful Observation..  Observe the line m ← m(p-1)  Part of the final exponentiation – raising to the power of (pk-1)/r  Now for any c in Fp, c(p-1) = 1 mod p (Fermat)  Therefore m can be multiplied by any constant at any time in the Miller loop without effecting the final result!
  • 20. Further optimization ideas  Truncate the loop in Miller’s algorithm, and still get a viable pairing.  Optimize the final exponentiation  Exploit the Frobenius – an element of any extension field Fqk can easily be raised to any power of q. For example in Fp2 (a+ib)p = (a-ib)
  • 21. Further optimization ideas  Precomputation!  If P is fixed, all the T values can be precomputed and stored – with significant savings.  P may be a fixed public value or a fixed secret key – depends on the protocol.
  • 22. The ηT pairing - 1  For the supersingular curves of low characteristic, the basic algorithm can be drastically simplified by integrating the distortion map, the point multiplication, and the action of the Frobenius directly into the main Miller loop. Also exploits the simple group order. This is a Type 1 pairing.
  • 23. The ηT pairing - 2  In characteristic 2, k=4.  r =2m ± 2[(m+1)]/2 + 1  Elements in F2m are represented as a polynomial with m coefficients in F2  Elements in the extension field F24m are represented as a polynomial with 4 coefficients in F2m  e.g. a+bX+cX2+dX3 represented as [a,b,c,d].
  • 24. The ηT pairing - 3  Let s=[0,1,1,0] and t=[0,1,0,0] (derived from the distortion map)  Then on the supersingular curve y2+y=x3+x+b, where b=0 or 1  And m= 3 mod 8  A pairing e(P,Q), where P=(xP,yP) and Q=(xQ,yQ), can be calculated as
  • 25. The ηT pairing - 4 u←xP+1 f←u(xP+xQ+1)+yP+yQ+b+1+(u+xQ)s+t for i=1 to (m+1)/2 do u←xP xP←√xP yP←√yP g←u(xP+xQ)+yP+yQ+xP+(u+xQ)s+t f←f.g xQ←xQ 2 yQ←yQ 2 end for return f(22m-1)(2m-2(m+1)/2 +1)
  • 26. The ηT pairing - 5  This is very fast! <5 seconds on an msp430 wireless sensor network node, with m=271 (C – no asm)  Note truncated loop (m+1)/2.  Final exponentiation very fast using Frobenius.  Ideal in low power, resource constrained environment.
  • 27. Ate Pairing for ordinary curves E(Fp)  Truncated Loop pairing, related to Tate pairing.  Number of iterations in Miller loop may be much shorter – lg(t-1) instead of lg(r), and for some families of curves t can be much less than r  Parameters “change sides”, now P is on the twisted curve and Q is on the curve over the base field.  Works particularly well with curves that allow a higher order (sextic) twist.
  • 28. Extension Field Arithmetic  For non-supersingular curves over Fpk there is a need to implement very efficient extension field arithmetic.  A new challenge for cryptographers (although XTR and OEFs require it)  Simple generic polynomial representation will be slow, and misses optimization opportunities.
  • 29. Towering extensions  Consider p=5 mod 8  Then a suitable representation for Fp2 would be (a+xb), where a,b are in Fp, x=(-2)1/2, as -2 will be a QNR.  Then a suitable representation for Fp4 would be (a+xb), where a,b are in Fp2, x=(-2)1/4  Etc!
  • 30. Towering extensions  In practise it may be sufficient to restrict k=2i3j for i≥1, j≥0, as this covers most useful cases.  So only need to deal with cubic and quadratic towering.  These need only be efficiently developed once (using Karatsuba, fast squaring, inversion, square roots etc.)
  • 31. Multiplication & Squaring (quadratic extension)  Using Karatsuba..  (a+ib)(c+id) = ac- bd+i[(a+b)(c+d)-ac-bd]  Requires 3 modmuls…  OR 3 multiplications and 2 modular reductions (“lazy” reduction)  (a+ib)(a+ib)=(a+b)(a-b)+i.2ab
  • 32. Multiplication & Squaring (cubic extension)  Toom-Cook for multiplication?  Chung-Hasan for squaring?  A problem with both methods is the requirement for division by small constants…  Not a problem thanks to the “useful observation”!
  • 33. Choice of irreducible polynomial  A binomial is the simplest, xn+δ, and the easiest to tower over.  For example for k=12 BN curves  X6+(1+√-2) as a sextic tower over x2+2, where (1+√-2) is neither a cube nor a square.  ..and so the sextic extension can be constructed as a cubic over a quadratic
  • 34. Choice of irreducible polynomial  In general the k-th extension can often be constructed as xk/2+(α+√β) towered over x2+√β, where α, β in {-1,+1,-2,+2}  In practise this seems to work well, and the small values for α, β lead to useful speed-ups.  Not too restrictive..
  • 35. The Final Exponentiation - 1  Note that the exponent is (pk-1)/r  This is a number dependent only on fixed, system parameters  So maybe we can choose p, k and r to make it easier (Low Hamming Weight?)  If k=2d is even then (pk-1)/r = (pd-1).[(pd+1)/r]
  • 36. The Final Exponentiation - 2  We know that r divides (pd+1) and not (pd-1) from the definition of k.  Exponentiation to the power of pd is “for free” using the Frobenius, so exponentiation to the power of pd-1 costs just a Frobenius and a single extension field division – cheap!
  • 37. The Final Exponentiation - 3  In fact we know that the factorisation of (pk-1) always includes Φk(p), where Φk(.) is the k- th cyclotomic polynomial, and that r|Φk(p).  For example p6-1 = (p3-1)(p+1)(p2-p+1)  Where Φ6(p) = p2-p+1
  • 38. The Final Exponentiation - 4  So the final exponent is general breaks down as… (pd-1).[(pd+1)/Φk(p)].Φk(p)/r  All except the final Φk(p)/r part can be easily dealt with using the Frobenius.
  • 39. The Final Exponentiation - 5  However this “hard” exponent e can always be represented to base p as e=e0+e1p+e2p2… fe = fe0 +e1 p+e2 p2… = fe0 .(fp)e1.(fp2 )e2…  Which can be calculated using the Frobenius and the well known method of multi-exponentiation.
  • 40. The Final Exponentiation - 6  Another idea is to exploit the special form of the “hard part” of the final exponentiation for a particular curve  If k is divisible by 2 the pairing value can be “compressed” times 2 and Lucas exponentiation used.  If k is divisible by 3 the pairing value can be “compressed” times 3 and XTR exponentiation used.
  • 41. Case study – k=6 MNT curves  Assuming a prime order curve, then the hard part of the final exponent is (p2-p+1)/r, where r=p+1-t  Then the exponent is p±σ, where σ ~ t  So the final exponentiation is fp.f±σ  Which just costs a Frobenius and one half-length exponentiation!
  • 42. Products of pairings  Arises in many protocols  e(P,Q).e(R,S)  3 ideas  The multiplication of P and R by r occur in “lock-step”, so use Montgomery’s trick, affine coordinates, only one modular inversion  Share the “Miller variable” m (so only one squaring of m in the Miller loop)  Share the final exponentiation
  • 43. Implementation – more complex than RSA or ECC!  There are many choices of curves, and of embedding degrees, and of pairings. It is not at all obvious which is “best” for any given application. The optimal pairing to use depends not just on the security level, but also on the protocol to be implemented.
  • 44. Implementation – more complex than RSA or ECC!  For example (a) p~512 bits and k=2, or (b) p~170 bits and k=6 MNT curve?  On the face of it same security.  Smaller p size means faster base field point multiplications – so (b) looks better  Which is important only if point multiplications are required by the protocol.  (a) pairing is much faster if precomputation is possible  (b) must be used for short signatures  (b) requires Q on the twist E’(Fp3) which is more complicated than (a) for which Q can be on E’(Fp)  The (b) curves are hard to find, whereas (a) types are plentiful.  (a) is much simpler to implement with the smaller extension.. Smaller code
  • 45. Implementation – more complex than RSA or ECC!  For maximum efficiency each implementation must be highly specialised according to its parameters.  A k=2 Cocks-Pinch implementation will be quite different from a k=6 MNT implementation.
  • 46. Some timings – 80-bit security  32-bit 3GHz PIV  Tate Pairing  k=2, p~512 bits Cocks-Pinch  w/o precomp. = 6.7ms  With precomp. = 3.0ms  Point mul. = 2.9ms
  • 47. Some timings – 80-bit security  32-bit 3GHz PIV  Tate Pairing  k=2, p~512 bits with Efficient Endomorphism (Scott ’05)  w/o precomp. = 5.1ms  With precomp. = 3.0ms  Point mul. = 1.9ms
  • 48. Some timings – 80-bit security  32-bit 3GHz PIV  Ate pairing  k=4, p~256 bits FST curve  w/o precomp. = 9.1ms  With precomp. = 3.1ms  Point mul. = 1.1ms
  • 49. Some timings – 80-bit security  32-bit 3GHz PIV  Tate pairing  k=6, p~160 bits MNT curve  w/o precomp. = 6.2ms  With precomp. = 4.5ms  Point mul. = 0.6ms
  • 50. Some timings – 80-bit security  8-bit 16MHz Atmel128  Tate pairing  k=4, p~256 bits MNT curve  With precomp. = 7.75 seconds
  • 51. Some timings – 80-bit security  8-bit 16MHz Atmel128  ηT pairing  k=4, m=271 bits, supersingular curve  w/o precomp = 2.6 seconds
  • 52. Some timings – 128-bit security  3.4GHz PIV 32-bit  Tate pairing  k=12, p~256 bits BN curve  w/o precomp. = 34.0ms  Ate pairing  w/o precomp. = 23.2ms