Lines Matching defs:const

4 const common = require('../common');
8 const assert = require('assert');
10 const webidl = require('internal/crypto/webidl');
11 const { subtle } = require('node:crypto').webcrypto;
12 const { generateKeySync } = require('crypto');
14 const { converters } = webidl;
15 const prefix = "Failed to execute 'fn' on 'interface'";
16 const context = '1st argument';
17 const opts = { prefix, context };
61 for (const [converter, max] of [
129 for (const good of [{}, [], new Array(), function() {}]) {
133 for (const bad of [undefined, null, NaN, false, true, 0, 1, '', 'foo', Symbol(), 9n]) {
144 for (const good of [Buffer.alloc(0), new Uint8Array()]) {
148 for (const bad of [new ArrayBuffer(), new SharedArrayBuffer(), [], null, 'foo', undefined, true]) {
165 for (const good of [
184 for (const bad of [new SharedArrayBuffer(), [], null, 'foo', undefined, true]) {
206 for (const bad of [
226 for (const good of [
241 for (const good of ['jwk', 'spki', 'pkcs8', 'raw']) {
245 for (const bad of ['foo', 1, false]) {
256 for (const good of [
269 for (const bad of ['foo', 1, false]) {
280 const good = { name: 'RSA-PSS' };
292 for (const good of [
307 for (const required of ['hash', 'publicExponent', 'modulusLength']) {
319 for (const good of [
334 const good = { name: 'RSA-PSS', saltLength: 20 };
346 for (const good of [{ name: 'RSA-OAEP' }, { name: 'RSA-OAEP', label: Buffer.alloc(0) }]) {
353 for (const name of ['EcKeyImportParams', 'EcKeyGenParams']) {
354 const { [name]: converter } = converters;
356 const good = { name: 'ECDSA', namedCurve: 'P-256' };
369 for (const good of [
384 for (const name of ['HmacKeyGenParams', 'HmacImportParams']) {
385 const { [name]: converter } = converters;
387 for (const good of [
405 for (const name of ['AesKeyGenParams', 'AesDerivedKeyParams']) {
406 const { [name]: converter } = converters;
408 const good = { name: 'AES-CBC', length: 128 };
421 for (const good of [
426 for (const required of ['hash', 'salt', 'info']) {
438 for (const good of [
443 for (const required of ['hash', 'iterations', 'salt']) {
455 const good = { name: 'AES-CBC', iv: Buffer.alloc(0) };
467 for (const good of [
484 const good = { name: 'AES-CTR', counter: Buffer.alloc(0), length: 20 };
487 for (const required of ['counter', 'length']) {
499 const good = { name: 'ECDH', public: kp.publicKey };
512 for (const good of [