check if seed is greater than 512 bits

This commit is contained in:
Gabe 2014-06-04 13:42:06 -04:00
parent 4d8af75ae9
commit 8e96d1439d
1 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,8 @@ HierarchicalKey.seed = function(bytes, network) {
bytes = new Buffer(bytes, 'hex'); //if not buffer, assume hex
if (bytes.length < 128/8)
return false; //need more entropy
if (bytes.length > 512/8)
return false;
var hash = coinUtil.sha512hmac(bytes, new Buffer('Bitcoin seed'));
var hkey = new HierarchicalKey(null);