mirror of https://github.com/nodejs/node.git
test: improve assert message in test-dh-regr
PR-URL: https://github.com/nodejs/node/pull/15912 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>pull/15912/merge
parent
584f037612
commit
42dfde827b
|
@ -36,9 +36,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')}`
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue