62
전기컴퓨터공학과 사물인터넷 연구센터장 김호원 2019.9

PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

전기컴퓨터공학과

사물인터넷 연구센터장

김호원

2019.9

Page 2: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Pairing 기술개요및 응용

전체 목차

2

Page 3: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

1. zk-SNARK 개요: 주요특성/응용분야

2. zk-SNARK 구조

3. zk-SNARK 프로토콜

3

III. zk-SNARK

Page 4: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.1 zk-SNARK 개요

zk-SNARK(Zero-knowledge succinct non-interactive arguments of knowledge)

증명자가 자신의 소유 정보(예: 비밀키 등)를 공개하지 않으며, 증명자와 검증자 사이에온라인 상호 작용이 없는 상태에서 해당 정보 소유를 증명하는 기법

zero-knowledge (영 지식)

Proving existence of a secret without revealing it

Succinct (간결)

The communication volume is small

Non-interactive (비상호작용)

No interaction

Arguments of Knowledge (지식 증명)

Proving that one knows the secret

4

III. zk-SNARK

Page 5: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.1 zk-SNARK 개요 – 응용 분야

zk-SNARK 응용 분야

Verifiable Computation Pinocchio protocol

Worker(서버)는 client로부터 함수 f ( )와 x를 위탁받아 계산(수행) 후, client에게 f(x) 전송

이때, 계산 결과 f(x)의 정확성(correctness)이 보장 되어야 함

주요 개인 정보에 대한 증명 (Proving statement on private data)

Person A has more than X in his bank account

Matching DNA without revealing full DNA

One has a credit score higher than Z

익명 인증 (Anonymous authentication)

Proving that requester R has right to access web-site’s restricted area without revealing its identity (e.g., login, password)

Prove that one is from the list of allowed countries/states without revealing from which one exactly

Prove that one owns a monthly pass to a subway/metro without revealing card’s ID

익명 지불 (Anonymous payments)

Payment with full detachment from any kind of identity

Paying taxes without revealing one’s earnings

5

III. zk-SNARK

• 참고문헌 [2]

Page 6: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: 주요 구성 요소

zk-SNARK 프로토콜 구성 주요 요소

영지식 증명

Homomorphic Encryption

Pairing 기반 Homomorphic Hiding 제공

Polynomial Embedding

From Computation to Polynomial, Secret to Polynomial

QAP(Quadratic Arithmetic Program) 기법 사용

6

III. zk-SNARK

• 참고문헌 [4]

Page 7: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Zero-knowledge Proof

영지식 증명(Zero-knowledge Proof)

Homomorphic encryption allows to perform operations on sensitive data while keeping it encrypted

A는 x값을 보유, B는 y값을 보유

B는 “E( )”라고 하는 hiding scheme을 사용하여 y를 숨긴 채로 A에게 전달

A도 같은 hiding scheme을 사용하여 B에게 받은 E(y)에 x를 숨긴 채, 추가하여 B에게 전달

7

III. zk-SNARK

• 참고문헌 [5]

x 값 보유

E(y)

E(f(x,y))

y 값 보유

Page 8: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Zero-knowledge Proof

영지식 증명(Zero-knowledge Proof) – Interactive ZK

• Prover(A)와 Verifier(B)가 서로의 정보를 숨긴 채, computation/정보를 알고 있다는 것을 상호작용을 통해 증명

• B가 k번의 round 동안 다른 값을 P에게 전달

• A는 k개의 입력에 대한 답을 B에게 주어야함

• 항상 옳은 답이 나왔다면 A는 B에게 확률적으로 입력에 대한 computation을 알고 있음을 증명하게 됨

8

III. zk-SNARK

• 참고문헌 [6]

E(y)

x 값 보유

E(f(x,y))

y 값 보유

E(y’’)

Prover

x 값 보유

E(f(x,y’’))

Verifier

y’’ 값 보유

Round 1

Round k

. . .

Page 9: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

영지식 증명(Zero-knowledge Proof) - Non-Interactive ZK

Interactive ZK는 2개의 party간 상호작용때문에 느림/구현 어려움

Non-Interactive ZK는 사전작업 통해 Interactive ZK의 단점 보완

Pk(Prover)가 재생성 가능하고 Vk(Verifier)가 증명 가능한 P(Proof) 설정

CRS(Common Reference String) Model

