UNPKG

sidh-legacy

Version:

JavaScript wrapper for a WebAssembly build of SIDH

27 lines (19 loc) 709 B
declare module 'sidh-legacy' { interface ISIDH { /** Maximum plaintext length. */ plaintextBytes: Promise<number>; /** Cyphertext length. */ cyphertextBytes: Promise<number>; /** Private key length. */ privateKeyBytes: Promise<number>; /** Public key length. */ publicKeyBytes: Promise<number>; /** Decrypts cyphertext with privateKey. */ decrypt (encrypted: Uint8Array|string, privateKey: Uint8Array) : Promise<Uint8Array>; /** Encrypts plaintext with publicKey. */ encrypt (message: Uint8Array|string, publicKey: Uint8Array) : Promise<Uint8Array>; /** Generates key pair. */ keyPair () : Promise<{privateKey: Uint8Array; publicKey: Uint8Array}>; } const sidh: ISIDH; }