import { Decoder } from "./codec/tlsDecoder.js"; import { BufferEncoder } from "./codec/tlsEncoder.js"; import { ContentTypeName } from "./contentType.js"; import { CiphersuiteImpl } from "./crypto/ciphersuite.js"; import { Kdf } from "./crypto/kdf.js"; import { KeyRetentionConfig } from "./keyRetentionConfig.js"; import { ReuseGuard, SenderData } from "./sender.js"; /** @public */ export interface GenerationSecret { secret: Uint8Array; generation: number; unusedGenerations: Record; } export declare const generationSecretEncoder: BufferEncoder; export declare const decodeGenerationSecret: Decoder; /** @public */ export interface SecretTreeNode { handshake: GenerationSecret; application: GenerationSecret; } export declare const secretTreeNodeEncoder: BufferEncoder; export declare const decodeSecretTreeNode: Decoder; /** @public */ export type SecretTree = SecretTreeNode[]; export declare const secretTreeEncoder: BufferEncoder; export declare const decodeSecretTree: Decoder; export declare function allSecretTreeValues(tree: SecretTree): Uint8Array[]; export interface ConsumeRatchetResult { nonce: Uint8Array; reuseGuard: ReuseGuard; key: Uint8Array; generation: number; newTree: SecretTree; consumed: Uint8Array[]; } export declare function createSecretTree(leafWidth: number, encryptionSecret: Uint8Array, kdf: Kdf): Promise; export declare function deriveNonce(secret: Uint8Array, generation: number, cs: CiphersuiteImpl): Promise; export declare function deriveKey(secret: Uint8Array, generation: number, cs: CiphersuiteImpl): Promise; export declare function ratchetUntil(current: GenerationSecret, desiredGen: number, config: KeyRetentionConfig, kdf: Kdf): Promise<[GenerationSecret, Uint8Array[]]>; export declare function derivePrivateMessageNonce(secret: Uint8Array, generation: number, reuseGuard: Uint8Array, cs: CiphersuiteImpl): Promise; export declare function ratchetToGeneration(tree: SecretTree, senderData: SenderData, contentType: ContentTypeName, config: KeyRetentionConfig, cs: CiphersuiteImpl): Promise; export declare function consumeRatchet(tree: SecretTree, index: number, contentType: ContentTypeName, cs: CiphersuiteImpl): Promise;