Add emscripten-compiled curve25519 module

Build with `grunt compile && grunt concat:curve25519` after installing
emscripten.

Enable by either (a) not loading nativeclient.js or (b) setting
`textsecure.NATIVE_CLIENT = false` before loading nativeclient.js.
This commit is contained in:
lilia 2014-11-07 17:55:33 -08:00
parent 3d27c98845
commit b4f4f87a7c
15 changed files with 9011 additions and 4 deletions

View file

@ -15,6 +15,7 @@
*/
'use strict';
window.assert = chai.assert;
describe("Crypto", function() {
describe("Encrypt AES-CBC", function() {

View file

@ -0,0 +1,28 @@
/* vim: ts=4:sw=4
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
'use strict';
describe('curve25519_compiled.js', function() {
describe('curve25519_donna', function() {
it('exists', function() {
var curve25519_donna = Module.cwrap('curve25519_sign', 'string', 'string');
assert.isDefined(Module.cwrap);
});
});
test_curve25519_implementation(curve25519);
});

View file

@ -142,6 +142,7 @@
<script type="text/javascript" src="../js/sendmessage.js" data-cover></script>
<script type="text/javascript" src="../js/chromium.js"></script>
<script type="text/javascript" src="../js/curve25519_compiled.js"></script>
<script type="text/javascript" src="../js/views/notifications.js"></script>
<script type="text/javascript" src="../js/views/list_view.js" data-cover></script>
@ -163,5 +164,6 @@
<script type="text/javascript" src="views/message_view_test.js"></script>
<script type="text/javascript" src="views/list_view_test.js"></script>
<script type="text/javascript" src="views/threads_test.js"></script>
<script type="text/javascript" src="curve25519_compiled_test.js"></script>
</body>
</html>