From b9ac6d73f81da121fd598f1f5fec5c178f73536d Mon Sep 17 00:00:00 2001 From: tripathyr Date: Wed, 21 Sep 2022 16:02:08 +0530 Subject: [PATCH] Modified double SHA256 to fit BIP143 --- lib_btc.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_btc.js b/lib_btc.js index 1c87125..7c8c588 100644 --- a/lib_btc.js +++ b/lib_btc.js @@ -2653,7 +2653,11 @@ } coinjs.dSHA256 = function(data){ - return Crypto.SHA256(Crypto.util.hexToBytes(Crypto.SHA256(data))); + var t1,t2,t3 ; + t1= Crypto.SHA256(Crypto.util.hexToBytes(data)); + t2= Crypto.util.hexToBytes(t1); + t3= Crypto.SHA256(t2); + return t3; } coinjs.random = function (length) {