GeezerVison is showing github.com — benchmark: reflect current OpenSSL in crypto key benchmarks · nodejs/node@7dee3ff
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: benchmark/crypto/create-keyobject.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 |
| 3 | 3 | const common = require('../common.js'); | | 4 | +const { hasOpenSSL } = require('../../test/common/crypto.js'); | 4 | 5 | const crypto = require('crypto'); | 5 | 6 | const fs = require('fs'); | 6 | 7 | const path = require('path'); | @@ -21,11 +22,14 @@ const keyFixtures = { | 21 | 22 | 'ec': readKeyPair('ec_p256_public', 'ec_p256_private'), | 22 | 23 | 'rsa': readKeyPair('rsa_public_2048', 'rsa_private_2048'), | 23 | 24 | 'ed25519': readKeyPair('ed25519_public', 'ed25519_private'), | 24 | | - 'ml-dsa-44': readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private'), | 25 | 25 | }; | 26 | 26 |
| | 27 | +if (hasOpenSSL(3, 5)) { | | 28 | + keyFixtures['ml-dsa-44'] = readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private'); | | 29 | +} | | 30 | + | 27 | 31 | const bench = common.createBenchmark(main, { | 28 | | - keyType: ['rsa', 'ec', 'ed25519', 'ml-dsa-44'], | | 32 | + keyType: Object.keys(keyFixtures), | 29 | 33 | keyFormat: ['pkcs8', 'spki', 'der-pkcs8', 'der-spki', 'jwk-public', 'jwk-private'], | 30 | 34 | n: [1e3], | 31 | 35 | }); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/crypto/oneshot-sign.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 |
| 3 | 3 | const common = require('../common.js'); | | 4 | +const { hasOpenSSL } = require('../../test/common/crypto.js'); | 4 | 5 | const crypto = require('crypto'); | 5 | 6 | const fs = require('fs'); | 6 | 7 | const path = require('path'); | @@ -14,16 +15,19 @@ const keyFixtures = { | 14 | 15 | 'ec': readKey('ec_p256_private'), | 15 | 16 | 'rsa': readKey('rsa_private_2048'), | 16 | 17 | 'ed25519': readKey('ed25519_private'), | 17 | | - 'ml-dsa-44': readKey('ml_dsa_44_private'), | 18 | 18 | }; | 19 | 19 |
| | 20 | +if (hasOpenSSL(3, 5)) { | | 21 | + keyFixtures['ml-dsa-44'] = readKey('ml_dsa_44_private'); | | 22 | +} | | 23 | + | 20 | 24 | const data = crypto.randomBytes(256); | 21 | 25 |
| 22 | 26 | let pems; | 23 | 27 | let keyObjects; | 24 | 28 |
| 25 | 29 | const bench = common.createBenchmark(main, { | 26 | | - keyType: ['rsa', 'ec', 'ed25519', 'ml-dsa-44'], | | 30 | + keyType: Object.keys(keyFixtures), | 27 | 31 | mode: ['sync', 'async', 'async-parallel'], | 28 | 32 | keyFormat: ['pem', 'der', 'jwk', 'keyObject', 'keyObject.unique'], | 29 | 33 | n: [1e3], | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/crypto/oneshot-verify.js +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 |
| 3 | 3 | const common = require('../common.js'); | | 4 | +const { hasOpenSSL } = require('../../test/common/crypto.js'); | 4 | 5 | const crypto = require('crypto'); | 5 | 6 | const fs = require('fs'); | 6 | 7 | const path = require('path'); | @@ -21,16 +22,19 @@ const keyFixtures = { | 21 | 22 | 'ec': readKeyPair('ec_p256_public', 'ec_p256_private'), | 22 | 23 | 'rsa': readKeyPair('rsa_public_2048', 'rsa_private_2048'), | 23 | 24 | 'ed25519': readKeyPair('ed25519_public', 'ed25519_private'), | 24 | | - 'ml-dsa-44': readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private'), | 25 | 25 | }; | 26 | 26 |
| | 27 | +if (hasOpenSSL(3, 5)) { | | 28 | + keyFixtures['ml-dsa-44'] = readKeyPair('ml_dsa_44_public', 'ml_dsa_44_private'); | | 29 | +} | | 30 | + | 27 | 31 | const data = crypto.randomBytes(256); | 28 | 32 |
| 29 | 33 | let pems; | 30 | 34 | let keyObjects; | 31 | 35 |
| 32 | 36 | const bench = common.createBenchmark(main, { | 33 | | - keyType: ['rsa', 'ec', 'ed25519', 'ml-dsa-44'], | | 37 | + keyType: Object.keys(keyFixtures), | 34 | 38 | mode: ['sync', 'async', 'async-parallel'], | 35 | 39 | keyFormat: ['pem', 'der', 'jwk', 'keyObject', 'keyObject.unique'], | 36 | 40 | n: [1e3], | |
|