Skip to content
Snippets Groups Projects
Commit d7ffebe1 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Fix: update tweetnacl + use alternatives base64 encoders

parent 2a24c811
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,7 @@ function BlockGenerator() {
var that = this;
var onPoWFound = function() { throw 'Proof-of-work found, but no listener is attached.'; };
var onPoWError = function() { throw 'Proof-of-work error, but no listener is attached.'; };
that.powProcess = childProcess.fork(path.join(__dirname, '/../lib/proof'));
that.powProcess = childProcess.fork(path.join(__dirname, '/../lib/proof.js'));
var start = null;
var speedMesured = false;
......
......@@ -6,6 +6,8 @@ var base58 = require('./base58');
var rawer = require('./rawer');
var naclBinding = require('naclb');
nacl.util = require('./nacl-util');
var crypto_sign_BYTES = 64;
var SEED_LENGTH = 32; // Length of the key
// TODO: change key parameters
......
// Written in 2014-2016 by Dmitry Chestnykh and Devi Mandiri.
// Public domain.
(function(root, f) {
'use strict';
if (typeof module !== 'undefined' && module.exports) module.exports = f();
else if (root.nacl) root.nacl.util = f();
else {
root.nacl = {};
root.nacl.util = f();
}
}(this, function() {
'use strict';
var util = {};
util.decodeUTF8 = function(s) {
var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length);
for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
return b;
};
util.encodeUTF8 = function(arr) {
var i, s = [];
for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i]));
return decodeURIComponent(escape(s.join('')));
};
util.encodeBase64 = function(arr) {
if (typeof btoa === 'undefined' || !window) {
return (new Buffer(arr)).toString('base64');
} else {
var i, s = [], len = arr.length;
for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
return btoa(s.join(''));
}
};
util.decodeBase64 = function(s) {
if (typeof atob === 'undefined' || !window) {
return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0));
} else {
var i, d = atob(s), b = new Uint8Array(d.length);
for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
return b;
}
};
return util;
}));
......@@ -63,7 +63,7 @@
"sha1": "1.1.0",
"sqlite3": "3.1.1",
"superagent": "1.4.0",
"tweetnacl": "0.11.2",
"tweetnacl": "0.14.1",
"underscore": "1.8.3",
"vucoin": "0.29.1",
"winston": "2.1.1",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment