MCPcopy Index your code
hub / github.com/nodejs/node / mlKemEncapsulate

Function mlKemEncapsulate

lib/internal/crypto/ml_kem.js:200–212  ·  view source on GitHub ↗
(encapsulationKey)

Source from the content-addressed store, hash-verified

198}
199
200function mlKemEncapsulate(encapsulationKey) {
201 if (getCryptoKeyType(encapsulationKey) !== 'public') {
202 throw lazyDOMException(`Key must be a public key`, 'InvalidAccessError');
203 }
204
205 return jobPromise(() => new KEMEncapsulateJob(
206 kCryptoJobWebCrypto,
207 getCryptoKeyHandle(encapsulationKey),
208 undefined,
209 undefined,
210 undefined,
211 undefined));
212}
213
214function mlKemDecapsulate(decapsulationKey, ciphertext) {
215 if (getCryptoKeyType(decapsulationKey) !== 'private') {

Callers

nothing calls this directly

Calls 4

getCryptoKeyTypeFunction · 0.85
lazyDOMExceptionFunction · 0.85
jobPromiseFunction · 0.85
getCryptoKeyHandleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…