Skip to content

Commit

Permalink
Remove the crypto-js dependency on the stealth module.
Browse files Browse the repository at this point in the history
  • Loading branch information
caedesvvv committed Oct 25, 2014
1 parent 6311a1a commit ad35da9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/util/stealth.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
'use strict';

define(['bitcoinjs-lib', 'crypto-js'], function(Bitcoin, CryptoJS) {
define(['bitcoinjs-lib'], function(Bitcoin) {

var bufToArray = function(obj) {return Array.prototype.slice.call(obj, 0);};

Expand Down Expand Up @@ -44,12 +44,12 @@ Stealth.stealthDH = function(e, decKey) {
// start the second stage
var S1;
if (Stealth.quirk) {
S1 = [3].concat(point.affineX.toBuffer().toJSON().data);
S1 = new Bitcoin.Buffer([3].concat(point.affineX.toBuffer().toJSON().data));
} else {
S1 = point.getEncoded(true);
}
var c = convert.wordArrayToBytes(CryptoJS.SHA256(convert.bytesToWordArray(S1)));
return Bitcoin.BigInteger.fromByteArrayUnsigned(c);
var c = Bitcoin.crypto.sha256(S1);
return Bitcoin.BigInteger.fromBuffer(c);
};


Expand Down

0 comments on commit ad35da9

Please sign in to comment.