Proof P 설정을 위한 모델

PRNG를 통해 초기 파라미터 선택

초기 파라미터로 “Common Reference String” 생성

CRS는 Prover, Verifier 둘다 알 수 있는 값

스푸핑 방지를 위해 초기 파라미터는 CRS 생성한 뒤 폐기

3.2 zk-SNARK 구조: Zero-knowledge Proof

9

III. zk-SNARK

• 참고문헌 [6]

증명자(Prover) 검증자(Verifier)

Proof P

Secret S Verify Proof P

Page 10: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Homomorphic Encryption

Homomorphic Encryption

Homomorphic encryption allows to perform operations on sensitive data while keeping it encrypted – 민감 정보를 숨긴 상태에서 연산 가능

Homorphic Encryption 사례 - Elliptic Curve Pairing (Tate pairing, etc.)

• 다음과 같은 bilinearity 특성을 가짐

10

III. zk-SNARK

• 참고문헌 [6]

Enc(m)*Enc(n)

𝐸𝑛𝑐 𝑚 + 𝑛 =𝐸𝑛𝑐 𝑚 ∗ 𝐸𝑛𝑐 𝑛

Homorphic Relation

Page 11: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Homomorphic Encryption

Homomorphic Encryption

zk-SNARK에서의 Homorphic Encryption(pairing) 사용

• zk-SNARK에서 pairing은 다음과 같이 활용됨

• Quadratic equation 𝑥2 − 𝑥 − 42 = 0 이거나 target group order의 multiple인 경우

• bilinearity 특성에 의해, 다음과 같이 작성 가능함

• 즉, secret 이 Quadratic equation을 만족함을 보이기 위해, 위와 같이 paring을 check 하면 됨

• 한편, 𝑥𝐺 에서 secret 정보 𝑥 는 오픈되지 않음(Discrete Logarithm problem)

zk-SNARK에서의 Homorphic Encryption기반 정보 은닉(Homomorphic Hiding)

11

III. zk-SNARK

• 참고문헌 [6]

k가 0이거나 target group order의multiple인 경우. 이러한 특성 가짐

Page 12: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Encoding as a Polynomial Problem

From Computations to Polynomials

QAP를 사용해 증명을 원하는 computation을 polynomial 형태로 바꾸어 검증

A는 B에게 “(𝒄𝟏 ∙ 𝒄𝟐) ∙ (𝒄𝟏 + 𝒄𝟑) = 𝟕 을 만족하는 𝒄𝟏, 𝒄𝟐, 𝒄𝟑 ∈ 𝑭𝒑를 알고 있다”고 증명하길 원함

먼저 𝒄𝟏, 𝒄𝟐, 𝒄𝟑의 computation을 arithmetic circuit으로 표현

덧셈, 곱셈과 같은 arithmetic operation을 하는 gate (g1, g2)

덧셈 gate는 Labeling 없음

Gate 사이를 연결하는 wire (w1, w2, w3, w4, w5)

Gate의 입력 left / right wire, 출력 output wire

ex) g2에서 w4(Left), w1/w3(Right), w5(Output)

Wire wi 에 값 ci 를 할당 (Legal assignment)

12

III. zk-SNARK

w1 : 𝒄𝟏, w2 : 𝒄𝟐 , w3 : 𝒄𝟑, w4 : 𝒄𝟒 = 𝒄𝟏 ∙ 𝒄𝟐 , w5 : 𝒄𝟓 = 𝒄𝟒 ∙ 𝒄𝟏 + 𝒄𝟑결국, A는 “𝒄𝟓 = 𝟕인 (𝒄𝟏, . . . , 𝒄𝟓)를 알고 있다”

Page 13: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Encoding as a Polynomial Problem

From Computations to Polynomials

Reduction to a QAP

각 곱셈 gate는 field의 elements와 연관 (g1은 𝟏 ∈ 𝑭𝒑, g2는 𝟐 ∈ 𝑭𝒑)

Point {1,2}를 “target points”라고 정의

Left / Right / Output wire polynomials을 𝑳𝒊 𝑿 ,𝑹𝒊 𝑿 ,𝑶𝒊(𝑿) (𝒊 = 𝟏, 𝟐,… , 𝟓) 라고 정의

각 Polynomial은 곱셈 gate에 연관된 target point를 제외한 point에서 결과가 0이 됨

ex) g1과 연관된 𝑳𝟏(𝟐) = 𝑹𝟐(𝟐) = 𝑶𝟒(𝟐) = 𝟎 (𝑿 ∈ {𝟏, 𝟐})

g1과 연관된 𝑳𝟏 𝑿 = 𝑹𝟐(𝑿) = 𝑶𝟒(𝑿) = 𝟐 − 𝑿

g2와 연관된 𝑳𝟒(𝑿) = 𝑹𝟏(𝑿) = 𝑹𝟑(𝑿) = 𝑶𝟓(𝑿) = 𝑿 − 𝟏

Gate와 연관되지 않은 polynomials는 “zero polynomial(=0)” 로 정의

Li / Ri / Oi 에 대하여 ci를 계수로 하는 𝑷 = 𝑳 ∙ 𝑹 − 𝑶 정의

𝑳 = σ𝒊=𝟏𝟓 𝒄𝒊 ∙ 𝑳𝒊

𝑹 = σ𝒊=𝟏𝟓 𝒄𝒊 ∙ 𝑹𝒊

𝑶 = σ𝒊=𝟏𝟓 𝒄𝒊 ∙ 𝑶𝒊

𝑷 = 𝒄𝟏 𝟐 − 𝑿 + 𝒄𝟒 𝑿 − 𝟏 𝒄𝟏 𝑿− 𝟏 + 𝒄𝟐 𝟐 − 𝑿 + 𝒄𝟑 𝑿− 𝟏 − 𝒄𝟒 𝟐 − 𝑿 + 𝒄𝟓 𝑿 − 𝟏

모든 target points 𝒕에 대하여 𝑷(𝒕) = 𝟎

𝑷 = 𝑳 ∙ 𝑹 − 𝑶 에서 𝑷 = 𝟎 은 입력을 연산한 결과와 출력이 동일하다는 의미

13

III. zk-SNARK

Page 14: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.2 zk-SNARK 구조: Encoding as a Polynomial Problem

From Computations to Polynomials

Reduction to a QAP

𝑷 𝒂 = 𝟎, 𝒊𝒇𝒇 (𝑿 − 𝒂) | 𝑷(𝑿)

𝒊. 𝒆. 𝑷(𝑿) = 𝑿 − 𝒂 ∙ 𝑯(𝑿)

Target polynomial 𝑻 𝑿 = 𝑿 − 𝟏 𝑿 − 𝟐

𝑻(𝑿)가 𝑷(𝑿)를 나눈다면 (𝒄𝟏, . . . , 𝒄𝟓)는 legal assignment

A가 𝑷(𝑿), B가 𝑻(𝑿)를 가지고 있다면 B는 A가 𝑷(𝑿)를 표현하는 (𝒄𝟏, . . . , 𝒄𝟓)를 알고 있다고검증할 수 있음

차수 d, 크기 m인 Quadratic Arithmetic Program(QAP) Q

다항식 𝑳𝒊 / 𝑹𝒊 / 𝑶𝒊 (𝒊 = 𝟏,… ,𝒎)

차수 d인 Target Polynomial 𝑻

𝑳 = σ𝒊=𝟏𝒎 𝒄𝒊 ∙ 𝑳𝒊 , 𝑹 = σ𝒊=𝟏

𝒎 𝒄𝒊 ∙ 𝑹𝒊 , 𝑶 = σ𝒊=𝟏𝒎 𝒄𝒊 ∙ 𝑶𝒊

𝑷 = 𝑳 ∙ 𝑹 − 𝑶

𝑻(𝑿)가 𝑷(𝑿)를 나눈다면 assignment (𝒄𝟏, . . . , 𝒄𝒎)은 Q를 만족

“(𝒄𝟏 ∙ 𝒄𝟐) ∙ (𝒄𝟏 + 𝒄𝟑) = 𝟕 을 만족하는 𝒄𝟏, 𝒄𝟐, 𝒄𝟑 ∈ 𝑭𝒑를 알고 있다”라는 computation을

QAP를 통해 polynomial로 변환

14

III. zk-SNARK

Page 15: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

zk-SNARK 프로토콜 – simple version

3.3 zk-SNARK 프로토콜 – simple version

15

III. zk-SNARK

• 참고문헌 [2]

프로토콜 Setup 과정

