Skip to content

Commit

Permalink
test: improve assert message in test-dh-regr
Browse files Browse the repository at this point in the history
PR-URL: #15912
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Mabry Cervin authored and MylesBorins committed Nov 28, 2017
1 parent 4c98e07 commit 501acdf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/pummel/test-dh-regr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ for (let i = 0; i < 2000; i++) {
a.generateKeys();
b.generateKeys();

const aSecret = a.computeSecret(b.getPublicKey());
const bSecret = b.computeSecret(a.getPublicKey());

assert.deepStrictEqual(
a.computeSecret(b.getPublicKey()),
b.computeSecret(a.getPublicKey()),
'secrets should be equal!'
aSecret,
bSecret,
'Secrets should be equal.\n' +
`aSecret: ${aSecret.toString('base64')}\n` +
`bSecret: ${bSecret.toString('base64')}`
);
}

0 comments on commit 501acdf

Please sign in to comment.