Skip to content

Commit

Permalink
FAB-221: Add the SJCL bytes codec at SJCL v1.0.3
Browse files Browse the repository at this point in the history
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 <adderbak@us.ibm.com>
  • Loading branch information
Mr. Angry committed Aug 23, 2016
1 parent 061e064 commit fce5e8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk/node/lib/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions sdk/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fce5e8b

Please sign in to comment.