tweetnacl-ts
Version:
Port of TweetNaCl cryptographic library to TypeScript (and ES6)
20 lines (19 loc) • 946 B
TypeScript
import { ByteArray } from './array';
export declare const enum BoxLength {
PublicKey = 32,
SecretKey = 32,
SharedKey = 32,
Nonce = 24,
Overhead = 16
}
export interface BoxKeyPair {
publicKey: ByteArray;
secretKey: ByteArray;
}
export declare function box(msg: ByteArray, nonce: ByteArray, publicKey: ByteArray, secretKey: ByteArray): ByteArray;
export declare function box_before(publicKey: ByteArray, secretKey: ByteArray): ByteArray;
export declare const box_after: (msg: ByteArray, nonce: ByteArray, key: ByteArray) => ByteArray;
export declare function box_open(msg: ByteArray, nonce: ByteArray, publicKey: ByteArray, secretKey: ByteArray): ByteArray | undefined;
export declare const box_open_after: (box: ByteArray, nonce: ByteArray, key: ByteArray) => ByteArray | undefined;
export declare function box_keyPair(): BoxKeyPair;
export declare function box_keyPair_fromSecretKey(secretKey: ByteArray): BoxKeyPair;