643 lines
21 KiB
JavaScript
643 lines
21 KiB
JavaScript
let imports = {};
|
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
let wasm;
|
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
|
|
const heap = new Array(32).fill(undefined);
|
|
|
|
heap.push(undefined, null, true, false);
|
|
|
|
function getObject(idx) { return heap[idx]; }
|
|
|
|
let heap_next = heap.length;
|
|
|
|
function dropObject(idx) {
|
|
if (idx < 36) return;
|
|
heap[idx] = heap_next;
|
|
heap_next = idx;
|
|
}
|
|
|
|
function takeObject(idx) {
|
|
const ret = getObject(idx);
|
|
dropObject(idx);
|
|
return ret;
|
|
}
|
|
|
|
function addHeapObject(obj) {
|
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
const idx = heap_next;
|
|
heap_next = heap[idx];
|
|
|
|
heap[idx] = obj;
|
|
return idx;
|
|
}
|
|
|
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
|
|
cachedTextDecoder.decode();
|
|
|
|
let cachedUint8Memory0 = new Uint8Array();
|
|
|
|
function getUint8Memory0() {
|
|
if (cachedUint8Memory0.byteLength === 0) {
|
|
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
}
|
|
return cachedUint8Memory0;
|
|
}
|
|
|
|
function getStringFromWasm0(ptr, len) {
|
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
}
|
|
|
|
let WASM_VECTOR_LEN = 0;
|
|
|
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
|
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
? function (arg, view) {
|
|
return cachedTextEncoder.encodeInto(arg, view);
|
|
}
|
|
: function (arg, view) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
view.set(buf);
|
|
return {
|
|
read: arg.length,
|
|
written: buf.length
|
|
};
|
|
});
|
|
|
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
|
|
if (realloc === undefined) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
const ptr = malloc(buf.length);
|
|
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
WASM_VECTOR_LEN = buf.length;
|
|
return ptr;
|
|
}
|
|
|
|
let len = arg.length;
|
|
let ptr = malloc(len);
|
|
|
|
const mem = getUint8Memory0();
|
|
|
|
let offset = 0;
|
|
|
|
for (; offset < len; offset++) {
|
|
const code = arg.charCodeAt(offset);
|
|
if (code > 0x7F) break;
|
|
mem[ptr + offset] = code;
|
|
}
|
|
|
|
if (offset !== len) {
|
|
if (offset !== 0) {
|
|
arg = arg.slice(offset);
|
|
}
|
|
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
const ret = encodeString(arg, view);
|
|
|
|
offset += ret.written;
|
|
}
|
|
|
|
WASM_VECTOR_LEN = offset;
|
|
return ptr;
|
|
}
|
|
|
|
let cachedInt32Memory0 = new Int32Array();
|
|
|
|
function getInt32Memory0() {
|
|
if (cachedInt32Memory0.byteLength === 0) {
|
|
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
}
|
|
return cachedInt32Memory0;
|
|
}
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @returns {string}
|
|
*/
|
|
module.exports.get_public_key = function(msg_key, master_key, second_key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
wasm.get_public_key(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @returns {string}
|
|
*/
|
|
module.exports.generate_sec_key = function(msg_key, master_key, second_key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
wasm.generate_sec_key(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
module.exports.sign = function(msg_key, master_key, second_key, msg) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
const ptr3 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len3 = WASM_VECTOR_LEN;
|
|
wasm.sign(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
module.exports.sign_for_tran = function(msg_key, master_key, second_key, msg) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
const ptr3 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len3 = WASM_VECTOR_LEN;
|
|
wasm.sign_for_tran(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @returns {string}
|
|
*/
|
|
module.exports.wget_address = function(msg_key, master_key, second_key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
wasm.wget_address(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
module.exports.wencrypt = function(msg_key, master_key, second_key, msg) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
const ptr3 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len3 = WASM_VECTOR_LEN;
|
|
wasm.wencrypt(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} msg_key
|
|
* @param {string} master_key
|
|
* @param {string} second_key
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
module.exports.wdecrypt = function(msg_key, master_key, second_key, msg) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(msg_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(master_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(second_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
const ptr3 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len3 = WASM_VECTOR_LEN;
|
|
wasm.wdecrypt(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} content
|
|
* @param {string} key
|
|
* @returns {string}
|
|
*/
|
|
module.exports.aes_encrypt = function(content, key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.aes_encrypt(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} content
|
|
* @param {string} key
|
|
* @returns {string}
|
|
*/
|
|
module.exports.aes_decrypt = function(content, key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.aes_decrypt(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} pk
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
module.exports.rencrypt = function(pk, msg) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(pk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.rencrypt(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} sk
|
|
* @param {string} msg
|
|
* @returns {string}
|
|
*/
|
|
module.exports.rdecrypt = function(sk, msg) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.rdecrypt(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
module.exports.generate_qr = function(content) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.generate_qr(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
module.exports.hex_deflate = function(content) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.hex_deflate(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} content
|
|
* @returns {string}
|
|
*/
|
|
module.exports.hex_inflate = function(content) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.hex_inflate(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} pass
|
|
* @param {string} salt
|
|
* @returns {string}
|
|
*/
|
|
module.exports.password_hash = function(pass, salt) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(pass, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(salt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.password_hash(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(r0, r1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} pass
|
|
* @param {string} pass_hash
|
|
* @returns {boolean}
|
|
*/
|
|
module.exports.password_verify = function(pass, pass_hash) {
|
|
const ptr0 = passStringToWasm0(pass, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(pass_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ret = wasm.password_verify(ptr0, len0, ptr1, len1);
|
|
return ret !== 0;
|
|
};
|
|
|
|
function handleError(f, args) {
|
|
try {
|
|
return f.apply(this, args);
|
|
} catch (e) {
|
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
}
|
|
}
|
|
|
|
function getArrayU8FromWasm0(ptr, len) {
|
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
}
|
|
|
|
module.exports.__wbg_log_49bdec560ec4ae91 = function(arg0, arg1) {
|
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
};
|
|
|
|
module.exports.__wbg_randomFillSync_065afffde01daa66 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
|
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
takeObject(arg0);
|
|
};
|
|
|
|
module.exports.__wbg_getRandomValues_b99eec4244a475bb = function() { return handleError(function (arg0, arg1) {
|
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_process_0cc2ada8524d6f83 = function(arg0) {
|
|
const ret = getObject(arg0).process;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_is_object = function(arg0) {
|
|
const val = getObject(arg0);
|
|
const ret = typeof(val) === 'object' && val !== null;
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_versions_c11acceab27a6c87 = function(arg0) {
|
|
const ret = getObject(arg0).versions;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_node_7ff1ce49caf23815 = function(arg0) {
|
|
const ret = getObject(arg0).node;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_is_string = function(arg0) {
|
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_crypto_2036bed7c44c25e7 = function(arg0) {
|
|
const ret = getObject(arg0).crypto;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_msCrypto_a21fc88caf1ecdc8 = function(arg0) {
|
|
const ret = getObject(arg0).msCrypto;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_static_accessor_NODE_MODULE_cf6401cc1091279e = function() {
|
|
const ret = module;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_require_a746e79b322b9336 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
|
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
const ret = getObject(arg0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
|
|
const ret = self.self;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
|
|
const ret = window.window;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
|
|
const ret = globalThis.globalThis;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
|
|
const ret = global.global;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
const ret = getObject(arg0) === undefined;
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
|
|
const ret = getObject(arg0).buffer;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_new_8c3f0052272a457a = function(arg0) {
|
|
const ret = new Uint8Array(getObject(arg0));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
};
|
|
|
|
module.exports.__wbg_length_9e1ae1900cb0fbd5 = function(arg0) {
|
|
const ret = getObject(arg0).length;
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_newwithlength_f5933855e4f48a19 = function(arg0) {
|
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_subarray_58ad4efbb5bcb886 = function(arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
};
|
|
|
|
module.exports.__wbindgen_memory = function() {
|
|
const ret = wasm.memory;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
const path = require('path').join(__dirname, 'rustwallet_bg.wasm');
|
|
const bytes = require('fs').readFileSync(path);
|
|
|
|
const wasmModule = new WebAssembly.Module(bytes);
|
|
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
wasm = wasmInstance.exports;
|
|
module.exports.__wasm = wasm;
|
|
|