Skip to content

Commit

Permalink
test: change misleading variable name
Browse files Browse the repository at this point in the history
The return value of getPrime() is not a private key in any way.

Refs: nodejs/node-v0.x-archive#2638

PR-URL: #43990
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen authored and juanarbol committed Oct 11, 2022
1 parent 21a29d4 commit e009a35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/pummel/test-crypto-dh-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ const hashes = {

for (const name in hashes) {
const group = crypto.getDiffieHellman(name);
const private_key = group.getPrime('hex');
const prime = group.getPrime('hex');
const hash1 = hashes[name];
const hash2 = crypto.createHash('sha1')
.update(private_key.toUpperCase()).digest('hex');
.update(prime.toUpperCase()).digest('hex');
assert.strictEqual(hash1, hash2);
assert.strictEqual(group.getGenerator('hex'), '02');
}

0 comments on commit e009a35

Please sign in to comment.