Verifier의 비밀정보. Prover와공유하지 않음 Polynomial 차수(degree) 갯수만큼 s를 암호화함

이산대수로그 문제로 s값 노출되지 않음

𝒕(𝒔): Target polynomial 계산:(𝒙 − 𝟏)(𝒙 − 𝟐)… . (𝒙 − 𝒅) Prover에게 s 값 암호화된 값 전송

Page 16: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

3.3 zk-SNARK 프로토콜 – simple version

16

III. zk-SNARK

• 참고문헌 [2]

증명자(Prover)

검증자(Verifier)

Prover의 정보 𝒑 𝒙 , Verifier와 공유하지 않음. 𝒉(𝒙) 계산

Prover는 자신의 𝒑 𝒙 정보사용하여, 𝑬(𝒑(𝒔))계산

Prover는 계산한 𝒉(𝒙)정보 사용하여, 𝑬(𝒉(𝒔))계산

Prover는 계산한 𝐄 𝐩 𝐬 , 𝐄(𝐡 𝐬 )를 Verifier에게 전송

Verifier는 𝐄 𝐩 𝐬 = 𝐄 𝐭 𝐬 ∗ 𝐡 𝐬 여부 검증

실제는 𝑬(𝒕(𝒔) ∗ 𝒉(𝒔)) = 𝟎여부만 검증

Page 17: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

1. Projective Coordinate

2. The Concept of Divisor

17

IV. 타원곡선 암호 기술

추가자료:“Computer Security, ECC” 수업 자료,

Howon Kim

Page 18: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

18

Projective Coordinate

IV. 타원곡선 암호 기술

Page 19: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective 좌표계 기초Projective 좌표계에서의 ECC

19

IV. 타원곡선 암호 기술

- Affine 좌표계에서 정의된 ECC를 Projective 좌표계로 변환- Projective 좌표계는 (0:0:0)에서 시작하는 동일한 line 상의 모든 점은 동일함.

• 예에서는 z=1을 projection plane으로 사용할 예정임•

Page 20: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective 좌표계 기초Projective 좌표계에서의 ECC 다음은 projective space 그림임

Origin을 통과하는 green line상의 모든 points 들은 모두 equivalent 함

20

IV. 타원곡선 암호 기술

- Origin을 통과하는 green line 상의 points들은 모두 equivalent함

- 또한, orange line 상의 points 들도 모두equivalent 함

- Orange line은 z=0 plane 위에 있음

z=0 plane

z≠0 plane

Page 21: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective 좌표계 기초

21

IV. 타원곡선 암호 기술

Let us have a look at the green set. If we consider the lines (or equivalent points),

one can remark that they all intersect the plane {𝑧=1}{z=1} (See diagram

below). Thus all the points in the green line have an equivalent into the

plane {𝑧=1}.• 참고자료에서는 all the points in the green area have each an equivalent point in the plane 이라고 함. 이것도 맞는 표현임

• 그런데, z=0 plane에 있는 points들, 즉, x-y평면상의 점들은 z=1 plane에 projection 될 수없음

Page 22: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective 좌표계 기초

22

IV. 타원곡선 암호 기술

• Z=0 평면상의 line을 생각해보자(Y=1 라인)• Origin을 통과하는 모든 line (1)(2)은 y=1 line을 cut함•

(1)

(2)

y=1 line을 cut 하지 못하는평면상의 line 은?

오직 x 축 !

Page 23: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective 좌표계 기초결국, Projective 좌표계상의 모든 점들은 3개로 분류됨

23

IV. 타원곡선 암호 기술

(1) z = 1 평면(2) {y=1, z=0} line(3) x 축, (1:0:0)

ECC에서는 이 라인에서 x=0인 point를 무한원점으로 봄

Page 24: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective Coordinate based ECCECC

24

IV. 타원곡선 암호 기술

Page 25: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective Coordinate based ECC

25

IV. 타원곡선 암호 기술

Page 26: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Projective Coordinate based ECC

26

IV. 타원곡선 암호 기술

Page 27: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[추가] Projective 좌표계 특성

https://en.wikipedia.org/wiki/Homography

27

IV. 타원곡선 암호 기술

https://en.wikipedia.org/wiki/Homogeneous_coordinates

Page 28: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[추가] Projective 좌표계 특성

28

IV. 타원곡선 암호 기술

Page 29: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

