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

@ -22,9 +22,8 @@
* for all low-level crypto operations,
*/
// TODO Select an curve25519 implementation
//var curve25519 = textsecure.NATIVE_CLIENT ? textsecure.nativeclient : textsecure.tweetnacl || asmjs;
var curve25519 = textsecure.nativeclient;
var curve25519 = window.curve25519;
if (textsecure.NATIVE_CLIENT) curve25519 = textsecure.nativeclient;
window.textsecure.crypto = {
getRandomBytes: function(size) {