From: Ian Coleman Date: Thu, 22 Dec 2016 04:40:41 +0000 (+1100) Subject: Card entropy uses secure hashing when > 256 bits X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=9d33c8925dc07783e2cd819c91eee1144598fcf2;hp=-c;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git Card entropy uses secure hashing when > 256 bits --- 9d33c8925dc07783e2cd819c91eee1144598fcf2 diff --git a/src/js/entropy.js b/src/js/entropy.js index 24fc21a..a709c78 100644 --- a/src/js/entropy.js +++ b/src/js/entropy.js @@ -293,15 +293,12 @@ window.Entropy = new (function() { // Create a normalized string of the selected cards var normalizedCards = cards.join("").toUpperCase(); // Convert to binary using the SHA256 hash of the normalized cards. - // If the number of bits is more than 256, multiple rounds of hashing + // If the number of bits is more than 256, multiple hashes // are used until the required number of bits is reached. var entropyBin = ""; var iterations = 0; while (entropyBin.length < numberOfBits) { - var hashedCards = sjcl.hash.sha256.hash(normalizedCards); - for (var j=0; j