-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathecdsa.html
244 lines (193 loc) · 9.95 KB
/
ecdsa.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>ECDSA</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/xcode.css">
<!-- Theme override for teachbitcoin -->
<link rel="stylesheet" href="css/teachbitcoin.css">
<!-- Google Font Roboto -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
</head>
<body>
<div class="reveal">
<div class="slides">
<!-- *********** Begin: Pedersenn Commitment *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">Pedersen 承诺(commiment)</span>
</div>
<!-- Derivation Graphic -->
<img src="images/ecdsa/commitment0.svg" class = "image" style = "z-index: -1;">
<img src="images/ecdsa/commitment1.svg" class = "fragment image" style = "z-index: -1;">
<img src="images/ecdsa/commitment2.svg" class = "fragment image" style = "z-index: -1;">
<!-- 2 column container -->
<!-- 45% div for formula and curve--><!-- 45% text & bulletpoint -->
<div class = "multi_text_box_container" style = "padding: 0px 0 0 0; width: 1350px;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 40%; font-size: 22px;">
<div style ="text-align: center;">
</div>
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 50%; font-size: 22px; margin: 60px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: bold;">只有一个值能产生(计算出)对应的承诺:<br>这就是”绑定(binding)“</li>
<ul>
<li>一旦 <span class="inline_code">u</span> 被揭示,承诺 <span class="inline_code">C</span> 就可以被验证。</li>
<li>绑定: 对于给定的秘密 <span class="inline_code">u</span>,<span class="inline_code">C</span> 也固定。</li>
<li>信息泄漏:两个相同的值拥有相同的承诺。</li>
</ul>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">随机的因素(factor)使承诺得以”隐藏(hiding)“。</li>
<ul>
<li>无论 <span class="inline_code">u</span> 的值如何,拥有不同的承诺。</li>
<li>假设不知道点 <span class="inline_code">H</span> 的生成元(generator)。</li>
</ul>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">被破坏的承诺概形(commitment scheme):</li>
<ul>
<li>点 <span class="inline_code">H</span> 的生成元 <span class="inline_code">e</span> 被知道了。</li>
<li><span class="inline_code">u</span> 得值可被修改,承诺仍然不变。</li>
</ul>
</div>
</div><!-- End of 2 column container -->
</section>
<!-- *********** END: Pedersen Commitment *********** -->
<!-- *********** Begin: ecdsa *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">椭圆曲线数字签名算法(ECDSA)</span>
</div>
<!-- Derivation Graphic -->
<img src="images/ecdsa/ecdsa0.svg" class = "image" style = "z-index: -1;">
<img src="images/ecdsa/ecdsa1.svg" class = "fragment image" style = "z-index: -1;">
<!-- 2 column container -->
<!-- 45% div for formula and curve--><!-- 45% text & bulletpoint -->
<div class = "multi_text_box_container" style = "padding: 0px 0 0 0; width: 1350px;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 40%; font-size: 22px;">
<div style ="text-align: center;">
</div>
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 50%; font-size: 22px; margin: 60px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: bold;">ECDSA 可以看作一个只能被秘密`e`的拥有者“破坏”的承诺概形。</li>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">R 点:</li>
<ul>
<li>随机点 (盲化blinding).</li>
<li><span class="inline_code">R</span> 点的 x-坐标在等式左&右边的都有被表现。</li>
<li>只对于秘密 <span class="inline_code">e</span>等式才能达到平衡。</li>
</ul>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">已签名的消息 z:</li>
<ul>
<li>对于一个给定的随机点 <span class="inline_code">R</span>,<span class="inline_code">z</span> 向等式的左边承诺。</li>
</ul>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">ECDSA 验证:</li>
<ul>
<li>需要 <span class="inline_code">z</span>, <span class="inline_code">r_x</span>, <span class="inline_code">s</span> 和公钥 <span class="inline_code">P</span> 来验证签名。</li>
</ul>
</div>
</div><!-- End of 2 column container -->
</section>
<!-- *********** END: ecdsa *********** -->
<!-- *********** Begin: DER encoding *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">DER 编码</span>
</div>
<!-- Derivation Graphic -->
<img src="images/ecdsa/der_encoding.svg" class = "image" style = "z-index: -1;">
<!-- 2 column container -->
<!-- 45% div for formula and curve--><!-- 45% text & bulletpoint -->
<div class = "multi_text_box_container" style = "padding: 0px 0 0 0; width: 1350px;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 40%; font-size: 22px;">
<div style ="text-align: center;">
</div>
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 50%; font-size: 22px; margin: 60px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: bold;">libsecp256k1 代替 OpenSSL</li>
<ul>
<li>OpenSSL 的问题在于不同系统间编码可能不同。</li>
<li>libsecp256k1 解决了这个系统依赖性的问题。</li>
</ul>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">严格的编码 (BIP66)</li>
<ul>
<li>移除了编码的可变性:共识层强制执行的编码标准。</li>
<li>移除了 ECDSA 的可变性:强制使用较小的 s 的值。</li>
</ul>
<hr style = "height: 5px; visibility: hidden;">
<li style = "font-weight: bold;">DER 签名大小为 70-72 字节。</li>
<ul>
<li>r_x 的长度: 32/33 字节</li>
<ul>
<li>有符号 256-位,无前导空位。</li>
</ul>
<li>s 的长度: 31/32 字节</li>
<ul>
<li>强制使用较小的 s,无前导空位。</li>
</ul>
</ul>
</div>
</div><!-- End of 2 column container -->
</section>
<!-- *********** END: ecdsa *********** -->
</div><!-- END: Lecture Materials Div -->
</div><!-- END: Reveal Div -->
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
// { src: 'plugin/math/math.js', async: true }
],
// math: {
// mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
// config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html
// },
previewLinks: false,
// Push each slide change to the browser history
history: true,
// Enable keyboard shortcuts for navigation
keyboard: true,
// Enables touch navigation on devices with touch input
overview: false,
touch: false,
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1366,
height: 768,
// Factor of the display size that should remain empty around the content
margin: 0.05,
// Bounds for smallest/largest possible scale to apply to content
minScale: 0.2,
maxScale: 1.5
});
Reveal.configure({ slideNumber: false });
</script>
</body>
</html>