MCPcopy Create free account
hub / github.com/nodejs/node / supportsRawSecret

Function supportsRawSecret

test/parallel/test-webcrypto-supports.mjs:45–62  ·  view source on GitHub ↗
(alg)

Source from the content-addressed store, hash-verified

43}
44
45function supportsRawSecret(alg) {
46 if (typeof alg === 'string') {
47 alg = alg.toLowerCase();
48 return alg.startsWith('aes') ||
49 alg.startsWith('argon2') ||
50 alg.startsWith('kmac') ||
51 alg === 'chacha20-poly1305' ||
52 alg === 'pbkdf2' ||
53 alg === 'hkdf' ||
54 alg === 'hmac';
55 }
56
57 if (typeof alg?.name === 'string') {
58 return supportsRawSecret(alg.name);
59 }
60
61 return false;
62}
63
64function supportsEncapsulatedRawSecret(alg) {
65 if (!supportsRawSecret(alg)) return false;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected