Skip to content

Commit d96986a

Browse files
committed
libsodium 1.0.19
1 parent 10289df commit d96986a

File tree

107 files changed

+1011
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1011
-87
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ $(MODULES_SUMO_DIR)/libsodium-sumo.js: wrapper/libsodium-pre.js wrapper/libsodiu
7171
cat $(MODULES_SUMO_DIR)/libsodium-sumo.js $(MODULES_SUMO_DIR)/libsodium-wrappers.js > $(BROWSERS_SUMO_DIR)/sodium.js
7272

7373
$(LIBSODIUM_DIR)/test/default/browser/sodium_core.html: $(LIBSODIUM_DIR)/configure
74-
cd $(LIBSODIUM_DIR) && ./dist-build/emscripten.sh --browser-tests
74+
cd $(LIBSODIUM_DIR) && env CPPFLAGS="-DFAVOR_PERFORMANCE" ./dist-build/emscripten.sh --browser-tests
7575
rm -f $(LIBSODIUM_DIR)/test/default/browser/*.asm.html $(LIBSODIUM_DIR)/test/default/browser/*.asm.js
7676
rm -fr $(BROWSERS_TEST_DIR) && cp -R $(LIBSODIUM_DIR)/test/default/browser $(BROWSERS_TEST_DIR)
7777

7878
$(LIBSODIUM_JS_DIR)/lib/libsodium.js: $(LIBSODIUM_DIR)/configure
79-
cd $(LIBSODIUM_DIR) && ./dist-build/emscripten.sh --standard
79+
cd $(LIBSODIUM_DIR) && env CPPFLAGS="-DFAVOR_PERFORMANCE" ./dist-build/emscripten.sh --standard
8080

8181
$(LIBSODIUM_JS_SUMO_DIR)/lib/libsodium.js: $(LIBSODIUM_DIR)/configure
82-
cd $(LIBSODIUM_DIR) && ./dist-build/emscripten.sh --sumo
82+
cd $(LIBSODIUM_DIR) && env CPPFLAGS="-DFAVOR_PERFORMANCE" ./dist-build/emscripten.sh --sumo
8383

8484
$(LIBSODIUM_DIR)/configure: $(LIBSODIUM_DIR)/configure.ac
8585
cd $(LIBSODIUM_DIR) && ./autogen.sh
File renamed without changes.

browsers-test/aead_aegis128l.html

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta name="google" content="notranslate" />
5+
<style>
6+
body {
7+
background: white;
8+
color: black;
9+
}
10+
.test p {
11+
margin: 1px;
12+
}
13+
.test {
14+
font-family: monospace;
15+
white-space: pre;
16+
}
17+
.err {
18+
background: red;
19+
color: white;
20+
}
21+
.passed {
22+
background: green;
23+
color: white;
24+
}
25+
</style>
26+
</head>
27+
<body>
28+
<h1></h1>
29+
<section class="test" id="test-res"></section>
30+
<script>
31+
var performance;
32+
if (typeof performance !== 'object') {
33+
performance = {
34+
mark: function(s) { this[s] = new Date() },
35+
measure: function(_t, s1, s2) { this.t = this[s2] - this[s1] },
36+
getEntriesByName: function() { return [ { duration: this.t } ] }
37+
};
38+
}
39+
40+
var Module = { preRun: function() { performance.mark('bench_start') } };
41+
42+
function runTest(tname) {
43+
var xhr, expected, hn, idx = 0, passed = true;
44+
45+
function outputReceived(e) {
46+
var found = e.data;
47+
var p = document.createElement('p');
48+
if (found !== expected[idx++]) {
49+
p.className = 'err';
50+
passed = false;
51+
}
52+
p.appendChild(document.createTextNode(found));
53+
document.getElementById('test-res').appendChild(p);
54+
if (idx >= expected.length) {
55+
if (passed) {
56+
performance.mark('bench_end')
57+
performance.measure('bench', 'bench_start', 'bench_end');
58+
var duration = Math.round(performance.getEntriesByName('bench')[0].duration);
59+
hn.appendChild(document.createTextNode(' - PASSED (time: ' + duration + ' ms)'));
60+
hn.className = 'passed';
61+
} else {
62+
hn.appendChild(document.createTextNode(' - FAILED'));
63+
hn.className = 'err';
64+
}
65+
}
66+
}
67+
68+
hn = document.getElementsByTagName('h1')[0];
69+
hn.appendChild(document.createTextNode('Test: ' + tname));
70+
71+
try {
72+
xhr = new ActiveXObject('Microsoft.XMLHTTP');
73+
} catch (e) {
74+
xhr = new XMLHttpRequest();
75+
}
76+
xhr.open('GET', tname + '.exp');
77+
xhr.onreadystatechange = function() {
78+
if (xhr.readyState != 4 ||
79+
(xhr.status != 200 && xhr.status != 302 && xhr.status != 0)) {
80+
return;
81+
}
82+
expected = xhr.responseText.split('\n');
83+
if (expected.length > 0 && expected[expected.length - 1] === '') {
84+
expected.pop();
85+
}
86+
expected.push('--- SUCCESS ---');
87+
window.addEventListener('test-output', outputReceived, false);
88+
var s = document.getElementsByTagName('script')[0];
89+
var st = document.createElement('script');
90+
st.src = tname + '.js';
91+
s.parentNode.insertBefore(st, s);
92+
}
93+
xhr.send(null);
94+
}
95+
runTest('aead_aegis128l');
96+
</script>
97+
</body>
98+
</html>

browsers-test/aead_aegis128l.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browsers-test/aead_aegis256.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OK

browsers-test/aead_aegis256.html

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta name="google" content="notranslate" />
5+
<style>
6+
body {
7+
background: white;
8+
color: black;
9+
}
10+
.test p {
11+
margin: 1px;
12+
}
13+
.test {
14+
font-family: monospace;
15+
white-space: pre;
16+
}
17+
.err {
18+
background: red;
19+
color: white;
20+
}
21+
.passed {
22+
background: green;
23+
color: white;
24+
}
25+
</style>
26+
</head>
27+
<body>
28+
<h1></h1>
29+
<section class="test" id="test-res"></section>
30+
<script>
31+
var performance;
32+
if (typeof performance !== 'object') {
33+
performance = {
34+
mark: function(s) { this[s] = new Date() },
35+
measure: function(_t, s1, s2) { this.t = this[s2] - this[s1] },
36+
getEntriesByName: function() { return [ { duration: this.t } ] }
37+
};
38+
}
39+
40+
var Module = { preRun: function() { performance.mark('bench_start') } };
41+
42+
function runTest(tname) {
43+
var xhr, expected, hn, idx = 0, passed = true;
44+
45+
function outputReceived(e) {
46+
var found = e.data;
47+
var p = document.createElement('p');
48+
if (found !== expected[idx++]) {
49+
p.className = 'err';
50+
passed = false;
51+
}
52+
p.appendChild(document.createTextNode(found));
53+
document.getElementById('test-res').appendChild(p);
54+
if (idx >= expected.length) {
55+
if (passed) {
56+
performance.mark('bench_end')
57+
performance.measure('bench', 'bench_start', 'bench_end');
58+
var duration = Math.round(performance.getEntriesByName('bench')[0].duration);
59+
hn.appendChild(document.createTextNode(' - PASSED (time: ' + duration + ' ms)'));
60+
hn.className = 'passed';
61+
} else {
62+
hn.appendChild(document.createTextNode(' - FAILED'));
63+
hn.className = 'err';
64+
}
65+
}
66+
}
67+
68+
hn = document.getElementsByTagName('h1')[0];
69+
hn.appendChild(document.createTextNode('Test: ' + tname));
70+
71+
try {
72+
xhr = new ActiveXObject('Microsoft.XMLHTTP');
73+
} catch (e) {
74+
xhr = new XMLHttpRequest();
75+
}
76+
xhr.open('GET', tname + '.exp');
77+
xhr.onreadystatechange = function() {
78+
if (xhr.readyState != 4 ||
79+
(xhr.status != 200 && xhr.status != 302 && xhr.status != 0)) {
80+
return;
81+
}
82+
expected = xhr.responseText.split('\n');
83+
if (expected.length > 0 && expected[expected.length - 1] === '') {
84+
expected.pop();
85+
}
86+
expected.push('--- SUCCESS ---');
87+
window.addEventListener('test-output', outputReceived, false);
88+
var s = document.getElementsByTagName('script')[0];
89+
var st = document.createElement('script');
90+
st.src = tname + '.js';
91+
s.parentNode.insertBefore(st, s);
92+
}
93+
xhr.send(null);
94+
}
95+
runTest('aead_aegis256');
96+
</script>
97+
</body>
98+
</html>

browsers-test/aead_aegis256.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browsers-test/aead_aes256gcm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browsers-test/aead_aes256gcm2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browsers-test/aead_chacha20poly1305.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy