196 lines
7.1 KiB
TypeScript
196 lines
7.1 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @returns {string}
|
|
*/
|
|
export function get_public_key(id: string, openid: string, master_key: string, salt: string, pass: string): string;
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @returns {string}
|
|
*/
|
|
export function generate_sec_key(id: string, openid: string, master_key: string, salt: string, pass: string): string;
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
export function sign(id: string, openid: string, master_key: string, salt: string, pass: string, msg: string): string;
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
export function sign_for_tran(id: string, openid: string, master_key: string, salt: string, pass: string, msg: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
export function keccak256_hash(content: string): string;
|
|
/**
|
|
* @param {string} pass
|
|
* @param {string} salt
|
|
* @param {number} n
|
|
* @param {number} r
|
|
* @param {number} p
|
|
* @param {number} size
|
|
* @returns {string}
|
|
*/
|
|
export function generate_scrypt_hash(pass: string, salt: string, n: number, r: number, p: number, size: number): string;
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @returns {string}
|
|
*/
|
|
export function wget_address(id: string, openid: string, master_key: string, salt: string, pass: string): string;
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
export function wencrypt(id: string, openid: string, master_key: string, salt: string, pass: string, msg: string): string;
|
|
/**
|
|
* @param {string} id
|
|
* @param {string} openid
|
|
* @param {string} master_key
|
|
* @param {string} salt
|
|
* @param {string} pass
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
export function wdecrypt(id: string, openid: string, master_key: string, salt: string, pass: string, msg: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @param {string} key
|
|
* @returns {string}
|
|
*/
|
|
export function aes_encrypt(content: string, key: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @param {string} key
|
|
* @returns {string}
|
|
*/
|
|
export function aes_decrypt(content: string, key: string): string;
|
|
/**
|
|
* @param {string} pk
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
export function rencrypt(pk: string, msg: string): string;
|
|
/**
|
|
* @param {string} sk
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
export function rdecrypt(sk: string, msg: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
export function generate_qr(content: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
export function hex_deflate(content: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
export function hex_inflate(content: string): string;
|
|
/**
|
|
* @param {string} pass
|
|
* @param {string} salt
|
|
* @returns {string}
|
|
*/
|
|
export function password_hash(pass: string, salt: string): string;
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
export function hash_pass_svr(content: string): string;
|
|
/**
|
|
* @param {string} pass
|
|
* @param {string} pass_hash
|
|
* @returns {boolean}
|
|
*/
|
|
export function password_verify(pass: string, pass_hash: string): boolean;
|
|
|
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
|
|
export interface InitOutput {
|
|
readonly memory: WebAssembly.Memory;
|
|
readonly get_public_key: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
readonly generate_sec_key: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
readonly sign: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
readonly sign_for_tran: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
readonly keccak256_hash: (a: number, b: number, c: number) => void;
|
|
readonly generate_scrypt_hash: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
readonly wget_address: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
readonly wencrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
readonly wdecrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
readonly aes_encrypt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
readonly aes_decrypt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
readonly rencrypt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
readonly rdecrypt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
readonly generate_qr: (a: number, b: number, c: number) => void;
|
|
readonly hex_deflate: (a: number, b: number, c: number) => void;
|
|
readonly hex_inflate: (a: number, b: number, c: number) => void;
|
|
readonly password_hash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
readonly hash_pass_svr: (a: number, b: number, c: number) => void;
|
|
readonly password_verify: (a: number, b: number, c: number, d: number) => number;
|
|
readonly rustsecp256k1_v0_7_0_context_create: (a: number) => number;
|
|
readonly rustsecp256k1_v0_7_0_context_destroy: (a: number) => void;
|
|
readonly rustsecp256k1_v0_7_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
readonly rustsecp256k1_v0_7_0_default_error_callback_fn: (a: number, b: number) => void;
|
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
}
|
|
|
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
/**
|
|
* Instantiates the given `module`, which can either be bytes or
|
|
* a precompiled `WebAssembly.Module`.
|
|
*
|
|
* @param {SyncInitInput} module
|
|
*
|
|
* @returns {InitOutput}
|
|
*/
|
|
export function initSync(module: SyncInitInput): InitOutput;
|
|
|
|
/**
|
|
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
*
|
|
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
*
|
|
* @returns {Promise<InitOutput>}
|
|
*/
|
|
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|