forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nodejs:main' into main
- Loading branch information
Showing
1,560 changed files
with
29,525 additions
and
10,576 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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -377,6 +377,8 @@ For information about the governance of the Node.js project, see | |
**Matthew Aitken** <<[email protected]>> (he/him) | ||
* [kuriyosh](https://github.com/kuriyosh) - | ||
**Yoshiki Kurihara** <<[email protected]>> (he/him) | ||
* [kvakil](https://github.com/kvakil) - | ||
**Keyhan Vakil** <<[email protected]>> | ||
* [legendecas](https://github.com/legendecas) - | ||
**Chengzhong Wu** <<[email protected]>> (he/him) | ||
* [Leko](https://github.com/Leko) - | ||
|
@@ -705,14 +707,14 @@ maintaining the Node.js project. | |
**Himadri Ganguly** <<[email protected]>> (he/him) | ||
* [iam-frankqiu](https://github.com/iam-frankqiu) - | ||
**Frank Qiu** <<[email protected]>> (he/him) | ||
* [kvakil](https://github.com/kvakil) - | ||
**Keyhan Vakil** <<[email protected]>> (they/them) | ||
* [marsonya](https://github.com/marsonya) - | ||
**Akhil Marsonya** <<[email protected]>> (he/him) | ||
* [meixg](https://github.com/meixg) - | ||
**Xuguang Mei** <<[email protected]>> (he/him) | ||
* [Mesteery](https://github.com/Mesteery) - | ||
**Mestery** <<[email protected]>> (he/him) | ||
* [preveen-stack](https://github.com/preveen-stack) - | ||
**Preveen Padmanabhan** <<[email protected]>> (he/him) | ||
* [PoojaDurgad](https://github.com/PoojaDurgad) - | ||
**Pooja Durgad** <<[email protected]>> | ||
* [RaisinTen](https://github.com/RaisinTen) - | ||
|
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,85 @@ | ||
'use strict'; | ||
|
||
const common = require('../common.js'); | ||
const crypto = require('crypto'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const fixtures_keydir = path.resolve(__dirname, '../../test/fixtures/keys/'); | ||
|
||
function readKey(name) { | ||
return fs.readFileSync(`${fixtures_keydir}/${name}.pem`, 'utf8'); | ||
} | ||
|
||
function readKeyPair(publicKeyName, privateKeyName) { | ||
return { | ||
publicKey: readKey(publicKeyName), | ||
privateKey: readKey(privateKeyName), | ||
}; | ||
} | ||
|
||
const keyFixtures = { | ||
ec: readKeyPair('ec_p256_public', 'ec_p256_private'), | ||
rsa: readKeyPair('rsa_public_2048', 'rsa_private_2048'), | ||
ed25519: readKeyPair('ed25519_public', 'ed25519_private'), | ||
}; | ||
|
||
const bench = common.createBenchmark(main, { | ||
keyType: ['rsa', 'ec', 'ed25519'], | ||
keyFormat: ['pkcs8', 'spki', 'der-pkcs8', 'der-spki', 'jwk-public', 'jwk-private'], | ||
n: [1e3], | ||
}); | ||
|
||
function measure(n, fn, input) { | ||
bench.start(); | ||
for (let i = 0; i < n; ++i) { | ||
fn(input); | ||
} | ||
bench.end(n); | ||
} | ||
|
||
function main({ n, keyFormat, keyType }) { | ||
const keyPair = { | ||
publicKey: crypto.createPublicKey(keyFixtures[keyType].publicKey), | ||
privateKey: crypto.createPrivateKey(keyFixtures[keyType].privateKey), | ||
}; | ||
|
||
let key, fn; | ||
switch (keyFormat) { | ||
case 'spki': | ||
key = keyPair.publicKey.export({ format: 'pem', type: 'spki' }); | ||
fn = crypto.createPublicKey; | ||
break; | ||
case 'pkcs8': | ||
key = keyPair.privateKey.export({ format: 'pem', type: 'pkcs8' }); | ||
fn = crypto.createPrivateKey; | ||
break; | ||
case 'der-spki': { | ||
const options = { format: 'der', type: 'spki' }; | ||
key = { ...options, key: keyPair.publicKey.export(options) }; | ||
fn = crypto.createPublicKey; | ||
break; | ||
} | ||
case 'der-pkcs8': { | ||
const options = { format: 'der', type: 'pkcs8' }; | ||
key = { ...options, key: keyPair.privateKey.export(options) }; | ||
fn = crypto.createPrivateKey; | ||
break; | ||
} | ||
case 'jwk-public': { | ||
const options = { format: 'jwk' }; | ||
key = { ...options, key: keyPair.publicKey.export(options) }; | ||
fn = crypto.createPublicKey; | ||
break; | ||
} | ||
case 'jwk-private': { | ||
const options = { format: 'jwk' }; | ||
key = { ...options, key: keyPair.privateKey.export(options) }; | ||
fn = crypto.createPrivateKey; | ||
break; | ||
} | ||
default: | ||
throw new Error('not implemented'); | ||
} | ||
|
||
measure(n, fn, key); | ||
} |
Oops, something went wrong.