From fce5e8b028f30f476aa2a8365a5d7f33597c4385 Mon Sep 17 00:00:00 2001 From: "Mr. Angry" Date: Mon, 22 Aug 2016 16:24:37 -0400 Subject: [PATCH] FAB-221: Add the SJCL bytes codec at SJCL v1.0.3 Adding the SJCL codec package based off of SJCL v1.0.3. This includes the bytes codec necessary for hash.js. Change-Id: Icc8a6ded8bfecca9b1cc329e55c0ee9cf31716d8 Signed-off-by: Anna D Derbakova --- sdk/node/lib/hash.js | 5 +++-- sdk/node/package.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/node/lib/hash.js b/sdk/node/lib/hash.js index 099531293a9..9a475d63a74 100644 --- a/sdk/node/lib/hash.js +++ b/sdk/node/lib/hash.js @@ -25,6 +25,7 @@ * NOTE: This is in pure java script to be compatible with the sjcl.hmac function. */ var sjcl = require('sjcl'); +var sjcl_codec = require('sjcl-codec'); var jssha = require('jssha'); var sha3_256 = require('js-sha3').sha3_256; var sha3_384 = require('js-sha3').sha3_384; @@ -148,7 +149,7 @@ hash_sha3_384.prototype = { * @return {bytes} the bytes converted from the bitArray */ bitsToBytes = function (bits) { - return sjcl.codec.bytes.fromBits(bits); + return sjcl_codec.bytes.fromBits(bits); } /** @@ -157,7 +158,7 @@ bitsToBytes = function (bits) { * @return {bitArray} the bitArray converted from bytes */ bytesToBits = function (bytes) { - return sjcl.codec.bytes.toBits(bytes); + return sjcl_codec.bytes.toBits(bytes); } exports.hash_sha3_256 = hash_sha3_256; diff --git a/sdk/node/package.json b/sdk/node/package.json index 2fbf300c88c..4eaa8f696a2 100644 --- a/sdk/node/package.json +++ b/sdk/node/package.json @@ -23,6 +23,7 @@ "node.extend": "^1.1.5", "pkijs": "^1.3.19", "sjcl": "^1.0.3", + "sjcl-codec": "^0.1.1", "sleep": "^3.0.1", "tar-fs": "^1.13.0", "url": "^0.11.0",