/third_party/node/lib/internal/crypto/ |
H A D | webcrypto.js | 64 async function digest(algorithm, data) { 70 algorithm = webidl.converters.AlgorithmIdentifier(algorithm, { 79 algorithm = normalizeAlgorithm(algorithm, 'digest'); 81 return ReflectApply(asyncDigest, this, [algorithm, data]); 90 algorithm, 98 algorithm = webidl.converters.AlgorithmIdentifier(algorithm, { 111 algorithm [all...] |
H A D | sig.js | 54 function Sign(algorithm, options) { 56 return new Sign(algorithm, options); 57 validateString(algorithm, 'algorithm'); 59 this[kHandle].init(algorithm); 141 function signOneShot(algorithm, data, key, callback) { 142 if (algorithm != null) 143 validateString(algorithm, 'algorithm'); 175 algorithm, [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/ |
H A D | algorithm-discards-context.https.window.js | 1 // META: title=WebCryptoAPI: Properties discard the context in algorithm normalization 38 let algorithm = {name: "AES-GCM", length: 128}; 39 closeChildOnAccess(algorithm, "name"); 40 crypto.subtle.generateKey(algorithm, true, ["encrypt", "decrypt"]);`; 46 let algorithm = {name: "AES-GCM"}; 47 closeChildOnAccess(algorithm, "name"); 48 crypto.subtle.importKey("raw", new Uint8Array(16), algorithm, true, 58 let algorithm = {name: "AES-GCM", iv: new Uint8Array(12)}; 59 closeChildOnAccess(algorithm, "name"); 60 crypto.subtle.encrypt(algorithm, ke [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/derive_bits_keys/ |
H A D | hkdf_vectors.js | 25 // - illegal name for hash algorithm (NotSupportedError) 26 // - legal algorithm name but not digest one (e.g., AES-CBC) (NotSupportedError) 28 // - baseKey algorithm does not match HKDF (InvalidAccessError) 32 {algorithm: {name: "AES-CBC", length: 128}, usages: ["encrypt", "decrypt"]}, 33 {algorithm: {name: "AES-CBC", length: 192}, usages: ["encrypt", "decrypt"]}, 34 {algorithm: {name: "AES-CBC", length: 256}, usages: ["encrypt", "decrypt"]}, 35 {algorithm: {name: "AES-CTR", length: 128}, usages: ["encrypt", "decrypt"]}, 36 {algorithm: {name: "AES-CTR", length: 192}, usages: ["encrypt", "decrypt"]}, 37 {algorithm: {name: "AES-CTR", length: 256}, usages: ["encrypt", "decrypt"]}, 38 {algorithm [all...] |
H A D | pbkdf2_vectors.js | 24 // - illegal name for hash algorithm (NotSupportedError) 25 // - legal algorithm name but not digest one (e.g., AES-CBC) (NotSupportedError) 27 // - baseKey algorithm does not match PBKDF2 (InvalidAccessError) 31 {algorithm: {name: "AES-CBC", length: 128}, usages: ["encrypt", "decrypt"]}, 32 {algorithm: {name: "AES-CBC", length: 192}, usages: ["encrypt", "decrypt"]}, 33 {algorithm: {name: "AES-CBC", length: 256}, usages: ["encrypt", "decrypt"]}, 34 {algorithm: {name: "AES-CTR", length: 128}, usages: ["encrypt", "decrypt"]}, 35 {algorithm: {name: "AES-CTR", length: 192}, usages: ["encrypt", "decrypt"]}, 36 {algorithm: {name: "AES-CTR", length: 256}, usages: ["encrypt", "decrypt"]}, 37 {algorithm [all...] |
H A D | hkdf.js | 22 // algorithm (not HKDF in this case). 36 var algorithm = {name: "HKDF", salt: salts[saltSize], info: infos[infoSize], hash: hashName}; 40 return subtle.deriveBits(algorithm, baseKeys[derivedKeySize], 256) 50 return subtle.deriveBits(algorithm, baseKeys[derivedKeySize], 0) 62 Object.keys(derivedKeyType.algorithm).forEach(function(prop) { 63 testName += prop + ": " + derivedKeyType.algorithm[prop] + " "; 69 return subtle.deriveKey(algorithm, baseKeys[derivedKeySize], derivedKeyType.algorithm, true, derivedKeyType.usages) 74 assert_true(equalBuffers(buffer, derivations[derivedKeySize][saltSize][hashName][infoSize].slice(0, derivedKeyType.algorithm.length/8)), "Exported key matches correct value"); 86 // - illegal name for hash algorithm (NotSupportedErro [all...] |
/third_party/node/test/parallel/ |
H A D | test-webcrypto-wrap-unwrap.js | 66 algorithm: { 77 algorithm: { 88 algorithm: { 99 algorithm: { 108 algorithm: { 117 algorithm: { 125 algorithm: { 133 algorithm: { 141 algorithm: { 149 algorithm [all...] |
H A D | test-webcrypto-keygen.js | 31 algorithm: { length: 256 }, 41 algorithm: { length: 256 }, 51 algorithm: { length: 256 }, 61 algorithm: { length: 256 }, 69 algorithm: { length: 256, hash: 'SHA-256' }, 77 algorithm: { 89 algorithm: { 101 algorithm: { 115 algorithm: { namedCurve: 'P-521' }, 123 algorithm [all...] |
H A D | test-webcrypto-derivebits-hkdf.js | 228 const algorithm = { 236 algorithm, 252 const algorithm = { 261 subtle.deriveBits(algorithm, baseKeys[size], undefined), { 265 subtle.deriveBits(algorithm, baseKeys[size], 0), { 270 subtle.deriveBits(algorithm, baseKeys[size], null), { 275 subtle.deriveBits(algorithm, baseKeys[size], 15), { 290 const algorithm = { name: 'HKDF', salt, info }; 296 ...algorithm, 299 message: /Unrecognized algorithm nam [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/import_export/ |
H A D | symmetric_importKey.https.any.js | 38 var algorithm = {name: vector.name}; 40 algorithm.hash = vector.hash; 49 data = jwkData(keyData, algorithm); 53 testFormat(format, algorithm, data, keyData.length * 8, usages, extractable); 55 testEmptyUsages(format, algorithm, data, keyData.length * 8, extractable); 62 function hasLength(algorithm) { 63 return algorithm.name === 'HMAC' || algorithm.name.startsWith('AES'); 68 function testFormat(format, algorithm, keyData, keySize, usages, extractable) { 70 return subtle.importKey(format, keyData, algorithm, extractabl [all...] |
H A D | okp_importKey_failures.js | 37 function parameterString(format, algorithm, extractable, usages, data) { 38 if (typeof algorithm !== "object" && typeof algorithm !== "string") { 39 alert(algorithm); 48 objectToString(algorithm) + ", " + 61 function testError(format, algorithm, keyData, keySize, usages, extractable, expectedError, testTag) { 65 key = await subtle.importKey(format, keyData, algorithm, extractable, usages); 71 }, testTag + ": importKey" + parameterString(format, algorithm, extractable, usages, keyData)); 113 // - Unsupported algorithm 114 // - Bad usages for algorithm [all...] |
H A D | ec_importKey.https.any.js | 76 var algorithm = {name: vector.name, namedCurve: curve}; 82 testFormat(format, algorithm, data, curve, usages, extractable); 89 var algorithm = {name: vector.name, namedCurve: curve}; 92 testFormat(format, algorithm, data, curve, usages, extractable); 94 testEmptyUsages(format, algorithm, data, curve, extractable); 104 function testFormat(format, algorithm, data, keySize, usages, extractable) { 111 return subtle.importKey(format, keyData, algorithm, extractable, usages). 114 assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData.d)) ? 'private' : 'public'); 136 }, "Good parameters: " + keySize.toString() + " bits " + parameterString(format, compressed, keyData, algorithm, extractable, usages)); 141 function testEmptyUsages(format, algorithm, dat [all...] |
H A D | rsa_importKey.https.any.js | 83 var algorithm = {name: vector.name, hash: hash}; 89 testFormat(format, algorithm, data, size, usages, extractable); 96 var algorithm = {name: vector.name, hash: hash}; 99 testFormat(format, algorithm, data, size, usages, extractable); 101 testEmptyUsages(format, algorithm, data, size, extractable); 112 function testFormat(format, algorithm, keyData, keySize, usages, extractable) { 114 return subtle.importKey(format, keyData[format], algorithm, extractable, usages). 117 assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData[format].d)) ? 'private' : 'public'); 135 }, "Good parameters: " + keySize.toString() + " bits " + parameterString(format, keyData[format], algorithm, extractable, usages)); 140 function testEmptyUsages(format, algorithm, keyDat [all...] |
H A D | okp_importKey.https.any.js | 77 var algorithm = {name: vector.name}; 83 testFormat(format, algorithm, data, vector.name, usages, extractable); 91 var algorithm = {name: vector.name}; 94 testFormat(format, algorithm, data, vector.name, usages, extractable); 103 function testFormat(format, algorithm, keyData, keySize, usages, extractable) { 105 return subtle.importKey(format, keyData[format], algorithm, extractable, usages). 108 assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData[format].d)) ? 'private' : 'public'); 126 }, "Good parameters: " + keySize.toString() + " bits " + parameterString(format, keyData[format], algorithm, extractable, usages)); 171 // Build minimal Jwk objects from raw key data and algorithm specifications 172 function jwkData(keyData, algorithm) { [all...] |
/third_party/node/test/pummel/ |
H A D | test-webcrypto-derivebits-pbkdf2.js | 419 const algorithm = { 426 const bits = await subtle.deriveBits(algorithm, baseKeys[size], 256); 440 const algorithm = { 449 subtle.deriveBits(algorithm, baseKeys[size], undefined), { 453 subtle.deriveBits(algorithm, baseKeys[size], 0), { 458 subtle.deriveBits(algorithm, baseKeys[size], null), { 463 subtle.deriveBits(algorithm, baseKeys[size], 15), { 477 const algorithm = { name: 'PBKDF2', salt, iterations }; 483 ...algorithm, 486 message: /Unrecognized algorithm nam [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/generateKey/ |
H A D | failures.js | 52 function parameterString(algorithm, extractable, usages) { 53 if (typeof algorithm !== "object" && typeof algorithm !== "string") { 54 alert(algorithm); 58 objectToString(algorithm) + ", " + 71 function testError(algorithm, extractable, usages, expectedError, testTag) { 73 return crypto.subtle.generateKey(algorithm, extractable, usages) 83 }, testTag + ": generateKey" + parameterString(algorithm, extractable, usages)); 87 // Given an algorithm name, create several invalid parameters. 139 // - Unsupported algorithm [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/wrapKey_unwrapKey/ |
H A D | wrapKey_unwrapKey.https.any.js | 80 {algorithm: {name: "RSASSA-PKCS1-v1_5", modulusLength: 1024, publicExponent: new Uint8Array([1,0,1]), hash: "SHA-256"}, privateUsages: ["sign"], publicUsages: ["verify"]}, 81 {algorithm: {name: "RSA-PSS", modulusLength: 1024, publicExponent: new Uint8Array([1,0,1]), hash: "SHA-256"}, privateUsages: ["sign"], publicUsages: ["verify"]}, 82 {algorithm: {name: "RSA-OAEP", modulusLength: 1024, publicExponent: new Uint8Array([1,0,1]), hash: "SHA-256"}, privateUsages: ["decrypt"], publicUsages: ["encrypt"]}, 83 {algorithm: {name: "ECDSA", namedCurve: "P-256"}, privateUsages: ["sign"], publicUsages: ["verify"]}, 84 {algorithm: {name: "ECDH", namedCurve: "P-256"}, privateUsages: ["deriveBits"], publicUsages: []}, 85 {algorithm: {name: "Ed25519" }, privateUsages: ["sign"], publicUsages: ["verify"]}, 86 {algorithm: {name: "Ed448" }, privateUsages: ["sign"], publicUsages: ["verify"]}, 87 {algorithm: {name: "X25519" }, privateUsages: ["deriveBits"], publicUsages: []}, 88 {algorithm: {name: "X448" }, privateUsages: ["deriveBits"], publicUsages: []}, 89 {algorithm [all...] |
/third_party/node/deps/npm/node_modules/ssri/lib/ |
H A D | index.js | 37 if (this.algorithm !== null && !this.algorithms.includes(this.algorithm)) { 38 this.algorithms.push(this.algorithm) 50 this.algorithm = null 53 this.algorithm = this.sri.algorithm 56 this.algorithm = this.sri.pickAlgorithm(this.opts) 59 this.digests = this.goodSri ? this.sri[this.algorithm] : null 111 const err = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`) 115 err.algorithm [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/sign_verify/ |
H A D | ecdsa.js | 11 // for the algorithm that drives these tests. 19 var algorithm = {name: vector.algorithmName, hash: vector.hashName}; 21 var operation = subtle.verify(algorithm, vector.publicKey, vector.signature, vector.plaintext) 46 var algorithm = {name: vector.algorithmName, hash: vector.hashName}; 49 var operation = subtle.verify(algorithm, vector.publicKey, signature, vector.plaintext) 72 var algorithm = {name: vector.algorithmName, hash: vector.hashName}; 75 var operation = subtle.verify(algorithm, vector.publicKey, vector.signature, plaintext) 98 var algorithm = {name: vector.algorithmName, hash: vector.hashName}; 100 return subtle.verify(algorithm, vector.privateKey, vector.signature, vector.plaintext) 121 var algorithm [all...] |
H A D | rsa.js | 11 // for the algorithm that drives these tests. 19 var operation = subtle.verify(vector.algorithm, vector.publicKey, vector.signature, vector.plaintext) 46 var operation = subtle.verify(vector.algorithm, vector.publicKey, signature, vector.plaintext) 71 var operation = subtle.verify(vector.algorithm, vector.publicKey, vector.signature, plaintext) 95 return subtle.verify(vector.algorithm, vector.privateKey, vector.signature, vector.plaintext) 117 return subtle.sign(vector.algorithm, vector.publicKey, vector.plaintext) 140 return subtle.verify(vector.algorithm, vector.publicKey, vector.signature, vector.plaintext) 159 const isDeterministic = !("saltLength" in vector.algorithm) || vector.algorithm.saltLength == 0; 163 return subtle.sign(vector.algorithm, vecto [all...] |
H A D | eddsa.js | 11 // for the algorithm that drives these tests. 18 var algorithm = {name: vector.algorithmName}; 20 var operation = subtle.verify(algorithm, vector.publicKey, vector.signature, vector.data) 45 var algorithm = {name: vector.algorithmName}; 48 var operation = subtle.verify(algorithm, vector.publicKey, signature, vector.data) 71 var algorithm = {name: vector.algorithmName}; 74 var operation = subtle.verify(algorithm, vector.publicKey, vector.signature, data) 97 var algorithm = {name: vector.algorithmName}; 99 return subtle.verify(algorithm, vector.privateKey, vector.signature, vector.data) 120 var algorithm [all...] |
/third_party/node/test/fixtures/crypto/ |
H A D | rsa.js | 177 algorithm: { name: 'RSA-OAEP' }, 190 algorithm: { name: 'RSA-OAEP' }, 203 algorithm: { name: 'RSA-OAEP' }, 216 algorithm: { name: 'RSA-OAEP' }, 229 algorithm: { name: 'RSA-OAEP', label: new Uint8Array([]) }, 242 algorithm: { name: 'RSA-OAEP', label: new Uint8Array([]) }, 255 algorithm: { name: 'RSA-OAEP', label: new Uint8Array([]) }, 268 algorithm: { name: 'RSA-OAEP', label: new Uint8Array([]) }, 281 algorithm: { name: 'RSA-OAEP', label }, 294 algorithm [all...] |
/third_party/node/test/fixtures/wpt/WebCryptoAPI/encrypt_decrypt/ |
H A D | rsa_vectors.js | 17 // algorithm - the value of the AlgorithmIdentifier parameter to provide to encrypt 51 algorithm: {name: "RSA-OAEP"}, 64 algorithm: {name: "RSA-OAEP"}, 77 algorithm: {name: "RSA-OAEP"}, 90 algorithm: {name: "RSA-OAEP"}, 103 algorithm: {name: "RSA-OAEP", label: new Uint8Array([])}, 116 algorithm: {name: "RSA-OAEP", label: new Uint8Array([])}, 129 algorithm: {name: "RSA-OAEP", label: new Uint8Array([])}, 142 algorithm: {name: "RSA-OAEP", label: new Uint8Array([])}, 155 algorithm [all...] |
H A D | aes.js | 9 // for the AES-XXX algorithm that drives these tests. 20 return subtle.encrypt(vector.algorithm, vector.key, vector.plaintext) 44 var operation = subtle.encrypt(vector.algorithm, vector.key, plaintext) 69 return subtle.decrypt(vector.algorithm, vector.key, vector.result) 93 var operation = subtle.decrypt(vector.algorithm, vector.key, ciphertext) 122 return subtle.encrypt(vector.algorithm, vector.key, vector.plaintext) 140 // Encryption should fail if algorithm of key doesn't match algorithm of function call. 142 var algorithm = Object.assign({}, vector.algorithm); [all...] |
/third_party/ltp/testcases/kernel/security/integrity/ima/tests/ |
H A D | ima_setup.sh | 25 local algorithm="$1" 29 digest="$(${algorithm}sum $file 2>/dev/null | cut -f1 -d ' ')" 35 digest="$(openssl $algorithm $file 2>/dev/null | cut -f2 -d ' ')" 42 local arg="$algorithm" 43 case "$algorithm" in 229 local algorithm digest 244 algorithm=$(echo "$digest" | cut -d $delimiter -f 1) 248 32) algorithm="md5" ;; 249 40) algorithm="sha1" ;; 251 echo "algorithm mus [all...] |