UNPKG

@hpke/common

Version:

A Hybrid Public Key Encryption (HPKE) internal-use common module for @hpke family modules.

57 lines (56 loc) 1.62 kB
(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AeadId = exports.KdfId = exports.KemId = exports.Mode = void 0; /** * The supported HPKE modes. */ exports.Mode = { Base: 0x00, Psk: 0x01, Auth: 0x02, AuthPsk: 0x03, }; /** * The supported Key Encapsulation Mechanism (KEM) identifiers. */ exports.KemId = { NotAssigned: 0x0000, DhkemP256HkdfSha256: 0x0010, DhkemP384HkdfSha384: 0x0011, DhkemP521HkdfSha512: 0x0012, DhkemSecp256k1HkdfSha256: 0x0013, DhkemX25519HkdfSha256: 0x0020, DhkemX448HkdfSha512: 0x0021, HybridkemX25519Kyber768: 0x0030, MlKem512: 0x0040, MlKem768: 0x0041, MlKem1024: 0x0042, XWing: 0x647a, }; /** * The supported Key Derivation Function (KDF) identifiers. */ exports.KdfId = { HkdfSha256: 0x0001, HkdfSha384: 0x0002, HkdfSha512: 0x0003, }; /** * The supported Authenticated Encryption with Associated Data (AEAD) identifiers. */ exports.AeadId = { Aes128Gcm: 0x0001, Aes256Gcm: 0x0002, Chacha20Poly1305: 0x0003, ExportOnly: 0xFFFF, }; });