29

The Concept of Divisor

IV. 타원곡선 암호 기술

Page 30: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

A divisor D on E is a convenient way to denote a multi-set of points on E, written as the formal sum :

The set of all divisors on E

zero divisor Identity

30

• 𝐷1 = 2(𝑃) + (−[2]𝑃) − 3(𝑂) : 여기서 [2]P는 P+P 결과값을 의미• 2(P)에서의 2는 divisor 정의상의 multiplicity임

IV. 타원곡선 암호 기술

Page 31: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

31

clear;

q:=RandomPrime(50);

Fq:=GF(q);

E:=EllipticCurve([Fq|Random(Fq),Random(Fq)]);

P:=Random(E);

// P: (363162638172091 : 690995858092850 : 1)

Q:=Random(E);

R:=Random(E);

S:=Random(E);

D1:=2*Divisor(P)-3*Divisor(Q);

D2:=3*Divisor(Q)+Divisor(R)-Divisor(S);

Degree(D1);

Degree(D2);

Degree(D1+D2);

Support(D1);

Support(D2);

Support(D1+D2);

-1 // Degree D1

3 // Degree D2

2 // Degree D1+D2

// Support D1:

[

Place at (363162638172091 : 690995858092850 : 1), //P

Place at (318010126258840 : 510288992940672 : 1) // Q

]

[ 2, -3 ]

// Support D2:

[

Place at (318010126258840 : 510288992940672 : 1), // Q

Place at (25517497904939 : 312461169511231 : 1), // R

Place at (313149312984009 : 227520904782981 : 1) // S

]

[ 3, 1, -1 ]

// Support D1+D2:

[

Place at (363162638172091 : 690995858092850 : 1), //P

Place at (25517497904939 : 312461169511231 : 1), // R

Place at (313149312984009 : 227520904782981 : 1) //S

]

[ 2, 1, -1 ]

Example of Divisor:

IV. 타원곡선 암호 기술

Page 32: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

Divisor와 함수 f 연관타원곡선 E와 f의 교점(intersection)을 표현하는 좋은방법

32

(𝑓 ): Divisor of 𝑓

IV. 타원곡선 암호 기술

Page 33: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

33

IV. 타원곡선 암호 기술

두 line (chord line, tangent line)의 degree는 모두 0

이들 교점으로 만들어지는divisor는 zero divisor임

Page 34: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

34

IV. 타원곡선 암호 기술

q:=RandomPrime(50);

Fq:=GF(q);

a:=Random(Fq); b:=Random(Fq);

E:=EllipticCurve([Fq|a,b]);

F<x,y>:=FunctionField(E);

print("E:"), E; print("F:"), F;

DBL:=function(P);

xP:=P[1]; yP:=P[2];

lambda:=(3*xP^2+a)/(2*yP);

nu:=yP-lambda*xP;

return F!(y-(lambda*x+nu));

end function;

ADD:=function(P,Q);

xP:=P[1]; yP:=P[2];

xQ:=Q[1]; yQ:=Q[2];

lambda:=(yQ-yP)/(xQ-xP);

nu:=yP-lambda*xP;

return F!(y-(lambda*x+nu));

end function;

P:=Random(E); Q:=Random(E);

print("P:"), P; print("Q:"),Q;

l:=DBL(P);

printf "Double of P: %o \n ", l;

printf "Support of Double of l: %o \n",

Support(Divisor(l));

printf " 2*P = %o \n", 2*P;

printf " -2*P = %o \n\n",(-2*P);

l:=ADD(P,Q);

printf "Addition of P+Q: %o \n ", l;

printf "Support of P+Q : %o \n", Support(Divisor(l));

printf " P = %o \n",P;

printf " Q = %o \n",Q;

printf " Q-(P+Q)= %o \n",(-(P+Q));

E: Elliptic Curve defined by y^2 = x^3 + 1084472957657114*x +

605364546533002 over GF(1110264856546123)

F: Function Field of Elliptic Curve defined by y^2 = x^3 +

1084472957657114*x + 605364546533002 over

GF(1110264856546123)

P: (894862396961195 : 538339522630905 : 1)

Q: (716348423986095 : 719492329186510 : 1)

Double of P: y + 1086574041327256*x + 2051822894536

Support of Double of l: [

Place at (0 : 1 : 0),

Place at (894862396961195 : 538339522630905 : 1),

Place at (393993747093879 : 624586048534088 : 1)

]

2*P = (393993747093879 : 485678808012035 : 1)

-2*P = (393993747093879 : 624586048534088 : 1)

Addition of P+Q: y + 453619095040603*x + 280489569569293

Support of P+Q : [

Place at (0 : 1 : 0),

Place at (894862396961195 : 538339522630905 : 1),

Place at (716348423986095 : 719492329186510 : 1),

Place at (388334245727152 : 765229009643347 : 1)

]

P = (894862396961195 : 538339522630905 : 1)

Q = (716348423986095 : 719492329186510 : 1)

Q-(P+Q)= (388334245727152 : 765229009643347 : 1)

Example 3.0.2

Page 35: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

35

IV. 타원곡선 암호 기술

Page 36: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

36

IV. 타원곡선 암호 기술

clear;

Fq:=GF(131);

a:=0; b:=5;

A2<x,y>:=AffineSpace(Fq,2);

Eaff:=Curve(A2,[y^2-(x^3+a*x+b)]);

printf "ECC(Affine) %o \n", Eaff;

P:=Eaff![2,12];

Q:=Eaff![67,56];

lambda:=(Q[2]-P[2])/(Q[1]-P[1]);

nu:=Q[2]-lambda*Q[1];

l:=Curve(A2,[y-(lambda*x+nu)]);

printf "P: %o, Q: %o\n", P, Q;

printf "line l: %o\n", l;

printf "Intersection points of E & l:%o \n\n",

IntersectionPoints(Eaff,l);

P2<X,Y,Z>:=ProjectiveSpace(Fq,2);

E:=EllipticCurve([Fq|a,b]);

printf "\n ECC(Projective) %o \n", E;

F<x,y>:=FunctionField(E);

l:=y-(lambda*x+nu);

D:=Divisor(l);

printf "Support of D: %o\n", Support(D);

//or

printf "Zeros of line l: %o", Zeros(l);

printf "Poles of line l: %o", Poles(l);

ECC(Affine) Curve over GF(131) defined by 130*x^3 + y^2 + 126

P: (2, 12), Q: (67, 56)

line l: Curve over GF(131) defined by 88*x + y + 74

Intersection points of E & l:{@ (2, 12), (67, 56), (77, 93) @}

ECC(Projective) Elliptic Curve defined by y^2 = x^3 + 5 over

GF(131)

Support of D: [

Place at (0 : 1 : 0),

Place at (77 : 93 : 1),

Place at (67 : 56 : 1),

Place at (2 : 12 : 1)

]

Zeros of line l: [

Place at (77 : 93 : 1),

Place at (67 : 56 : 1),

Place at (2 : 12 : 1)

]

Poles of line l: [ Place at (0 : 1 : 0) ]

Example 3.0.3

Page 37: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Basics on Divisor

37

IV. 타원곡선 암호 기술즉, function 간의 연산은divisor 간의 연산으로 볼 수

있음.

function = zeros/poles~ divisor : points들의 합

Page 38: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

Divisor Class Group – principal divisor

38

IV. 타원곡선 암호 기술

principal divisor는 degree가 0인zero divisor이면서 curve상의

points의 합이므로 O가 됨 이때문에 Curve E상의 divisor D는

function f의 divisor라고 함

Page 39: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

1. Pairing 개요

2. Pairing 예제(Weil Pairing)

3. [참고]

39

V. Pairing 개요

Page 40: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.1 Pairings 개요

40

Pairing 개요

• Pairing is a bilinear map on an abelian group 𝑀 taking values in some other abelian group 𝑅

• Bilinearity 특성이 pairing을 유용한 crypto protocol로 만들며, 동일한 order를 가지는cyclic group을 유지할 수 있도록 함!

Page 41: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.1 Pairings 개요

41

Notation of the bilinear map

• Pairing을 구성하는 세개의 Group과 Bilinearity 특성

Page 42: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.1 Pairings 개요

42

Bilinear Pairings

• Pairing을 구성하는 세개의 Group과 Bilinearity 특성

Page 43: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.1 Pairings 개요

43

Bilinear Pairings

• Pairing을 구성하는 세개의 Group과 Bilinearity 특성

Page 44: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.2 Pairings 계산

44

Pairing 계산

Page 45: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.3 Pairings 예제

