-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
60 lines (48 loc) · 1.46 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Crypto tests</title>
</head>
<body>
<div>
<button onclick="launchTest('bi')">JSBN</button>
<button onclick="launchTest('cl')">Long</button>
<button onclick="launchTest('wr')">Worker</button>
<button onclick="launchTest('le')">Leemon</button>
</div>
<script type="text/javascript" src="jsbn_combined.js"></script>
<script type="text/javascript" src="long.js"></script>
<script type="text/javascript" src="bigint.js"></script>
<script type="text/javascript" src="bin_utils.js"></script>
<script type="text/javascript">
var startTime = (new Date()).getTime();
function dT () {
return (((new Date()).getTime() - startTime) / 1000).toFixed(3);
}
function launchTest (test) {
startTime = (new Date()).getTime();
switch (test) {
case 'bi':
pqPrimeBigInteger(new BigInteger(bytesFromHex('1dfaf951107f49df')));
alert(dT());
break;
case 'cl':
pqPrimeLong(goog.math.Long.fromString('1dfaf951107f49df', 16))
alert(dT());
break;
case 'wr':
var worker = new Worker('pq_worker.js');
worker.onmessage = function (e) {
alert(dT());
};
worker.postMessage([29, 250, 249, 81, 16, 127, 73, 223]);
return;
default:
pqPrimeLeemon(str2bigInt('1dfaf951107f49df', 16, Math.ceil(64 / bpe) + 1));
alert(dT());
}
}
</script>
</body>
</html>