HDNode: enforces sane seed lengths
This commit is contained in:
parent
656de37fc0
commit
ddcde038d0
2 changed files with 16 additions and 0 deletions
test
|
@ -65,6 +65,18 @@ describe('HDNode', function() {
|
|||
assert.equal(hd.chainCode.toString('hex'), f.master.chainCode)
|
||||
})
|
||||
})
|
||||
|
||||
it('throws on low entropy seed', function() {
|
||||
assert.throws(function() {
|
||||
HDNode.fromSeedHex('ffffffffff')
|
||||
}, /Seed should be atleast 128 bits/)
|
||||
})
|
||||
|
||||
it('throws on too high entropy seed', function() {
|
||||
assert.throws(function() {
|
||||
HDNode.fromSeedHex('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')
|
||||
}, /Seed should be atmost 512 bits/)
|
||||
})
|
||||
})
|
||||
|
||||
describe('toBase58', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue