Lines Matching defs:const
3 const common = require('../common');
4 const fixtures = require('../common/fixtures');
9 const assert = require('assert');
10 const crypto = require('crypto');
11 const { subtle } = crypto.webcrypto;
13 const curves = ['P-256', 'P-384', 'P-521'];
15 const keyData = {
89 const testVectors = [
103 const key = await subtle.importKey(
117 const spki = await subtle.exportKey('spki', key);
143 const key = await subtle.importKey(
157 const pkcs8 = await subtle.exportKey('pkcs8', key);
183 const jwk = keyData[namedCurve].jwk;
185 const [
240 const [
274 const invalidUse = name === 'ECDH' ? 'sig' : 'enc';
305 for (const crv of [undefined, namedCurve === 'P-256' ? 'P-384' : 'P-256']) {
336 const jwk = keyData[namedCurve].jwk;
338 const [publicKey] = await Promise.all([
365 const tests = [];
383 const compressed = Buffer.from([48, 57, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 34, 0, 2, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209]); // eslint-disable-line max-len
384 const uncompressed = Buffer.from([48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]); // eslint-disable-line max-len
385 for (const name of ['ECDH', 'ECDSA']) {
386 const options = { name, namedCurve: 'P-256' };
387 const key = await subtle.importKey('spki', compressed, options, true, []);
388 const spki = await subtle.exportKey('spki', key);
394 const rsaPublic = crypto.createPublicKey(
396 const rsaPrivate = crypto.createPrivateKey(
399 for (const [name, publicUsages, privateUsages] of [
422 for (const { namedCurve, key: pkcs8 } of [
467 for (const [name, privateUsages] of [