mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

Since `common/crypto` already exists, it makes sense to keep crypto-related utilities there. The only exception being common.hasCrypto which is needed up front to determine if tests should be skipped. Eliminate the redundant check in hasFipsCrypto and just use crypto.getFips() directly where needed. PR-URL: https://github.com/nodejs/node/pull/56714 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
16 lines
342 B
JavaScript
16 lines
342 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const { getFips } = require('crypto');
|
|
|
|
if (getFips()) {
|
|
common.skip('some benchmarks are FIPS-incompatible');
|
|
}
|
|
|
|
const runBenchmark = require('../common/benchmark');
|
|
|
|
runBenchmark('crypto', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
|