UNPKG

2key-ratchet

Version:

2key-ratchet is an implementation of a Double Ratchet protocol and X3DH in TypeScript utilizing WebCrypto.

22 lines (21 loc) 784 B
/** * * 2key-ratchet * Copyright (c) 2016 Peculiar Ventures, Inc * Based on https://whispersystems.org/docs/specifications/doubleratchet/ and * https://whispersystems.org/docs/specifications/x3dh/ by Open Whisper Systems * */ import { ECPublicKey } from "../crypto"; import { BaseProtocol } from "./base"; import { MessageProtocol } from "./message"; export declare class MessageSignedProtocol extends BaseProtocol { receiverKey: ECPublicKey; senderKey: ECPublicKey; message: MessageProtocol; protected signature: ArrayBuffer; sign(hmacKey: CryptoKey): Promise<void>; verify(hmacKey: CryptoKey): Promise<boolean>; protected getSignedRaw(): Promise<ArrayBuffer | SharedArrayBuffer>; protected signHMAC(macKey: CryptoKey): Promise<ArrayBuffer>; }