-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node/crypto): Builtin Diffie-Hellman Groups (#19137)
Towards #18455
- Loading branch information
Showing
6 changed files
with
900 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
cli/tests/node_compat/test/parallel/test-crypto-dh-shared.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// deno-fmt-ignore-file | ||
// deno-lint-ignore-file | ||
|
||
// Copyright Joyent and Node contributors. All rights reserved. MIT license. | ||
// Taken from Node 18.12.1 | ||
// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually | ||
|
||
'use strict'; | ||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
|
||
const assert = require('assert'); | ||
const crypto = require('crypto'); | ||
|
||
const alice = crypto.createDiffieHellmanGroup('modp5'); | ||
const bob = crypto.createDiffieHellmanGroup('modp5'); | ||
alice.generateKeys(); | ||
bob.generateKeys(); | ||
const aSecret = alice.computeSecret(bob.getPublicKey()).toString('hex'); | ||
const bSecret = bob.computeSecret(alice.getPublicKey()).toString('hex'); | ||
assert.strictEqual(aSecret, bSecret); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.