45

Pairing 예:

여기서 𝑃와 𝑄를적절히선택하여,이에의해만들어지는 𝑠𝑢𝑏 𝑔𝑟𝑜𝑢𝑝 <P>,<Q>의 order 값 r = 641을

가짐. 즉, 서로 다른 group이지만, 동일한 order를 가짐

𝑃와 𝑄의 Weil pairing 𝒆 ∙ ,∙ ∶ 𝒆 𝑷, 𝑸 =6744 u + 5677 인 경우에 대해 (아래에서) Bilinearity 검증

수행. (한편, Pairing 연산 결과는 𝑭𝒒𝟐∗ 의 element임)

𝑭𝑞와 𝑭𝑞2상의 ECC정의

Bilinearity 특성 검증

𝒆 𝑭𝑞 , 𝑭𝑞2 → 𝑭𝒒𝟐∗

Page 46: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.4 Miller Algorithm

46

m*P에서 (m+1)*P이 될때, 결국P가 더해짐(+P)을 의미함.

Curve 상에서의덧셈(doubling)은 Chord와Tangent line으로 표현됨

rational function fm+1,P과fm,P간의 관계식으로 표현됨

r은 order이므로 [r]P는 0임.

(fm,P): Principal divisor: 결국 curve를만족시키는 points의 합이 O이 됨

evaluate해서 0이 라는 말 해!

이를 rational function 사용하여 표현

Page 47: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.4 Miller Algorithm

47

Example

Page 48: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.4 Miller Algorithm

48

Page 49: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.4 Miller Algorithm

49

Doubling on an EC

Page 50: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.4 Miller Algorithm

50

Addition on an EC

Page 51: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

5.4 Miller Algorithm

51

Arithmetic levels

참고) Software Implementation of Pairings by Diego F. Aranha, University of Campinas

Page 52: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고] Extension Field에서 정의되는 ECC Group

52

Pairing 개요

𝑭𝒒의 확장체인 𝑭𝑞𝑘에서

𝑬 𝑭𝑞𝑘 정의함

이때, 𝑬 𝐹𝑞𝑘 은 subgroup으로

𝑬 𝐹𝑞 가짐

참고: Embedded degree k

Page 53: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고] divisor와 pairing의 관계

53

https://crypto.stackexchange.com/questions/55342/i-cannot-understand-the-concept-of-a-divisor-for-an-elliptic-curve

이름이 왜 divisor일까?쉽게 function을 구성하는/만드는 것이므로…라고 이해

Page 54: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고] divisor와 pairing의 관계

54

Page 55: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고] divisor와 pairing의 관계

55

이를보면결국 divisor는 zero 몇개, pole 몇개인데, 이를사용하면, ----> (rational) function을복구할수있다.

즉, divisor라는용어를쓴이유는? function의일부이므로.

Page 56: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고]

56

Pairing 계산

Page 57: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고]

57

Pairing 계산

Page 58: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고]

58

Pairing 계산

Page 59: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고] Simple Explanation of Miller Algorithm

59

Pairing 계산

Page 60: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

[참고] Coset 개념과 Quotient group 개념

60

Coset 개념

if G is a group, and H is a subgroup of G, and g is an element of G, then

gH = { gh : h an element of H } is the left coset of H in G with respect to g, and

Hg = { hg : h an element of H } is the right coset of H in G with respect to g.

If the group operation is written additively, the notation used changes to g + H or H + g.

Cosets are a basic tool in the study of groups; for example they play a central role

in Lagrange's theorem that states that for any finite group G, the number of elements of

every subgroup H of G divides the number of elements of G.

• G is the group (Z/8Z, +), the integers mod 8 under addition.

• The subgroup H contains only 0 and 4, and is isomorphic

to (Z/2Z, +).

• There are four left cosets of H: H, 1 + H, 2 + H, 3 + H (written

using additive notation since this is the additive group).

• Together they partition the entire group G into equal-size, non-

overlapping sets. The index [G : H] is 4.

Page 61: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

determinat

61

determinant

Page 62: PowerPoint 프레젠테이션infosec.pusan.ac.kr/wp-content/uploads/2019/09/Pairing... · 2019-09-16 · 3.2 zk-SNARK 구조: Zero-knowledge Proof 영지식증명(Zero-knowledge Proof)

determinat

62

determinant