forked from andreacorbellini/ecc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodk-add.html
74 lines (74 loc) · 4.36 KB
/
modk-add.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Elliptic Curve point addition (𝔽ₚ)</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.js"></script>
<script type="text/javascript" src="ec.js"></script>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro%3A400%2C700%2C900%2C400italic%2C700italic%2C900italic&subset=latin%2Clatin-ext">
<link rel="stylesheet" type="text/css" href="ec.css">
</head>
<body>
<header>
<h1>Elliptic Curve point addition (𝔽<sub>p</sub>)</h1>
<nav>
<ul>
<li class="field">ℝ</li>
<li><a href="reals-add.html">Addition</a></li>
<li><a href="reals-mul.html">Multiplication</a></li>
<li class="field">𝔽<sub>p</sub></li>
<li><a href="modk-add.html" class="active">Addition</a></li>
<li><a href="modk-mul.html">Multiplication</a></li>
</ul>
</nav>
</header>
<main>
<div id="plot" class="box"></div>
<div class="box">
<div id="form">
<div id="curve-coefficients" class="parameters">
<p>Curve:</p>
<div class="parameter curve-coefficient"><label for="coefficient-a">a</label><input id="coefficient-a" name="a" value="2" type="number" step="1"></div>
<div class="parameter curve-coefficient"><label for="coefficient-b">b</label><input id="coefficient-b" name="b" value="3" type="number" step="1"></div>
</div>
<div id="field-coefficients" class="parameters">
<p>Field:</p>
<div class="parameter curve-coefficient"><label for="coefficient-p">p</label><input id="coefficient-p" name="p" value="97" type="number" step="1"></div>
<div class="placeholder"></div>
</div>
<div id="point-p-coordinates" class="parameters">
<p><em>P</em>:</p>
<div class="parameter point-coordinate"><label for="point-p-x">x</label><input id="point-p-x" name="px" value="17" type="number" step="1"></div>
<div class="parameter point-coordinate"><label for="point-p-y">y</label><input id="point-p-y" name="py" value="10" type="number" step="1"></div>
</div>
<div id="point-q-coordinates" class="parameters">
<p><em>Q</em>:</p>
<div class="parameter point-coordinate"><label for="point-q-x">x</label><input id="point-q-x" name="qx" value="95" type="number" step="1"></div>
<div class="parameter point-coordinate"><label for="point-q-y">y</label><input id="point-q-y" name="qy" value="31" type="number" step="1"></div>
</div>
<div id="point-r-coordinates" class="parameters">
<p><em>R</em> = <em>P</em> + <em>Q</em></span>:</p>
<div class="parameter point-coordinate result"><label for="point-r-x">x</label><input id="point-r-x" name="rx" step="any" readonly></div>
<div class="parameter point-coordinate result"><label for="point-r-y">y</label><input id="point-r-y" name="ry" step="any" readonly></div>
</div>
</div>
<div id="summary">
<p>Point addition over the elliptic curve <span class="curve-equation"></span> in 𝔽<sub class="field-order"></sub>.</p>
<p>The curve has <span class="curve-order"></span> points (including the point at infinity).</p>
<p class="curve-singular-warning"><strong>Warning:</strong> this curve is singular.</p>
<p class="composite-warning"><strong>Warning:</strong> <em>p</em> is not a prime.</p>
</div>
</div>
</main>
<footer>
<p>This tool was created for <a href="http://andrea.corbellini.name/2015/05/17/elliptic-curve-cryptography-a-gentle-introduction/">Elliptic Curve Cryptography: a gentle introduction</a>.</p>
<p>It's free software, released under the <a href="http://opensource.org/licenses/MIT">MIT license</a>, hosted on <a href="https://github.com/andreacorbellini/ecc">GitHub</a> and served by <a href="http://rawgit.com/">RawGit</a>.</p>
</footer>
<script type="text/javascript">
$(function() {
$.ec.curve = new $.ec.modk.PointAddition();
});
</script>
</body>
</html>