Elliptic Curve Pairing

donghyun·2023년 3월 3일
0

Intro: Elliptic Curve Pairing

e:G1×G2GTe: G_1 \times G_2 \to G_T

G1G_1 is typically a subgroup of E(Fq)E(F_q)

G2G_2 is typically a subgroup of E(Fqk)E(F_{q^k})

실제로는 여기에 twist를 사용해 degree를 줄임

GTG_T is a multiplicative subgroup of FqkF_{q^k}^*

타원곡선에서 일반적인 pairing의 정의이다. 타원곡선에서 pairing을 사용하는 이유는 타원곡선상에는 곱셈이 존재하지 않기때문이다. G1G_1, G2G_2의 타원곡선 원소쌍을 연산하여 multiplicative 그룹 GTG_T의 원소가 되게하는 특정 함수들이 존재하며 이들을 Pairing 함수라고 부른다. 주의할 점은, G1G_1, G2G_2, GTG_T가 같은 order을 가지며 GTG_T는 타원곡선 그룹의 점이 아닌 scalar값이다. 아래에서 타원곡선에서 사용할 pairing에 효과적인 group과 embedding degree kk, 복잡한 field상의 group 연산을 단순한 field상의 group 연산으로 전환시키는 twist에 대해서 다룬다.

Gap Diffie-Hellman Group

앞서 Elliptic Curve Pairing의 근간이 되는 Pairing(Bilinear map)에서 DDH problem을 이야기하였다. G1과 G2가 완전히 분리된 그룹이 아니라면 pairing을 사용하는 것이 DDH problem을 쉽게 만들어줄 것이다. 하지만 pairing을 효과적으로 Elliptic Curve에서 사용할 수 있으려면 CDH problem은 여전히 풀기 어려워야 하며, 이에 상충하는 CDH problem은 어렵고 DDH problem은 쉬운 적절한 타원 곡선 그룹을 골라야 한다. 이러한 그룹을 Gap Diffie-Hellman Group이라고 부른다.

💡 Reminder
CDH(Computational Diffie-Hellman) problem

주어진 그룹 G와 그룹 element gg, gag_a, gbg_b가 있을 때 gabg_{ab}를 계산할 수 있는가 하는 문제

DDH(Decisional Diffie-Hellman) problem
주어진 그룹 G와 그룹 element gg, gag_a, gbg_b, gcg_c가 있을 때 gcg_cgabg_{ab}인지 아닌지 결정할 수 있는가 하는 문제

Embeddig degree kk

CDH problem은 어렵고 DDH problem은 쉬운 난이도를 나타낼 수 있는 중요한 지표는 Embedding degree kk가 있다. kk는 base field인 FpF_p에 대해 pk1=0 (mod r)p^k - 1 = 0\ (mod\ r)을 만족하는 가장 작은 정수를 말한다. 즉, pk1p^k-1rr의 배수가 되는 가장 작은 kk를 의미한다. (참고: rrFpF_p에서 subgroup을 가지는 G1G_1의 prime order을 의미한다). Embedding degree가 1에 가까울수록 CDH problem이 풀기 쉬워지고 너무 클수록 연산 시간이 늘어나 DDH Problem 마저도 풀기가 어려워진다. 그렇기 때문에 적절한 크기의 kk를 가진 타원곡선을 사용하면 pairing에 친숙한 curve라고 부를 수 있다. 대표적으로 BN curve와 BLS curve가 있다. BLS curve에서 뒤에 붙는 숫자는 embedding degree 와 base field order크기를 나타낸다.(ex. BLS12-381,{embedding degree: 12, base field order: 381-bit})

💡 More information
연산시간이 오래걸린다는 의미는 pairing 계산이 오래걸린다는 것이며 pairing을 계산하는 pairing 함수는 현재 weil pairing, Tate pairing, ate pairing등이 있다.

Related with: divisor, miller’s algorithm

Twist

