Skip to content

Commit

Permalink
fixup! benchmark: add crypto.create*Key
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 5, 2023
1 parent 7cf917d commit a3647aa
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions benchmark/crypto/create-keyobject.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ 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)

Check failure on line 16 in benchmark/crypto/create-keyobject.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing trailing comma
};
}

const keyFixtures = {
ec: {
publicKey:
fs.readFileSync(`${fixtures_keydir}/ec_p256_public.pem`).toString(),
privateKey:
fs.readFileSync(`${fixtures_keydir}/ec_p256_private.pem`).toString(),
},
rsa: {
publicKey:
fs.readFileSync(`${fixtures_keydir}/rsa_public_2048.pem`).toString(),
privateKey:
fs.readFileSync(`${fixtures_keydir}/rsa_private_2048.pem`).toString(),
},
ed25519: {
publicKey:
fs.readFileSync(`${fixtures_keydir}/ed25519_public.pem`).toString(),
privateKey:
fs.readFileSync(`${fixtures_keydir}/ed25519_private.pem`).toString(),
},
ec: readKeyPair('ec_p256_public', 'ec_p256_private'),
rsa: readKeyPair('rsa_public_2048', 'rsa_private_2048'),
ed25519: readKeyPair('ed25519_public', 'ed25519_private')

Check failure on line 23 in benchmark/crypto/create-keyobject.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing trailing comma
};

const bench = common.createBenchmark(main, {
Expand Down

0 comments on commit a3647aa

Please sign in to comment.