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

Function validateKeyLength

lib/internal/crypto/chacha20_poly1305.js:33–36  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

31const kUsages = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'];
32
33function validateKeyLength(length) {
34 if (length !== 256)
35 throw lazyDOMException('Invalid key length', 'DataError');
36}
37
38function c20pCipher(mode, key, data, algorithm) {
39 return jobPromise(() => new ChaCha20Poly1305CipherJob(

Callers 1

c20pImportKeyFunction · 0.70

Calls 1

lazyDOMExceptionFunction · 0.85

Tested by

no test coverage detected