-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathec_math.html
1513 lines (1291 loc) · 60.2 KB
/
ec_math.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!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>EC Math</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css">
<!-- Highlight.js used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/default.css">
<!-- Simple.css theme override for teachbitcoin -->
<link rel="stylesheet" href="css/teachbitcoin.css">
<!-- Google Fonts -->
<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">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<!-- *********** REVISED - BEGIN: Chapter Modmath *********** -->
<section class ="box">
<div class = "title">
<span class = "title weight">Chapter </span>Overview
</div>
<img src="images/ec_math/overview_modmath.svg" class = "image" style = "z-index: -1;">
</section>
<!-- *********** END: Chapter Modmath *********** -->
<!-- *********** BEGIN: Finite Field Addition *********** -->
<section class = "box">
<div class = "title"
>Modular<span class = "title weight"> Addition</span>
</div>
<div style = "position: absolute; top: 200px; width: 100%; margin: auto; text-align: center;">
<span class = "math_normal">\(5+8=1\:\left(\bmod 12\:\right)\)</span>
</div>
<img src="images/ec_math/ff_addition.svg" class = "image" style = "z-index: -1;">
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>Imagine all numbers of finite field \(\mathbb{F}_{12}\) wrapped around a circle, like a clock.</li>
<li>For every addition operation, move the needle n steps clockwise.</li>
<li>This is equivalent to taking the remainder if the division: (5 + 8)/12 = 13/12 = 1 Remainder 1</li>
<li>Commutivity: (\(a + b = b + a\))</li>
</li>
</ul>
</div>
</section>
<!-- *********** END: Finite Field Addition *********** -->
<!-- *********** BEGIN: Field Subtraction *********** -->
<section class = "box">
<div class = "title">
Modular<span class = "title weight"> Subtraction</span>
</div>
<div style = "position: absolute; top: 200px; width: 100%; margin: auto; text-align: center;">
<span class = "math_normal">\(4 - 19 = 2 \:\left(\bmod 17\:\right)\)</span>
</div>
<img src="images/ec_math/ff_subtraction.svg" class = "image" style = "z-index: -1;">
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>For a subtractive operation, simply move the needle n steps counter-clockwise.</li>
<li>In our example above, we first move 4 ticks clockwise (positive) then 19 ticks counter-clockwise (negative) to arrive at 2.</li>
</li>
</ul>
</div>
</section>
<!-- *********** END: Field Subtraction *********** -->
<!-- *********** BEGIN: Field Multiplication *********** -->
<section class="box">
<div class = "title"
>Modular <span class = "title weight">Multiplication</span>
</div>
<div style = "position: absolute; top: 200px; width: 100%; margin: auto; text-align: center;">
<span class = "math_normal">\(4 \cdot 5 = 3 \:\left(\bmod 17\:\right)\)</span>
</div>
<img src="images/ec_math/ff_multiplication.svg" class = "image" style = "z-index: -1;">
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>\(4 \cdot 5 = +20\), so we simply move the needle by +20 ticks clockwise and arrive at 3.
</li>
<li>Commutivity (\(a \times b = b \times a\))</li>
</ul>
</div>
</section>
<!-- *********** END: Field Multiplication *********** -->
<!-- *********** BEGIN: Field Distributivity *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">Distributivity</span> of Modular Operations
</div>
<!-- Derivation Graphic -->
<img src="images/ec_math/ff_distributivity.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: 1270px;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 45%; font-size: 27px;">
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 36%; font-size: 22px; margin: 80px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: bold;">Distributivity over add/multiply:</li>
<div class="">
<ul>
<li><span class="inline_code">(a + b)⋅c = a⋅c + b⋅c</span></li>
<li>This is illustrated by example (left).</li>
<li>Modulus can be performed anytime.</li>
</ul>
<hr style = "height:3px; visibility:hidden;">
</div>
</ul>
</div>
</div><!-- End of 2 column container -->
</section>
<!-- *********** END: Field Distributivity *********** -->
<!-- *********** BEGIN: Field Exponentiation *********** -->
<!-- <section class ="box">
<div class = "title"
>Finite Field <span class = "title weight">Exponentiation</span>
</div>
<div style = "position: absolute; top: 200px; width: 100%; margin: auto; text-align: center;">
<span class = "math_normal">\(2^{5}=15\:\left(\bmod 17\:\right)\)</span>
</div>
<img src="images/ec_math/ff_exponentiation.svg" class = "image" style = "z-index: -1;">
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>\(2^{5}=32\), so we move the needle by +32 ticks clockwise and arrive at 15.</li>
<li>Associativity: \( (a^{b})^{c} = (a^{c})^{b}\), no proof provided.</li>
</ul>
</div>
</section> -->
<!-- *********** END: Field Exponentiation *********** -->
<!-- *********** BEGIN: Field Division /w Multiplication Tables *********** -->
<!-- <section class = "box">
<div class = "title"
>Finite Field <span class = "title weight">Division</span>
</div>
<div class = "multi_text_box_container" style = "padding: 50px 0 0 0;">
<div style = "width: 540px; text-align: center; font-size: 35px; font-weight:600;">
Division
</div>
<div style = "width: 540px; text-align: center; font-size: 35px; font-weight:600;">
Multiplication Table
</div>
</div>
<div class = "multi_text_box_container" style = "padding: 5px 0 0 0;">
<div class = "text_box " style = "width: 500px; text-align: center;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none; text-align:center;">
<li>\(2/4=2\:\left(\bmod 6\:\right)\)</li>
<li>\(3/5=4\:\left(\bmod 17\:\right)\)</li>
</ul>
</div>
<div class = "text_box orange_border" style = "width: 500px; text-align: center;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none; text-align:center;">
<li>\(2=4 \cdot 2\:\left(\bmod 6\:\right)\)</li>
<li>\(3=5 \cdot 4\:\left(\bmod 17\:\right)\)</li>
</ul>
</div>
</div>
<div style ="padding: 30px 0 0 0;text-align:center; font-size: 22px; font-style:italic;">
Division over \(\mathbb{F}_{p}\) could (theoretically) be performed by maintaining
<br>
a multiplication table for all pairs of \(\mathbb{F}_{p}\).
</div>
<img src="images/ec_math/ff_division_mult_table_arrow.svg" class = "image" style = "z-index: -1;">
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>Division can simply be defined as the inverse of multiplication (multiplication tables).</li>
<li>However, for prime field \(\mathbb{F}_{p}\), where P is prime, there is an easy way to compute division ...</li>
<li><span style="opacity:0.5; font-style: italic;">The Extended Euclidean algorithm is a standard method for modular division, but is more involved.<span></li>
</li>
</ul>
</div>
</section> -->
<!-- *********** END: Field Division /w Multiplication Tables *********** -->
<!-- *********** BEGIN: Modular Division *********** -->
<section class ="box">
<div class = "title">
Modular <span class = "title weight">Division</span>
</div>
<img src="images/ec_math/ff_division0.svg" class = "image" style = "z-index: -1;">
<img src="images/ec_math/ff_division1.svg" class = "image fragment" style = "z-index: -1;">
<img src="images/ec_math/ff_division2.svg" class = "image fragment" style = "z-index: -1;">
</section>
<!-- *********** END: Modular Division *********** -->
<!-- *********** BEGIN: Field Division for Prime Fields *********** -->
<section class = "box">
<div class = "title">
Division over <span class = "title weight">over Prime Fields</span>
</div>
<div class = "multi_text_box_container" style = "padding: 50px 0 0 0;">
<div style = "width: 540px; text-align: center; font-size: 35px; font-weight:600;">
Fermat's little theorem
</div>
<div style = "width: 540px; text-align: center; font-size: 35px; font-weight:600;">
For prime field \(\mathbb{F}_{p}\)
</div>
</div>
<div class = "multi_text_box_container" style = "padding: 10px 0 0 0;">
<div class = "text_box" style = "width: 500px; text-align: center;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>Where p is prime:</li>
<li>\(n^{p-1} = 1\left(\bmod p\:\right)\)</li>
</ul>
</div>
<div class = "text_box orange_border" style = "width: 500px; text-align: center;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>\(\frac{1}{n} = n^{-1}\left(\bmod p\:\right)\)</li>
<li>\(\frac{1}{n} = n^{-1}\cdot n^{p-1} = n^{p-2} \left(\bmod p\:\right)\)</li>
</ul>
</div>
</div>
<div style ="padding: 30px 0 0 0;text-align:center; font-size: 22px; font-style:italic;">
Since this is equal to one, we can apply to the division equation:
</div>
<img src="images/ec_math/ff_division_fermat_arrow.svg" class = "image" style = "z-index: -1;">
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>Fermat’s little theorem is valid for all prime fields \(\mathbb{F}_{p}\), where p is prime.</li>
<li>To compute prime field division: \(\frac{1}{n} = n^{p-2} \left(\bmod p\:\right)\)</li>
</li>
</ul>
</div>
</section>
<!-- *********** END: Field Division for Prime Fields *********** -->
<!-- *********** BEGIN: Prime Fields *********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Prime Fields</span>
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<li class = "math_large">\(\mathbb{F}_{p} = \left\{0,1,2,...,p-1\right\}\)</li>
<br>
<div>
<li class = "math_normal">Examples:</li>
<ul class = "math_normal">
<li >\(\mathbb{F}_{7} = \left\{0,1,2,3,4,5,6\right\}\)</li>
<li>\(\mathbb{F}_{11} = \left\{0,1,2,3,...,9,10\right\}\)</li>
<li>\(\mathbb{F}_{127} = \left\{0,1,2,3,...,125,126\right\}\)</li>
</ul>
</div>
</ul>
</div>
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>Prime field \(\mathbb{F}_{p}\) is simply a set of integers from \(0\) to \(p-1\), where p is prime.</li>
<li>Addition/Multplication and their inverse operations are defined over all field elements.</li>
<li>Addition/Multplication have commutativity & distributivity properties.</li>
</ul>
</div>
</section>
<!-- *********** END: Finite Fields *********** -->
<!-- *********** REVISED - BEGIN: Chapter Prime Fields *********** -->
<section class ="box">
<div class = "title">
<span class = "title weight">Chapter </span>Overview
</div>
<img src="images/ec_math/overview_primefields.svg" class = "image" style = "z-index: -1;">
</section>
<!-- *********** END: Chapter Prime Fields *********** -->
<!-- *********** BEGIN: Cyclic Groups *********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Cyclic Groups</span>
</div>
<div style = "position: absolute; top: 110px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Closed group operation ( \(\circ\) )</li>
<ul>
<li>\( a \circ b = c \:,\:\: (a,b,c \in \mathbb{G}) \)</li>
<li>Group operation is Associative & Commutative</li>
<ul>
<li>\( (a \circ b)\circ c=a\circ (b\circ c) \)</li>
<li>\(a\circ b=b\circ a\)</li>
</ul>
</ul>
<hr style = "height:1px; visibility:hidden;">
<div class="fragment">
<li style="font-weight:600;">2) Generator group element (\(g\))</li>
<ul>
<li><span class="inline_code">\(g\circ g\circ g...g\circ g\circ g = g^{k} = b \in \mathbb{G}\)</span></li>
<li>Finite \( \lvert \mathbb{G} \rvert \) number of elements in group \(\mathbb{G}\)
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">3) Neutral group element (\(n\))</li>
<ul>
<li>\(a \circ n =a\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">4) Each group element has an inverse</li>
<ul>
<li>\(a\circ a^{-1}=1, \: b\circ b^{-1}=1, \: c\circ c^{-1}=1\)</li>
<li>\(a^{-1}, \: b^{-1}, \: c^{-1}, ... \in \mathbb{G}\)</li>
</ul>
</div>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Cyclic Groups *********** -->
<!-- *********** BEGIN: Generalised Discrete log *********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Generalised</span> Discrete Log Problem
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<li class = "math_large" style="font-weight:600;">Discrete Log Problem for Cyclic Groups:</li>
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li><span class="inline_code" style="font-weight:600;">\(\beta=g \circ g \circ g...g \circ g \circ g = g^{k} \)</span></li>
<ul>
<li>Given <span class="inline_code">\(\beta\)</span>, solve for <span class="inline_code">\(k\)</span></li>
<li>Problem must be hard for large \( \lvert\mathbb{G}\rvert \)</li>
<hr style = "height:1px; visibility:hidden;">
</ul>
<div class = "fragment">
<li style="font-weight:600;">General discrete log solutions apply:</li>
<ul>
<li ><span style="font-weight:600;">Pollard Rho,</span> \(O(\sqrt{ \lvert\mathbb{G}\rvert })\)</li>
<ul>
<li>160bit (group order) / 80bit (security)</li>
<li>256bit (group order) / 128bit (security)</li>
</ul>
</ul>
<div>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Generalised DL *********** -->
<!-- *********** BEGIN: Additive Fields over Prime Fields*********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Additive Groups</span> in Prime Fields
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Closed group operation (\(+\) over \(\mathbb{F}_{p}\))</li>
<ul>
<li>Addition over \(\mathbb{F}_{p}\)</li>
<li>Group operation is Associative & Distributive</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<div class="fragment">
<li style="font-weight:600;">2) Generator group element (\(g\))</li>
<ul>
<li><span class="inline_code">\(g+g+g...g+g+g = k*g = \beta \in \mathbb{G}\)</span></li>
<li>Finite elements in cyclical \(\mathbb{G}\)
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">3) Neutral group element (0)</li>
<ul>
<li>\(\alpha+0 = \alpha\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">4) Group element inverse (\(-\beta)\)</li>
<ul>
<li>\(\beta+(-\beta) = 0\)</li>
</ul>
</div>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Additive Fields over Prime Fields *********** -->
<!-- *********** BEGIN: Additive Field Z11*********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Additive Group</span> in \(\mathbb{F}_{11}\)
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Closed group operation (\(+\) over \(\mathbb{F}_{11}\))</li>
<ul>
<li>Addition over \(\mathbb{F}_{11}\)</li>
<li>Group operation is Associative & Distributive</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">2) Generator group element (2)</li>
<ul>
<li><span class="inline_code">\(2+2+2...2+2+2 = k*2 = \beta \in \mathbb{G}\)</span></li>
<li>Group order \(\lvert\mathbb{G}\rvert\)= 11</li>
<li> \(\mathbb{G}=\left\{2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 0\right\}\)
</ul>
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">3) Neutral group element (0)</li>
<ul>
<li>\(0\in\mathbb{G}\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">4) Group element inverse (\(-\beta)\)</li>
<ul>
<li>(+2/-2), (+4/-4), (+6/-6)...</li>
<li>(+2/+9), (+4/+7), (+6/+5)...</li>
</ul>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Additive Field Z11 *********** -->
<!-- *********** BEGIN: DL over additive Fields*********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Disrete Log</span> in Additive Prime Groups
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<li class = "math_large" style="font-weight:600;">Discrete Log Problem:</li>
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li><span class="inline_code" style="font-weight:600;">\(\beta=g+g+g...g+g+g = k*g\)</span></li>
<ul>
<li>Given <span class="inline_code">\(\beta\)</span>, solve for <span class="inline_code">\(k\)</span></li>
<li>However, for addititive prime groups, the solution is trivial.</li>
<ul>
<li>\(k=\frac{\beta}{\alpha} \:(mod\:p)\)</li>
<li>\(k=\beta\cdot\alpha^{p-2} \:(mod\:p) \)</li>
</ul>
</ul>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: DL over additive Fields *********** -->
<!-- *********** BEGIN: Multiplicative Groups over Prime Fields*********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Multiplicative Groups</span> in Prime Fields \( \mathbb{Z}_p^* \)
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Closed group operation (\(\times\) over \(\mathbb{F}_{p}\))</li>
<ul>
<li>Multiplication over \(\mathbb{F}_{p}\)</li>
<li>Multiplication is Associative & Commutative</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<div class="fragment">
<li style="font-weight:600;">2) Generator group element (\(\alpha\))</li>
<ul>
<li><span class="inline_code">\(g \times g \times g...g \times g \times g = g^{k} = \beta \in \mathbb{Z}_p^* \)</span></li>
<li>Finite elements in cyclical \( \mathbb{Z}_p^* \)
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">3) Neutral group element (1)</li>
<ul>
<li>\(\beta\times1=\beta\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">4) Group element inverse \(\beta^{-1}\)</li>
<ul>
<li>\(\beta\times\beta^{-1}=1\)</li>
</ul>
</div>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Multiplicative Groups over Prime Fields *********** -->
<!-- *********** BEGIN: Multiplicative Groups over F11*********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Multiplicative Group</span> \( \mathbb{Z}_{11}^* \)
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Closed group operation (\(\times\) over \(\ \mathbb{Z}_{11}^* \))</li>
<ul>
<li>Multiplication over \(\mathbb{F}_{p}\)</li>
<li>Multiplication is Associative & Commutative</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">2) Generator group element (2)</li>
<ul>
<li><span class="inline_code">\(2\times2\times2...2\times2\times2 = 2^{k} = \beta \in \mathbb{Z}_11^* \)</span></li>
<li>Group order \(\lvert\mathbb{Z}_{11}^*\rvert\)= 10</li>
<li> \(\mathbb{Z}_{11}^*=\left\{2, 4, 8, 5, 10, 9, 7, 3, 6, 1\right\}\)
</ul>
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">3) Neutral group element (1)</li>
<ul>
<li>\(1\in\mathbb{Z}_{11}^*\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">4) Group element inverse \(\beta^{-1}\)</li>
<ul>
<li>\((2, 2^{9}), (4, 2^8), (8, 2^7)...\)</li>
</ul>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Multiplicative Groups over Prime Fields *********** -->
<!-- *********** BEGIN: DL over multiplicative Fields*********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Disrete Log</span> in \(\mathbb{Z}_{p}^*\)
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<li class = "math_large" style="font-weight:600;">Discrete Log Problem:</li>
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li><span class="inline_code" style="font-weight:600;">\(\beta=g \times g \times g... g \times g \times g = g^{k} \)</span></li>
<ul>
<li>Given <span class="inline_code">\(\beta\)</span>, solve for <span class="inline_code">\(k\)</span></li>
<li><span class="inline_code">\(k=\log_{\alpha}\beta \:(mod\:p) \)</span></li>
<hr style = "height:1px; visibility:hidden;">
<li>Hard for large \( \lvert\mathbb{Z}_{p}^*\rvert \)</li>
<li>General discrete log solutions apply \(O(\sqrt{ \lvert\mathbb{Z}_{11}^*\rvert })\)</li>
<hr style = "height:1px; visibility:hidden;">
</ul>
<div class = "fragment">
<li style="font-weight:600;">However, faster solutions are known for multiplicative groups \(\mathbb{Z}_{p}^*\):</li>
<ul>
<li style="font-weight:600;">Index-Calculus method </li>
<ul>
<li>1040bit (group order) / 80bit (security)</li>
</ul>
<li style="font-weight:600;">Comparison: General discrete log method </li>
<ul>
<li>160bit (group order) / 80bit (security)</li>
</ul>
</ul>
<div>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: DL over multiplicative Fields *********** -->
<!-- *********** BEGIN: Zp* Index-Calculus Solution *********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Index-Calculus Solution</span> for DL over \(\mathbb{Z}_{p}^*\)
</div>
<div style = "position: absolute; top: 100px; left: 120px;">
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Significant fraction of \(\mathbb{Z}_{p}^*\) can be expressed by products from subset.</li>
<hr style = "height:1px; visibility:hidden;">
<div class="fragment">
<li style="font-weight:600;">2) Construct small prime factorbase to express group elements.</li>
<ul>
<li>\(s=\left\{a_{1}, a_{2},...,a_{t}\right\}\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">3) For random \(z\), try to factorize:</li>
<ul>
<li>\(g^{z}=a_1^{s_{1}} \cdot a_2^{s_{2}} ...a_t^{s_{t}}\)</li>
<li>\(z=s_{1}\cdot\log_ga_{1}+s_{2}\cdot\log_ga_{2}...s_{t}\cdot\log_ga_{t}\)</li>
<li>Results in linear relationships. Solve for \(log_ga_{t}\).</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">4) For random \(s\), try to factorize:</li>
<ul>
<li>\(g^{s} \cdot g^{x}=a_1^{b_1} \cdot a_2^{b_2} ... a_t^{b_t}\)</li>
<li>\(x=b_{1}\cdot \log_{g}a_{1} + b_{2}\cdot \log_{g}a_{2} ... b_{t}\cdot \log_{g}a_{t} - s\)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">5) Index-Calculus implies 1040bit (group order) / 80bit (security)</li>
<ul>
<li>Subexponential Complexity </li>
</ul>
</div>
</ul>
</div>
</section>
<!-- *********** END: Zp* Index-Calculus Solution *********** -->
<!-- *********** BEGIN: square and multipy *********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Square and Multiply</span>
</div>
<div style = "position: absolute; top: 150px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<li class = "math_large"><span style="font-weight:600;">Computing</span> \( \beta=g^{k}\) <span style="font-weight:600;">from known </span>\( k \) <span style="font-weight:600;">must be efficient</span></li>
<div>
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li><span class="inline_code" style="font-weight:600;">\( g^{26}=g^{11010} \)</span></li>
<ul>
<li>Bitscan from left to right.</li>
<li>Value of Bit0 is 1: \( g \)</li>
<li>Value of Bit1 is 1: \( g^{2} \times g = g^{3} \)</li>
<li>Value of Bit2 is 0: \( (g^{3})^{2} = g^{6} \)</li>
<li>Value of Bit3 is 1: \( (g^{6})^{2} \times g = g^{13} \)</li>
<li>Value of Bit4 is 0: \( (g^{13})^{2} = g^{26} \)</li>
<hr style = "height:1px; visibility:hidden;">
</ul>
<div class="fragment">
<li style = "font-weight:600;">25 Group operations reduced to 6</li>
<li>\(O(\log n)\) Complexity</li>
</div>
</div>
</ul>
</div>
</section>
<!-- *********** END: square and multipy *********** -->
<!-- *********** BEGIN: General Pollard Rho Solution *********** -->
<section class = "box">
<div class = "title"
><span class = "title weight">Pollard Rho Solution</span> for General DL
</div>
<div style = "position: absolute; top: 100px; left: 120px;">
<ul class = "math_normal", style="margin: 0px; padding: 0px; list-style-type: none;">
<hr style = "height:1px; visibility:hidden;">
<li style="font-weight:600;">1) Random walk \(i,j\), find collisions for:</li>
<ul>
<li>\( g^{i_1} \cdot \beta^{j_1}=g^{i_2} \cdot \beta^{j_2} \)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
<div class="fragment">
<li style="font-weight:600;">2) When collision is found:</li>
<ul>
<li>\( i_1+x\cdot j_1 = i_2 + x\cdot j_2 \:\:mod(\vert G \vert ) \)</li>
<li>\( x=\frac{i_2-i_1}{j_1-j_2}\:\:mod(\vert G \vert) \)</li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
<div class="fragment">
<li style="font-weight:600;">3) 160bit (group order) / 80bit (security)</li>
<ul>
<li> Intuition: Birthday attack, \(O(\sqrt{n})\) complexity </li>
</ul>
<hr style = "height:1px; visibility:hidden;">
</div>
</ul>
</div>
</section>
<!-- *********** END: Pollard Rho Solution *********** -->
<!-- *********** REVISED - BEGIN: EC Reals *********** -->
<section class ="box">
<div class = "title">
<span class = "title weight">Chapter </span>Overview
</div>
<img src="images/ec_math/overview_ecreals.svg" class = "image" style = "z-index: -1;">
</section>
<!-- *********** END: Chapter EC Reals *********** -->
<!-- *********** BEGIN: EC over real numbers *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">Ellipic Curves</span> over Real Numbers
</div>
<!-- Graph -->
<img src="images/ec_math/ec_real.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: 50px 0 0 0;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 45%; font-size: 27px;">
<div style ="text-align: center;">
Curve shown: \(y^{2}=x^{3}+7\)
</div>
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 45%; font-size: 27px; margin: 60px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: 600;">Elliptic curve general form:</li>
<li>\(y^{2}=ax^{3}+bx+c\)</li>
<br>
<li style = "font-weight: 600;">The secp256k1 curve form:</li>
<li>\(y^{2}=x^{3}+7\)</li>
<br>
<li style = "font-weight: 600;">Elliptic curve points:</li>
<li><span class="inline_code">EC-Point P(x,y)</span>on the elliptic curve fulfills the its curve equation.</li>
<br>
</ul>
</div>
</div><!-- End of 2 column container -->
</section>
<!-- *********** END: EC over real numbers *********** -->
<!-- *********** BEGIN: EC over reals: Addition *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">EC-Point Addition </span>over Real Numbers
</div>
<!-- Images step 0 - 3 -->
<img src="images/ec_math/ec_addition_step0.svg" class = "image" style = "z-index: -1;">
<img src="images/ec_math/ec_addition_step1.svg" class = "fragment fade-in image" style = "z-index: -1;">
<img src="images/ec_math/ec_addition_step2.svg" class = "fragment fade-in image" style = "z-index: -1;">
<img src="images/ec_math/ec_addition_step3.svg" class = "fragment fade-in image" style = "z-index: -1;">
<!-- Horizontal Text Box -->
<!-- Left Text Div --><!-- Right Text Div -->
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<div class = "multi_text_box_container">
<!-- Left text div -->
<div style = "width: 55%">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>1) Form a line with P1 & P2</li>
<li>2) Intersect resulting line with EC</li>
<li>3) Reflect intersection point across X-axis for P3</li>
</ul>
</div>
</div>
</div><!-- End of Horizontal Text Box -->
</section>
<!-- *********** END: EC over reals: Addition *********** -->
<!-- *********** BEGIN: EC over reals: Computation of Addition *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">EC-Point Addition</span> (Computation)
</div>
<!-- Container for equation list -->
<div style = "position: absolute; top: 120px; left: 120px;">
<ul style = "list-style-type: none; margin: 0;">
<li class = "math_normal" style = "margin:0; font-weight:600;"
>For an elliptic curve of form:
</li>
<ul class = "math_normal">
<li >\(y^{2}=ax^{3}+bx+c\)</li>
</ul>
<br>
<div class = "">
<li class = "math_normal" style = "margin: 0 0 20px 0; font-weight:600;"
>Computation of \(P_{3} = P_{1} + P_{2}\)
</li>
<ul class = "math_normal">
<li >\(P_{3}(x_{3},y_{3}) = P_{1}(x_{1},y_{1}) + P_{2}(x_{2},y_{2})\)</li>
<ul>
<li>\(s = \frac{y_{2}-y_{1}}{x_{2}-x_{1}}\) for \(x_{1} \neq x_{2}\)</li>
<li>\(x_{3} = s^{2}-x_{1}-x_{2}\)</li>
<li>\(y_{3}=s(x_{1}-x_{3})-y_{1}\)</li>
</ul>
</ul>
</div>
</ul>
</div>
<!-- Container for bottom horizontal text bar -->
<div class = "text_box_horizontal" style = "position: absolute; top: 530px; left: 65px;">
<ul style = "margin: 0px; padding: 0px; list-style-type: none;">
<li>The equations shown describe EC-point addition where \(x_{1} \neq x_{2}\).</li>
</ul>
</div>
</section>
<!-- *********** END: EC over reals: Computation of Addition *********** -->
<!-- *********** BEGIN: EC over reals: Addition with INF *********** -->
<section class = "box">
<div class = "title">
EC Point Addition with <span class = "title weight">Infinity</span>
</div>
<!-- Graph -->
<img src="images/ec_math/ec_addition_inf.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: 50px 0 0 0;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 45%; font-size: 28px;">
<div style ="text-align: center;">
</div>
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 45%; font-size: 23px; margin: 60px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: 600;">The Infinity Point:</li>
<li>The (Inf/Inf) point is defined as a point which is infinitely far away in the direction of the y-axis.
</li>
<br>
<li>Therefore, we can add a point P1 to the infinity point simply by connecting a vertical line through P1.</li>
<br>
<li>\( P_{1}(x_{1},y_{1}) + (Inf/Inf) = P_{1}(x_{1},y_{1}) \)</li>
<li>\( P_{1}(x_{1},y_{1}) + P_{2}(x_{1},-y_{1}) = (Inf/Inf) \)</li>
</ul>
</div>
</div><!-- End of 2 column container -->
</section>
<!-- *********** END: EC over reals: Addition with INF *********** -->
<!-- *********** BEGIN: EC over reals: Scalar x EC Point *********** -->
<section class = "box">
<div class = "title">
<span class = "title weight">Scalar</span> x <span class = "title weight">EC Point</span>
</div>
<!-- Graph -->
<img src="images/ec_math/ec_multiplication.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: 20px 0 0 0;">
<!-- 45% div for formula and curve-->
<div class = "" style = "width: 50%; font-size: 28px;">
<div style ="text-align: center;">
\(P_{3} = P_{1} + P_{1} = 2 \cdot P_{1}\)
</div>
</div>
<!-- 45% text & bulletpoint -->
<div class = "text_box"
style = "width: 50%; font-size: 21px; margin: 0px 0 0 0">
<ul style = "margin: 0; padding: 0px; list-style-type: none;">
<li style = "font-weight: 600;">Scalar multiplication of an EC point P</li>
<ul>
<li><span class="inline_code">s ⋅ P</span> equals adding <span class="inline_code">P</span> to itself <span class="inline_code">s</span> times.</li>
</ul>
<hr style = "height: 1px; visibility: hidden;">