Try โ€‚โ€‰HackMD

On subgroup checks for BLS12

Let

E be an elliptic curve from the BLS12 family. We denote by
r
its prime subgroup order. Let
P(x,y)โˆˆE
a point of order
r
. The goal is to verify efficiently that
rโ‹…P=โˆž
.

Notations

  • E
    is an elliptic curve defined over a finite field
    Fp
    with the short Weierstrass equation
    y2=x3+ax+b
  • r
    is a prime-order subgroup of
    E(Fp)
  • k
    is the embedding degree, i.e. the smallest integer s.t.
    rโˆฃpkโˆ’1
  • A pairing is a map
    e:G1ร—G2โ†ฆGT
    , where
    G1โŠ‚E[r](Fp)
    ,
    G2โŠ‚E[r](Fpk)
    and
    GT
    the group of
    r
    -th roots of unity in
    Fp
    .

BLS12

BLS12 is a complete family of pairing-friendly elliptic curves with an embedding degree

k=12 (Construction 6.6 in FST06, case
kโ‰ก0mod6
). It is defined over a finite field
Fp
of prime characteristic
p
by the equation
y2=x3+b
. It has Complex Multiplication by discriminant
D=โˆ’3
and parameters defined by the following polynomials:

Parameter Polynomial
field size
p(x)
(xโˆ’1)2/3โ‹…r(x)+x
subgroup order
r(x)
x4โˆ’x2+1
Frobenius trace
t(x)
x+1

โ†’ These polynomials are evaluated at some seed
z
to derive a specific curve with the desired security and efficiency.

Endomorphisms

BLS12 curves have CM discriminant

D=โˆ’3, so there is an efficient endomorphism
ฯ•:(x,y)โ†ฆ(xโ‹…ฯ‰,y)
with
ฯ‰โˆˆFp
a primitive cube root of unity (i.e.
ฯ‰2+ฯ‰+1โ‰ก0modp
). The eigenvalue of this endomorphism is
ฮป=z2โˆ’1
which a cube root of unity in
Fr
.

BLS12 has Complex Multiplication by

โˆ’1+โˆ’32. There is an endomorphism
ฯ•
satisfying
ฯ•2+ฯ•+1
with eigenvalue
ฮป=โˆ’1+โˆ’32modr
. Given BLS12 polynomials, one finds
ฮป(x)=x2โˆ’1
.

Given a twist of order

d,
G2โŠ‚E[r](Fpk)
is isomorphic to
Eโ€ฒ[r](Fpk/d)
with
ฮฝ:Eโ†ฆEโ€ฒ
the twisting isomorphism. On
Eโ€ฒ(Fpk/d)
, there is an efficient endomorphism
ฯˆ
called "untwist-Frobenius-twist"
ฯˆ=ฮฝโˆ’1โˆ˜ฯ€pโˆ˜ฮฝ
where
ฯ€p
is the
p
-power Frobenius. It satisfies
ฯˆ2โˆ’tฯˆ+p=0

BLS12 curves have a twist of degree 6. Associated with a choice of

ฮพโˆˆFqk/6 s.t.
x6โˆ’ฮพโˆˆFqk/6[X]
is irreducible, the equation of
Eโ€ฒ
can be either

  • y2=x3+b/ฮพ
    and we call it a D-twist or
  • y2=x3+b.ฮพ
    and we call it a M-twist

For the D-type,

ฮฝโˆ’1:(x,y)โ†ฆ(ฮพ1/3x,ฮพ1/2y),
and for the M-type
ฮฝโˆ’1:(x,y)โ†ฆ(ฮพ2/3x/ฮพ,ฮพ1/2y/ฮพ)

So given that

k=12 and
d=6
,
G2
is over
Fp2
and
ฯ€p:(x,y)โ†ฆ(xp,yp)=(xยฏ,yยฏ)
and
ฯˆ
is
(x,y)โ†ฆ(xยฏโ‹…c1te,yยฏโ‹…c2te)

Using the endomorphism

ฯ• on
G1
and
ฯˆ
on
G2
, Sean Bowe [1] derived using LLL algorithm as in Fuentes et al.[2] and Budroni and Pintore[3] fast formulae to check that a point is on BLS12-381
G1
and
G2
. The formulae are

  • PโˆˆG1โŸบ((z2โˆ’1)/3)โ‹…(2ฯ•(P)โˆ’Pโˆ’ฯ•2(P))โˆ’ฯ•2(P)=โˆž
  • QโˆˆG2โŸบzโ‹…ฯˆ3(Q)โˆ’ฯˆ2(Q)+Q=โˆž