암호학에 쓰이는 타원곡선에서 finite field pp도 굉장히 큰데 예를들어 p12p^{12}는 실제 사용하기에 너무 큰 숫자이고 연산에도 상당한 시간이 걸린다. 해결책으로 twist라는 방법이 있는데 복잡한 base field상의 group 연산을 보다 단순한 base field상의 group 연산으로 mapping 시킬 수 있는 방법이다. 수학적으로 두 group을 동형(isomorphic)이라고 한다. 모든 twist에는 degree d를 가지고 있다. Twisted curve는 Fpk/dF_{p^{k/d}}상에서 정의된다. 예를 들어 embedding degree k=2k = 2일 때, twisted curve는 Fp2/2F_{p^{2/2}}(=FpF_p)상에서 정의 된다. 이를 quadratic twist(d=2d=2)라고 부른다. 즉, 동형이기때문에 확장필드 Fp2F_{p^2}상에서 연산을 twisted curve E(Fp)E'(F_p)상에서 연산할 수 있다. 또 다른 예시로 Fp12F_{p^{12}}에서 quadratic twist는 Fp6F_{p^6}에서의 연산을 수행하고 sextic twist(d=6d=6)은 Fp2F_{p^2}에서 연산이 수행된다. 대신 타원곡선의 형태가 isomorphic할 수 있도록 조금 변경된다. 아무튼, dd값에 따라서 연산에 사용되는 field를 줄일 수 있기 때문에 가능한 가장 큰 dd값을 선택하는게 좋다. 가능한 dd값은 2, 3, 4, 6이다[J. H. Silverman. The Arithmetic of Elliptic Curves (2nd Edition), 2009]. dd값을 정할때 a,ba,b값에 따라서 제약사항이 있다.

d=2d=2, quadratic twists는 모든 타원곡선에서 가능하다. y2=x3+ax+by^2=x^3+ax+b

d=3d=3, cubic twists는 a=0a=0일때만 가능하다. y2=x3+by^2=x^3+b

d=4d=4, quartic twists는 b=0b=0일때 가능하다. y2=x3+axy^2 = x^3 + ax

d=6d=6, sextic twists는 a=0a=0일때만 가능하다. y2=x3+by^2= x^3+b

💡 **More information**

Twist는 타원곡선의 구조에 따라 FpkF_{p^k}에서의 연산을 Fp(k/2),Fp(k/3),Fp(k/4),Fp(k/6)F_{p^(k/2)}, F_{p^(k/3)},F_{p^(k/4)},F_{p^(k/6)}으로 이동시켜서 할 수 있게 해준다. BLS12-381에서는 y2=x3+4y^2=x^3+4을 사용하기때문에 sextic twists 적용이 가능하다. k=12k=12인데 Fp12F_{p^{12}}의 연산을 twist를 이용하여 Fp2F_{p^2}에서 할 수 있게 해준다. 다만 허수가 사용되고 타원곡선 식이 y2=x3+4(1+i)y^2 = x^3 + 4*(1+i)로 변경된다. ii는 복소수(complex number)에서 쓰는 허수의 단위 (i2+1=0)(i^2+1=0). Fp2F_{p^2}의 수 연산 체계는 복소수 연산 체계를 사용한다.

참고:
1. https://en.wikipedia.org/wiki/Twists_of_elliptic_curves#Quadratic_twist
2.https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf - (4.3 Twisted curves)

more deep: https://eprint.iacr.org/2005/133.pdf

Reference

https://tjerandsilde.no/files/Bachelor_Thesis.pdf

https://www.math.uwaterloo.ca/~ajmeneze/publications/pairings.pdf

https://medium.com/@VitalikButerin/exploring-elliptic-curve-pairings-c73c1864e627

https://medium.com/atomrigslab/pairing-based-cryptography와-bls-signature의-이해-part-2-ed8d35dbc689

https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf

profile
Blockchain

0개의 댓글