/** * IANA TLS registry codes used to project profile names onto wire values. * * These are the canonical 2-byte codes from the IANA TLS parameter registries. * Only the codes referenced by the shipped profiles are mapped here — an * unknown name is a bug in a profile definition and surfaces as a * {@link ProfileError} at projection time, so the tables double as an * allow-list that keeps profile data honest. * * ┌─────────────────────────────────────────────────────────────────────────┐ * │ DUPLICATED IN @browsercore/tls/src/iana/ │ * │ │ * │ The same IANA tables exist in @browsercore/tls (cipher-suites.ts, │ * │ named-groups.ts, signature-schemes.ts, versions.ts). This is │ * │ intentional — no dependency between the two packages. When adding a │ * │ new cipher suite, named group, or signature scheme, update BOTH copies. │ * │ The IANA TLS registries barely change (once every few years), so the │ * │ maintenance cost of two copies is lower than a shared package. │ * └─────────────────────────────────────────────────────────────────────────┘ * * Registries: * - Cipher suites: tls-parameters.xhtml#tls-parameters-4 * - Named groups: tls-parameters.xhtml#tls-parameters-8 * - Signature schemes: tls-parameters.xhtml#tls-parameters-16 */ /** * The name Chrome/Edge use in their cipher list to mark a GREASE slot (RFC 8701). * The real value is randomized per-connection (0x0a0a..0xfafa); validation accepts * any GREASE-pattern byte pair at a slot marked with this placeholder. * * @see cipherSuiteToWire which throws if an unknown name is projected. */ export declare const CIPHER_GREASE_PLACEHOLDER = "TLS_GREASE_RESERVED_0"; /** * Selected IANA TLS Cipher Suite codes, keyed by the canonical suite name used in profiles. * * Only the codes referenced by the shipped profiles are mapped here — an unknown name * is a bug in a profile definition and surfaces as a {@link ProfileError} at projection * time, so the table doubles as an allow-list that keeps profile data honest. * * @see https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4 */ export declare const CIPHER_SUITE_CODES: Readonly>; /** Selected IANA TLS Supported Groups (named groups) codes. * @see https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8 */ export declare const NAMED_GROUP_CODES: Readonly>; /** Selected IANA TLS SignatureScheme codes. * @see https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-16 */ export declare const SIGNATURE_SCHEME_CODES: Readonly>; /** IANA TLS ProtocolVersion codes for the supported_versions extension. */ export declare const VERSION_CODES: Readonly>; /** * Map a cipher-suite name to its 2-byte IANA wire code. * * This is the single projection seam from a profile's cipher name to the bytes * a ClientHello carries. It throws on an unknown name rather than returning a * sentinel: 0x0000 would be ambiguous (it collides with * TLS_EMPTY_RENEGOTIATION_INFO_SCSV), and a silent default would hide a bug in * a profile definition. An unknown name is therefore always an error here, * never a 0x0000 fallback. * * @param name - Canonical cipher-suite name as used in a {@link TlsProfile} * (e.g. `"TLS_AES_128_GCM_SHA256"`). * @returns The 2-byte IANA code for the cipher suite. * @throws {ProfileError} With kind `"UnknownCipherSuite"` if the name is not * in {@link CIPHER_SUITE_CODES}. * * @example * ```ts * cipherSuiteToWire("TLS_AES_128_GCM_SHA256"); // 0x1301 * cipherSuiteToWire("TLS_GREASE_RESERVED_0"); // 0x0a0a (placeholder) * ``` * * @see CIPHER_SUITE_CODES for the full code table. * @since 0.1.0 */ export declare function cipherSuiteToWire(name: string): number; //# sourceMappingURL=codes.d.ts.map