Skip to content

Commit

Permalink
feat(crypto): upgrade to tweetnacl 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seavan committed Apr 19, 2017
1 parent db7ae3c commit 0c10c86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"mobx": "^3.1.9",
"mobx-react": "^4.1.0",
"moment": "^2.18.0",
"nacl-stream": "0.3.3",
"npm-run-all": "^4.0.1",
"peerio-copy": "https://github.com/PeerioTechnologies/peerio-copy.git#icebear",
"peerio-icebear": "git@github.com:PeerioTechnologies/peerio-icebear.git#mobile",
Expand Down Expand Up @@ -91,7 +90,7 @@
"scrypt-async": "^1.3.1",
"socket.io-client": "1.7.3",
"stream-browserify": "1.0.0",
"tweetnacl": "0.14.5",
"tweetnacl": "^1.0.0-rc.1",
"vm-browserify": "0.0.4"
},
"devDependencies": {
Expand Down
10 changes: 10 additions & 0 deletions shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ global.WebSocket = function(url) {
const cryptoShim = require('react-native-crypto');
global.cryptoShim = cryptoShim;

const randomBytes = cryptoShim.randomBytes;
console.log(`shim.js: checking randomBytes`);
console.log(randomBytes(8));

const nacl = require('tweetnacl');
nacl.setPRNG((x, n) => {
const a = randomBytes(n);
a.copy(x);
});

// global.WebSocket = global.originalWebSocket;
// console.log('shim.js binaryType: ', ws.binaryType);
// console.log('shim.js: ', global.originalWebSocket);
Expand Down

0 comments on commit 0c10c86

Please sign in to comment.