libsodium.common.d.ts 4.35 KB
Newer Older
David Burke's avatar
David Burke committed
1 2 3 4 5
export interface IKeyPair {
    keyType?: string;
    privateKey: Uint8Array;
    publicKey: Uint8Array;
}
David Burke's avatar
David Burke committed
6
export declare class Common {
David Burke's avatar
David Burke committed
7 8
    static BASE64_FLAGS: number;
    private static javaByteArrayToUint8Array(javaBytes);
9
    private static Uint8ArrayToJavaByteArray(inBytes);
David Burke's avatar
David Burke committed
10 11 12 13
    static to_base64(aBytes: Uint8Array): string;
    static from_base64(sBase64: string): Uint8Array;
    static randombytes_buf(length: number): Uint8Array;
    static crypto_box_keypair(): IKeyPair;
David Burke's avatar
David Burke committed
14
    static crypto_pwhash(keyLength: number, password: string | Uint8Array, salt: Uint8Array, opsLimit: number, memlimit: number, algorithm: number): Uint8Array;
15 16
    private static force_bytes(input);
    private static force_java_bytes(input);
David Burke's avatar
David Burke committed
17
    private static trimJavaBytes(input);
18
    static crypto_secretbox_easy(message: string | Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
David Burke's avatar
David Burke committed
19
    static crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
20 21
    static crypto_box_seal(message: string | Uint8Array, publicKey: Uint8Array): Uint8Array;
    static crypto_box_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array;
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    static readonly crypto_aead_chacha20poly1305_ABYTES: number;
    static readonly crypto_aead_chacha20poly1305_KEYBYTES: number;
    static readonly crypto_aead_chacha20poly1305_NPUBBYTES: number;
    static readonly crypto_aead_chacha20poly1305_NSECBYTES: number;
    static readonly crypto_auth_BYTES: number;
    static readonly crypto_auth_KEYBYTES: number;
    static readonly crypto_auth_hmacsha256_BYTES: number;
    static readonly crypto_auth_hmacsha256_KEYBYTES: number;
    static readonly crypto_auth_hmacsha512_BYTES: number;
    static readonly crypto_auth_hmacsha512_KEYBYTES: number;
    static readonly crypto_box_BEFORENMBYTES: number;
    static readonly crypto_box_MACBYTES: number;
    static readonly crypto_box_NONCEBYTES: number;
    static readonly crypto_box_PUBLICKEYBYTES: number;
    static readonly crypto_box_SEALBYTES: number;
    static readonly crypto_box_SECRETKEYBYTES: number;
David Burke's avatar
David Burke committed
38
    static readonly crypto_box_SEEDBYTES: number;
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    static readonly crypto_generichash_BYTES: number;
    static readonly crypto_generichash_BYTES_MAX: number;
    static readonly crypto_generichash_BYTES_MIN: number;
    static readonly crypto_generichash_KEYBYTES: number;
    static readonly crypto_generichash_KEYBYTES_MAX: number;
    static readonly crypto_generichash_KEYBYTES_MIN: number;
    static readonly crypto_onetimeauth_BYTES: number;
    static readonly crypto_onetimeauth_KEYBYTES: number;
    static readonly crypto_pwhash_ALG_ARGON2I13: number;
    static readonly crypto_pwhash_ALG_DEFAULT: number;
    static readonly crypto_pwhash_MEMLIMIT_INTERACTIVE: number;
    static readonly crypto_pwhash_MEMLIMIT_MODERATE: number;
    static readonly crypto_pwhash_MEMLIMIT_SENSITIVE: number;
    static readonly crypto_pwhash_OPSLIMIT_INTERACTIVE: number;
    static readonly crypto_pwhash_OPSLIMIT_MODERATE: number;
    static readonly crypto_pwhash_OPSLIMIT_SENSITIVE: number;
    static readonly crypto_pwhash_SALTBYTES: number;
    static readonly crypto_pwhash_STRBYTES: number;
    static readonly crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE: number;
    static readonly crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE: number;
    static readonly crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE: number;
    static readonly crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE: number;
    static readonly crypto_pwhash_scryptsalsa208sha256_SALTBYTES: number;
    static readonly crypto_pwhash_scryptsalsa208sha256_STRBYTES: number;
    static readonly crypto_scalarmult_BYTES: number;
    static readonly crypto_scalarmult_SCALARBYTES: number;
    static readonly crypto_secretbox_KEYBYTES: number;
    static readonly crypto_secretbox_MACBYTES: number;
    static readonly crypto_secretbox_NONCEBYTES: number;
    static readonly crypto_shorthash_BYTES: number;
    static readonly crypto_shorthash_KEYBYTES: number;
    static readonly crypto_sign_BYTES: number;
    static readonly crypto_sign_PUBLICKEYBYTES: number;
    static readonly crypto_sign_SECRETKEYBYTES: number;
    static readonly crypto_sign_SEEDBYTES: number;
    static readonly crypto_stream_chacha20_KEYBYTES: number;
    static readonly crypto_stream_chacha20_NONCEBYTES: number;
David Burke's avatar
David Burke committed
76
    static DEMO_MSG(): string;
77
}