Refactor crypto.js and native client interface
NB: this diff is best viewed with --ignore-whitespace Distills crypto.js down to the hard cryptoey bones. It pulls from webcrypto for aes and hmac, and from native client for curve25519 stuff or potentially another object implementing the handful of needed curve25519 functions. Everything else formerly known as crypto, including session storage and management, axolotl, etc.. is now protocol.js. The separation is not quite perfect, but it's a big step. nativeclient.js now enables talking to the native client module through a high level interface as well as registering callbacks that will be executed once the module is loaded. And it has tests! Finally, this commit removes all references to the "testing_only" object, preferring to run tests on textsecure.crypto instead.
This commit is contained in:
parent
cd4b98d426
commit
9f676af9bb
16 changed files with 1255 additions and 1050 deletions
|
@ -2,13 +2,6 @@
|
|||
// Distributed under the X11 software license, see the accompanying
|
||||
// file MIT
|
||||
|
||||
function hexToArrayBuffer(str) {
|
||||
var ret = new ArrayBuffer(str.length / 2);
|
||||
var array = new Uint8Array(ret);
|
||||
for (var i = 0; i < str.length/2; i++)
|
||||
array[i] = parseInt(str.substr(i*2, 2), 16);
|
||||
return ret;
|
||||
}
|
||||
axolotlTestVectors = function() {
|
||||
// We're gonna throw the finalized tests in here:
|
||||
var tests = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue