Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
intelliot committed Sep 20, 2017
1 parent d105562 commit aa71974
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ function deriveKeypair(seed, options) {
const method = select(algorithm)
const keypair = method.deriveKeypair(decoded.bytes, options)
const goodMessage = hash('This test message should verify.')
const badMessage = hash('This test message should NOT verify.')
const goodSignature = method.sign(goodMessage, keypair.privateKey)
if (method.verify(goodMessage, goodSignature, keypair.publicKey) !== true ||
method.verify(badMessage, goodSignature, keypair.publicKey) !== false) {
throw new Error('derived keypair did not generate verifiable signatures');
}
if (method.verify(goodMessage, goodSignature, keypair.publicKey) !== true) {
throw new Error('derived keypair did not generate verifiable signatures');
}
return keypair
}

Expand Down

0 comments on commit aa71974

Please sign in to comment.