import type { UnsentStateEvent } from "../room/common"; import type { ILogItem } from "../../logging/types"; export declare enum DecryptionSource { Sync = 0, Timeline = 1, Retry = 2 } export declare const SESSION_E2EE_KEY_PREFIX = "e2ee:"; export declare const OLM_ALGORITHM = "m.olm.v1.curve25519-aes-sha2"; export declare const MEGOLM_ALGORITHM = "m.megolm.v1.aes-sha2"; export declare class DecryptionError extends Error { private readonly code; private readonly event; private readonly detailsObj?; constructor(code: string, event: object, detailsObj?: object | undefined); } export declare const SIGNATURE_ALGORITHM = "ed25519"; export type SignedValue = { signatures?: { [userId: string]: { [keyId: string]: string; }; }; unsigned?: object; }; export type DeviceKey = SignedValue & { readonly user_id: string; readonly device_id: string; readonly algorithms: ReadonlyArray; readonly keys: { [keyId: string]: string; }; readonly unsigned: { device_display_name?: string; }; }; export declare function getDeviceEd25519Key(deviceKey: DeviceKey): string; export declare function getDeviceCurve25519Key(deviceKey: DeviceKey): string; export declare function getEd25519Signature(signedValue: SignedValue, userId: string, deviceOrKeyId: string): string | undefined; export declare enum SignatureVerification { Valid = 0, Invalid = 1, NotSigned = 2 } export declare function verifyEd25519Signature(olmUtil: Olm.Utility, userId: string, deviceOrKeyId: string, ed25519Key: string, value: SignedValue, log?: ILogItem): SignatureVerification; export declare function createRoomEncryptionEvent(): UnsentStateEvent; export declare enum HistoryVisibility { Joined = "joined", Invited = "invited", WorldReadable = "world_readable", Shared = "shared" } export declare function shouldShareKey(membership: string, historyVisibility: HistoryVisibility): boolean;