Observations

  • To derive

    G1 membership formula for BLS12, there is no need for LLL algorithm. Given the polynomials
    r(x)
    and
    ฮป(x)
    , a simple formula can be derived
    r(z)โ‹…P=(z4โˆ’z2+1)โ‹…P=(z2โ‹…ฮป(z)+1)โ‹…P=z2โ‹…ฯ•(P)+P

    The formula in [1] can be simplified into this one by using the fact that
    ฯ•2+ฯ•+1=0
    .

  • For

    G2, the check can be done the same way:
    z2โ‹…ฯ•(Q)+Q=โˆž
    (note
    ฯ•
    in
    G2
    uses the other cube root of unity
    โˆ’ฯ‰โˆ’1
    ). However, the formula in [1] is faster (multiplication by
    z
    instead of
    z2
    ) but it can be simplified into
    โˆ’zโ‹…ฯˆ(ฯ•(Q))+ฯ•(Q)+Q=0
    by remarking that
    ฯˆ2=โˆ’ฯ•
    .

โ†’ Why
ฯˆ2=โˆ’ฯ•
?
Let's take the example of D-twist, we have
ฮฝโˆ’1:(x,y)โ†ฆ(ฮพ1/3x,ฮพ1/2y)ฯ€p:(x,y)โ†ฆ(yp,yp)=(xยฏ,yยฏ)ฮฝ:(x,y)โ†ฆ(1/ฮพ1/3x,1/ฮพ1/2y)ฯˆ:(x,y)โ†ฆ(ฮพ(pโˆ’1)/3โ‹…xยฏ,ฮพ(pโˆ’1)/2โ‹…yยฏ)

and,
ฯˆ2:(x,y)โ†ฆ(ฮพ(p+1)(pโˆ’1)/3โ‹…x,ฮพ(p+1)(pโˆ’1)/2โ‹…y)

Now, recal that
xโ†ฆxp+1
is the trace
Fp2/Fp
hence
xp+1โˆˆFp
and
(ฮพ(pโˆ’1)/6)p+1
is a primitive 6th root of unity. So,
ฮพ(p+1)(pโˆ’1)/3
is primitive 3rd root of unity. Now,
(ฮพ(pโˆ’1)/2)p+1=(ฮพp+1)(pโˆ’1)/2
and
ฮพp+1โˆˆFp
, this is the trace. Finally,
(ฮพp+1)(pโˆ’1)/2={1if squareโˆ’1otherwise
, and because
ฮพ
is not a square in
Fp2
, then
(ฮพp+1)(pโˆ’1)/2=โˆ’1
, which means
ฯˆ2:(x,y)โ†ฆ(ฯ‰โ‹…x,โˆ’y)=โˆ’ฯ•

[NEW] Scott eprint 2021/1130

  • For
    G1
    , Scott proves by contradiction that checking the endorphism is sufficient:
    ฯ•(P)=โˆ’z2P
    . In fact,
    โˆ’z6โ‰กฮปโ‰ก1modr
    because
    ฮป
    a third root of unity in
    Fr
    . If the endomorphism was true for a point of order
    cโ‹…r
    , then by CRT,
    โˆ’z6โ‰ก1modc
    but
    cโˆฃzโˆ’1
    for BLS curves and hence
    u6=1modc
    .
  • For
    G2
    , he finds a simpler formula:
    ฯˆ(P)=zP
    . In fact, given that
    (p+1โˆ’t)Q=โˆž
    and
    t=z+1
    then
    uP=pQ
    .
    ฯˆ
    verifies
    ฯˆ2(Q)โˆ’tฯˆ(Q)+pQ=โˆž
    and this becomes
    zQ=ฯˆ(uQ)+ฯˆ(Q)โˆ’ฯˆ2(Q)
    which has two solutions:
    ฯˆ(Q)=Q
    or
    ฯˆ(Q)=uQ
    . Only the latter is valid sinc
    ฯˆ
    acts non-trivially on
    G2
    .

Implementation

Example code for BLS12-381 (M-twist) with seed

z=โˆ’15132376222941642752 and BLS12-377 (D-twist) with
z=9586122913090633729
in gnark-crypto library (golang).