2key-ratchet
Version:
2key-ratchet is an implementation of a Double Ratchet protocol and X3DH in TypeScript utilizing WebCrypto.
35 lines (34 loc) • 764 B
TypeScript
/**
*
* 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
*
*/
/**
* Crypto engine structure
*
* @export
* @interface ICryptoEngine
*/
export interface ICryptoEngine {
name: string;
crypto: Crypto;
}
/**
* Sets crypto engine
*
* @export
* @param {string} name Name of engine
* @param {Crypto} crypto WebCrypto implementation
*/
export declare function setEngine(name: string, crypto: Crypto): void;
/**
* Returns crypto engine
* It throws exception if engine is empty.
*
* @export
* @returns {ICryptoEngine}
*/
export declare function getEngine(): ICryptoEngine;