@triton-one/yellowstone-grpc 5.0.0 → 5.0.1-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +616 -0
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm.js +3805 -0
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm.js.map +1 -0
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +254 -0
- package/dist/cjs/grpc/geyser.js +4319 -0
- package/dist/cjs/grpc/geyser.js.map +1 -0
- package/dist/cjs/grpc/google/protobuf/timestamp.js +88 -0
- package/dist/cjs/grpc/google/protobuf/timestamp.js.map +1 -0
- package/dist/cjs/grpc/solana-storage.js +1989 -0
- package/dist/cjs/grpc/solana-storage.js.map +1 -0
- package/dist/cjs/index.js +202 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/napi/index.js +649 -0
- package/dist/cjs/napi/index.js.map +1 -0
- package/dist/cjs/napi/yellowstone-grpc-napi.linux-x64-gnu.node +0 -0
- package/dist/cjs/types.js +9 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +616 -0
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm.js +3805 -0
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +254 -0
- package/dist/esm/grpc/geyser.js +4172 -0
- package/dist/esm/grpc/google/protobuf/timestamp.js +85 -0
- package/dist/esm/grpc/solana-storage.js +1926 -0
- package/dist/esm/index.js +81 -0
- package/dist/esm/napi/index.js +576 -0
- package/dist/esm/napi/yellowstone-grpc-napi.linux-x64-gnu.node +0 -0
- package/dist/esm/types.js +7 -0
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +616 -0
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm.js +3805 -0
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +254 -0
- package/dist/types/grpc/geyser.d.ts +10145 -0
- package/dist/types/grpc/google/protobuf/timestamp.d.ts +131 -0
- package/dist/types/grpc/solana-storage.d.ts +3850 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/napi/index.d.ts +70 -0
- package/dist/types/types.d.ts +282 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3805 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
let wasm;
|
|
5
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
|
+
|
|
7
|
+
function addToExternrefTable0(obj) {
|
|
8
|
+
const idx = wasm.__externref_table_alloc();
|
|
9
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
10
|
+
return idx;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function handleError(f, args) {
|
|
14
|
+
try {
|
|
15
|
+
return f.apply(this, args);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
const idx = addToExternrefTable0(e);
|
|
18
|
+
wasm.__wbindgen_exn_store(idx);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
23
|
+
|
|
24
|
+
cachedTextDecoder.decode();
|
|
25
|
+
|
|
26
|
+
let cachedUint8ArrayMemory0 = null;
|
|
27
|
+
|
|
28
|
+
function getUint8ArrayMemory0() {
|
|
29
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
30
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
31
|
+
}
|
|
32
|
+
return cachedUint8ArrayMemory0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getStringFromWasm0(ptr, len) {
|
|
36
|
+
ptr = ptr >>> 0;
|
|
37
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function isLikeNone(x) {
|
|
41
|
+
return x === undefined || x === null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function debugString(val) {
|
|
45
|
+
// primitive types
|
|
46
|
+
const type = typeof val;
|
|
47
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
48
|
+
return `${val}`;
|
|
49
|
+
}
|
|
50
|
+
if (type == 'string') {
|
|
51
|
+
return `"${val}"`;
|
|
52
|
+
}
|
|
53
|
+
if (type == 'symbol') {
|
|
54
|
+
const description = val.description;
|
|
55
|
+
if (description == null) {
|
|
56
|
+
return 'Symbol';
|
|
57
|
+
} else {
|
|
58
|
+
return `Symbol(${description})`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (type == 'function') {
|
|
62
|
+
const name = val.name;
|
|
63
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
64
|
+
return `Function(${name})`;
|
|
65
|
+
} else {
|
|
66
|
+
return 'Function';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// objects
|
|
70
|
+
if (Array.isArray(val)) {
|
|
71
|
+
const length = val.length;
|
|
72
|
+
let debug = '[';
|
|
73
|
+
if (length > 0) {
|
|
74
|
+
debug += debugString(val[0]);
|
|
75
|
+
}
|
|
76
|
+
for(let i = 1; i < length; i++) {
|
|
77
|
+
debug += ', ' + debugString(val[i]);
|
|
78
|
+
}
|
|
79
|
+
debug += ']';
|
|
80
|
+
return debug;
|
|
81
|
+
}
|
|
82
|
+
// Test for built-in
|
|
83
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
84
|
+
let className;
|
|
85
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
86
|
+
className = builtInMatches[1];
|
|
87
|
+
} else {
|
|
88
|
+
// Failed to match the standard '[object ClassName]'
|
|
89
|
+
return toString.call(val);
|
|
90
|
+
}
|
|
91
|
+
if (className == 'Object') {
|
|
92
|
+
// we're a user defined class or Object
|
|
93
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
94
|
+
// easier than looping through ownProperties of `val`.
|
|
95
|
+
try {
|
|
96
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
97
|
+
} catch (_) {
|
|
98
|
+
return 'Object';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// errors
|
|
102
|
+
if (val instanceof Error) {
|
|
103
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
104
|
+
}
|
|
105
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
106
|
+
return className;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let WASM_VECTOR_LEN = 0;
|
|
110
|
+
|
|
111
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
112
|
+
|
|
113
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
114
|
+
? function (arg, view) {
|
|
115
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
116
|
+
}
|
|
117
|
+
: function (arg, view) {
|
|
118
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
119
|
+
view.set(buf);
|
|
120
|
+
return {
|
|
121
|
+
read: arg.length,
|
|
122
|
+
written: buf.length
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
127
|
+
|
|
128
|
+
if (realloc === undefined) {
|
|
129
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
130
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
131
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
132
|
+
WASM_VECTOR_LEN = buf.length;
|
|
133
|
+
return ptr;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
let len = arg.length;
|
|
137
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
138
|
+
|
|
139
|
+
const mem = getUint8ArrayMemory0();
|
|
140
|
+
|
|
141
|
+
let offset = 0;
|
|
142
|
+
|
|
143
|
+
for (; offset < len; offset++) {
|
|
144
|
+
const code = arg.charCodeAt(offset);
|
|
145
|
+
if (code > 0x7F) break;
|
|
146
|
+
mem[ptr + offset] = code;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (offset !== len) {
|
|
150
|
+
if (offset !== 0) {
|
|
151
|
+
arg = arg.slice(offset);
|
|
152
|
+
}
|
|
153
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
154
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
155
|
+
const ret = encodeString(arg, view);
|
|
156
|
+
|
|
157
|
+
offset += ret.written;
|
|
158
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
WASM_VECTOR_LEN = offset;
|
|
162
|
+
return ptr;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let cachedDataViewMemory0 = null;
|
|
166
|
+
|
|
167
|
+
function getDataViewMemory0() {
|
|
168
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
169
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
170
|
+
}
|
|
171
|
+
return cachedDataViewMemory0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
175
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
176
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
177
|
+
WASM_VECTOR_LEN = arg.length;
|
|
178
|
+
return ptr;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function takeFromExternrefTable0(idx) {
|
|
182
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
183
|
+
wasm.__externref_table_dealloc(idx);
|
|
184
|
+
return value;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* @param {Uint8Array} data
|
|
188
|
+
* @param {WasmUiTransactionEncoding} encoding
|
|
189
|
+
* @param {number | null | undefined} max_supported_transaction_version
|
|
190
|
+
* @param {boolean} show_rewards
|
|
191
|
+
* @returns {string}
|
|
192
|
+
*/
|
|
193
|
+
module.exports.encode_tx = function(data, encoding, max_supported_transaction_version, show_rewards) {
|
|
194
|
+
let deferred3_0;
|
|
195
|
+
let deferred3_1;
|
|
196
|
+
try {
|
|
197
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
198
|
+
const len0 = WASM_VECTOR_LEN;
|
|
199
|
+
const ret = wasm.encode_tx(ptr0, len0, encoding, isLikeNone(max_supported_transaction_version) ? 0xFFFFFF : max_supported_transaction_version, show_rewards);
|
|
200
|
+
var ptr2 = ret[0];
|
|
201
|
+
var len2 = ret[1];
|
|
202
|
+
if (ret[3]) {
|
|
203
|
+
ptr2 = 0; len2 = 0;
|
|
204
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
205
|
+
}
|
|
206
|
+
deferred3_0 = ptr2;
|
|
207
|
+
deferred3_1 = len2;
|
|
208
|
+
return getStringFromWasm0(ptr2, len2);
|
|
209
|
+
} finally {
|
|
210
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @param {Uint8Array} err
|
|
216
|
+
* @returns {string}
|
|
217
|
+
*/
|
|
218
|
+
module.exports.decode_tx_error = function(err) {
|
|
219
|
+
let deferred3_0;
|
|
220
|
+
let deferred3_1;
|
|
221
|
+
try {
|
|
222
|
+
const ptr0 = passArray8ToWasm0(err, wasm.__wbindgen_malloc);
|
|
223
|
+
const len0 = WASM_VECTOR_LEN;
|
|
224
|
+
const ret = wasm.decode_tx_error(ptr0, len0);
|
|
225
|
+
var ptr2 = ret[0];
|
|
226
|
+
var len2 = ret[1];
|
|
227
|
+
if (ret[3]) {
|
|
228
|
+
ptr2 = 0; len2 = 0;
|
|
229
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
230
|
+
}
|
|
231
|
+
deferred3_0 = ptr2;
|
|
232
|
+
deferred3_1 = len2;
|
|
233
|
+
return getStringFromWasm0(ptr2, len2);
|
|
234
|
+
} finally {
|
|
235
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
function _assertClass(instance, klass) {
|
|
240
|
+
if (!(instance instanceof klass)) {
|
|
241
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
246
|
+
ptr = ptr >>> 0;
|
|
247
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
251
|
+
*/
|
|
252
|
+
module.exports.WasmUiTransactionEncoding = Object.freeze({
|
|
253
|
+
Binary: 0, "0": "Binary",
|
|
254
|
+
Base64: 1, "1": "Base64",
|
|
255
|
+
Base58: 2, "2": "Base58",
|
|
256
|
+
Json: 3, "3": "Json",
|
|
257
|
+
JsonParsed: 4, "4": "JsonParsed",
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
const AeCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
261
|
+
? { register: () => {}, unregister: () => {} }
|
|
262
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_aeciphertext_free(ptr >>> 0, 1));
|
|
263
|
+
/**
|
|
264
|
+
* Authenticated encryption nonce and ciphertext
|
|
265
|
+
*/
|
|
266
|
+
class AeCiphertext {
|
|
267
|
+
|
|
268
|
+
static __wrap(ptr) {
|
|
269
|
+
ptr = ptr >>> 0;
|
|
270
|
+
const obj = Object.create(AeCiphertext.prototype);
|
|
271
|
+
obj.__wbg_ptr = ptr;
|
|
272
|
+
AeCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
273
|
+
return obj;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
__destroy_into_raw() {
|
|
277
|
+
const ptr = this.__wbg_ptr;
|
|
278
|
+
this.__wbg_ptr = 0;
|
|
279
|
+
AeCiphertextFinalization.unregister(this);
|
|
280
|
+
return ptr;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
free() {
|
|
284
|
+
const ptr = this.__destroy_into_raw();
|
|
285
|
+
wasm.__wbg_aeciphertext_free(ptr, 0);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
module.exports.AeCiphertext = AeCiphertext;
|
|
289
|
+
|
|
290
|
+
const AeKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
291
|
+
? { register: () => {}, unregister: () => {} }
|
|
292
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_aekey_free(ptr >>> 0, 1));
|
|
293
|
+
|
|
294
|
+
class AeKey {
|
|
295
|
+
|
|
296
|
+
static __wrap(ptr) {
|
|
297
|
+
ptr = ptr >>> 0;
|
|
298
|
+
const obj = Object.create(AeKey.prototype);
|
|
299
|
+
obj.__wbg_ptr = ptr;
|
|
300
|
+
AeKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
301
|
+
return obj;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
__destroy_into_raw() {
|
|
305
|
+
const ptr = this.__wbg_ptr;
|
|
306
|
+
this.__wbg_ptr = 0;
|
|
307
|
+
AeKeyFinalization.unregister(this);
|
|
308
|
+
return ptr;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
free() {
|
|
312
|
+
const ptr = this.__destroy_into_raw();
|
|
313
|
+
wasm.__wbg_aekey_free(ptr, 0);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Generates a random authenticated encryption key.
|
|
317
|
+
*
|
|
318
|
+
* This function is randomized. It internally samples a 128-bit key using `OsRng`.
|
|
319
|
+
* @returns {AeKey}
|
|
320
|
+
*/
|
|
321
|
+
static newRand() {
|
|
322
|
+
const ret = wasm.aekey_newRand();
|
|
323
|
+
return AeKey.__wrap(ret);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Encrypts an amount under the authenticated encryption key.
|
|
327
|
+
* @param {bigint} amount
|
|
328
|
+
* @returns {AeCiphertext}
|
|
329
|
+
*/
|
|
330
|
+
encrypt(amount) {
|
|
331
|
+
const ret = wasm.aekey_encrypt(this.__wbg_ptr, amount);
|
|
332
|
+
return AeCiphertext.__wrap(ret);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @param {AeCiphertext} ciphertext
|
|
336
|
+
* @returns {bigint | undefined}
|
|
337
|
+
*/
|
|
338
|
+
decrypt(ciphertext) {
|
|
339
|
+
_assertClass(ciphertext, AeCiphertext);
|
|
340
|
+
const ret = wasm.aekey_decrypt(this.__wbg_ptr, ciphertext.__wbg_ptr);
|
|
341
|
+
return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
module.exports.AeKey = AeKey;
|
|
345
|
+
|
|
346
|
+
const BatchedGroupedCiphertext2HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
347
|
+
? { register: () => {}, unregister: () => {} }
|
|
348
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedgroupedciphertext2handlesvalidityproof_free(ptr >>> 0, 1));
|
|
349
|
+
/**
|
|
350
|
+
* Batched grouped ciphertext validity proof with two handles.
|
|
351
|
+
*
|
|
352
|
+
* A batched grouped ciphertext validity proof certifies the validity of two instances of a
|
|
353
|
+
* standard ciphertext validity proof. An instance of a standard validity proof consists of one
|
|
354
|
+
* ciphertext and two decryption handles: `(commitment, first_handle, second_handle)`. An
|
|
355
|
+
* instance of a batched ciphertext validity proof is a pair `(commitment_0,
|
|
356
|
+
* first_handle_0, second_handle_0)` and `(commitment_1, first_handle_1,
|
|
357
|
+
* second_handle_1)`. The proof certifies the analogous decryptable properties for each one of
|
|
358
|
+
* these pairs of commitment and decryption handles.
|
|
359
|
+
*/
|
|
360
|
+
class BatchedGroupedCiphertext2HandlesValidityProof {
|
|
361
|
+
|
|
362
|
+
__destroy_into_raw() {
|
|
363
|
+
const ptr = this.__wbg_ptr;
|
|
364
|
+
this.__wbg_ptr = 0;
|
|
365
|
+
BatchedGroupedCiphertext2HandlesValidityProofFinalization.unregister(this);
|
|
366
|
+
return ptr;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
free() {
|
|
370
|
+
const ptr = this.__destroy_into_raw();
|
|
371
|
+
wasm.__wbg_batchedgroupedciphertext2handlesvalidityproof_free(ptr, 0);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
module.exports.BatchedGroupedCiphertext2HandlesValidityProof = BatchedGroupedCiphertext2HandlesValidityProof;
|
|
375
|
+
|
|
376
|
+
const BatchedGroupedCiphertext2HandlesValidityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
377
|
+
? { register: () => {}, unregister: () => {} }
|
|
378
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedgroupedciphertext2handlesvalidityproofcontext_free(ptr >>> 0, 1));
|
|
379
|
+
|
|
380
|
+
class BatchedGroupedCiphertext2HandlesValidityProofContext {
|
|
381
|
+
|
|
382
|
+
static __wrap(ptr) {
|
|
383
|
+
ptr = ptr >>> 0;
|
|
384
|
+
const obj = Object.create(BatchedGroupedCiphertext2HandlesValidityProofContext.prototype);
|
|
385
|
+
obj.__wbg_ptr = ptr;
|
|
386
|
+
BatchedGroupedCiphertext2HandlesValidityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
387
|
+
return obj;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
__destroy_into_raw() {
|
|
391
|
+
const ptr = this.__wbg_ptr;
|
|
392
|
+
this.__wbg_ptr = 0;
|
|
393
|
+
BatchedGroupedCiphertext2HandlesValidityProofContextFinalization.unregister(this);
|
|
394
|
+
return ptr;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
free() {
|
|
398
|
+
const ptr = this.__destroy_into_raw();
|
|
399
|
+
wasm.__wbg_batchedgroupedciphertext2handlesvalidityproofcontext_free(ptr, 0);
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* @returns {PodElGamalPubkey}
|
|
403
|
+
*/
|
|
404
|
+
get first_pubkey() {
|
|
405
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
406
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* @param {PodElGamalPubkey} arg0
|
|
410
|
+
*/
|
|
411
|
+
set first_pubkey(arg0) {
|
|
412
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
413
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
414
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* @returns {PodElGamalPubkey}
|
|
418
|
+
*/
|
|
419
|
+
get second_pubkey() {
|
|
420
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr);
|
|
421
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* @param {PodElGamalPubkey} arg0
|
|
425
|
+
*/
|
|
426
|
+
set second_pubkey(arg0) {
|
|
427
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
428
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
429
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr, ptr0);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* @returns {PodGroupedElGamalCiphertext2Handles}
|
|
433
|
+
*/
|
|
434
|
+
get grouped_ciphertext_lo() {
|
|
435
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr);
|
|
436
|
+
return PodGroupedElGamalCiphertext2Handles.__wrap(ret);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @param {PodGroupedElGamalCiphertext2Handles} arg0
|
|
440
|
+
*/
|
|
441
|
+
set grouped_ciphertext_lo(arg0) {
|
|
442
|
+
_assertClass(arg0, PodGroupedElGamalCiphertext2Handles);
|
|
443
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
444
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr, ptr0);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* @returns {PodGroupedElGamalCiphertext2Handles}
|
|
448
|
+
*/
|
|
449
|
+
get grouped_ciphertext_hi() {
|
|
450
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_grouped_ciphertext_hi(this.__wbg_ptr);
|
|
451
|
+
return PodGroupedElGamalCiphertext2Handles.__wrap(ret);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* @param {PodGroupedElGamalCiphertext2Handles} arg0
|
|
455
|
+
*/
|
|
456
|
+
set grouped_ciphertext_hi(arg0) {
|
|
457
|
+
_assertClass(arg0, PodGroupedElGamalCiphertext2Handles);
|
|
458
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
459
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_grouped_ciphertext_hi(this.__wbg_ptr, ptr0);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* @returns {Uint8Array}
|
|
463
|
+
*/
|
|
464
|
+
toBytes() {
|
|
465
|
+
const ret = wasm.batchedgroupedciphertext2handlesvalidityproofcontext_toBytes(this.__wbg_ptr);
|
|
466
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
467
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
468
|
+
return v1;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* @param {Uint8Array} bytes
|
|
472
|
+
* @returns {BatchedGroupedCiphertext2HandlesValidityProofContext}
|
|
473
|
+
*/
|
|
474
|
+
static fromBytes(bytes) {
|
|
475
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
476
|
+
const len0 = WASM_VECTOR_LEN;
|
|
477
|
+
const ret = wasm.batchedgroupedciphertext2handlesvalidityproofcontext_fromBytes(ptr0, len0);
|
|
478
|
+
if (ret[2]) {
|
|
479
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
480
|
+
}
|
|
481
|
+
return BatchedGroupedCiphertext2HandlesValidityProofContext.__wrap(ret[0]);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
module.exports.BatchedGroupedCiphertext2HandlesValidityProofContext = BatchedGroupedCiphertext2HandlesValidityProofContext;
|
|
485
|
+
|
|
486
|
+
const BatchedGroupedCiphertext2HandlesValidityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
487
|
+
? { register: () => {}, unregister: () => {} }
|
|
488
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedgroupedciphertext2handlesvalidityproofdata_free(ptr >>> 0, 1));
|
|
489
|
+
/**
|
|
490
|
+
* The instruction data that is needed for the
|
|
491
|
+
* `ProofInstruction::VerifyBatchedGroupedCiphertextValidity` instruction.
|
|
492
|
+
*
|
|
493
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
494
|
+
* the proof.
|
|
495
|
+
*/
|
|
496
|
+
class BatchedGroupedCiphertext2HandlesValidityProofData {
|
|
497
|
+
|
|
498
|
+
static __wrap(ptr) {
|
|
499
|
+
ptr = ptr >>> 0;
|
|
500
|
+
const obj = Object.create(BatchedGroupedCiphertext2HandlesValidityProofData.prototype);
|
|
501
|
+
obj.__wbg_ptr = ptr;
|
|
502
|
+
BatchedGroupedCiphertext2HandlesValidityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
503
|
+
return obj;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
__destroy_into_raw() {
|
|
507
|
+
const ptr = this.__wbg_ptr;
|
|
508
|
+
this.__wbg_ptr = 0;
|
|
509
|
+
BatchedGroupedCiphertext2HandlesValidityProofDataFinalization.unregister(this);
|
|
510
|
+
return ptr;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
free() {
|
|
514
|
+
const ptr = this.__destroy_into_raw();
|
|
515
|
+
wasm.__wbg_batchedgroupedciphertext2handlesvalidityproofdata_free(ptr, 0);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* @returns {BatchedGroupedCiphertext2HandlesValidityProofContext}
|
|
519
|
+
*/
|
|
520
|
+
get context() {
|
|
521
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofdata_context(this.__wbg_ptr);
|
|
522
|
+
return BatchedGroupedCiphertext2HandlesValidityProofContext.__wrap(ret);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* @param {BatchedGroupedCiphertext2HandlesValidityProofContext} arg0
|
|
526
|
+
*/
|
|
527
|
+
set context(arg0) {
|
|
528
|
+
_assertClass(arg0, BatchedGroupedCiphertext2HandlesValidityProofContext);
|
|
529
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
530
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofdata_context(this.__wbg_ptr, ptr0);
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* @returns {PodBatchedGroupedCiphertext2HandlesValidityProof}
|
|
534
|
+
*/
|
|
535
|
+
get proof() {
|
|
536
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofdata_proof(this.__wbg_ptr);
|
|
537
|
+
return PodBatchedGroupedCiphertext2HandlesValidityProof.__wrap(ret);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* @param {PodBatchedGroupedCiphertext2HandlesValidityProof} arg0
|
|
541
|
+
*/
|
|
542
|
+
set proof(arg0) {
|
|
543
|
+
_assertClass(arg0, PodBatchedGroupedCiphertext2HandlesValidityProof);
|
|
544
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
545
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofdata_proof(this.__wbg_ptr, ptr0);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
549
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
550
|
+
* @param {GroupedElGamalCiphertext2Handles} grouped_ciphertext_lo
|
|
551
|
+
* @param {GroupedElGamalCiphertext2Handles} grouped_ciphertext_hi
|
|
552
|
+
* @param {bigint} amount_lo
|
|
553
|
+
* @param {bigint} amount_hi
|
|
554
|
+
* @param {PedersenOpening} opening_lo
|
|
555
|
+
* @param {PedersenOpening} opening_hi
|
|
556
|
+
* @returns {BatchedGroupedCiphertext2HandlesValidityProofData}
|
|
557
|
+
*/
|
|
558
|
+
static new(first_pubkey, second_pubkey, grouped_ciphertext_lo, grouped_ciphertext_hi, amount_lo, amount_hi, opening_lo, opening_hi) {
|
|
559
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
560
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
561
|
+
_assertClass(grouped_ciphertext_lo, GroupedElGamalCiphertext2Handles);
|
|
562
|
+
_assertClass(grouped_ciphertext_hi, GroupedElGamalCiphertext2Handles);
|
|
563
|
+
_assertClass(opening_lo, PedersenOpening);
|
|
564
|
+
_assertClass(opening_hi, PedersenOpening);
|
|
565
|
+
const ret = wasm.batchedgroupedciphertext2handlesvalidityproofdata_new(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, grouped_ciphertext_lo.__wbg_ptr, grouped_ciphertext_hi.__wbg_ptr, amount_lo, amount_hi, opening_lo.__wbg_ptr, opening_hi.__wbg_ptr);
|
|
566
|
+
if (ret[2]) {
|
|
567
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
568
|
+
}
|
|
569
|
+
return BatchedGroupedCiphertext2HandlesValidityProofData.__wrap(ret[0]);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* @returns {Uint8Array}
|
|
573
|
+
*/
|
|
574
|
+
toBytes() {
|
|
575
|
+
const ret = wasm.batchedgroupedciphertext2handlesvalidityproofdata_toBytes(this.__wbg_ptr);
|
|
576
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
577
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
578
|
+
return v1;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @param {Uint8Array} bytes
|
|
582
|
+
* @returns {BatchedGroupedCiphertext2HandlesValidityProofData}
|
|
583
|
+
*/
|
|
584
|
+
static fromBytes(bytes) {
|
|
585
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
586
|
+
const len0 = WASM_VECTOR_LEN;
|
|
587
|
+
const ret = wasm.batchedgroupedciphertext2handlesvalidityproofdata_fromBytes(ptr0, len0);
|
|
588
|
+
if (ret[2]) {
|
|
589
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
590
|
+
}
|
|
591
|
+
return BatchedGroupedCiphertext2HandlesValidityProofData.__wrap(ret[0]);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
module.exports.BatchedGroupedCiphertext2HandlesValidityProofData = BatchedGroupedCiphertext2HandlesValidityProofData;
|
|
595
|
+
|
|
596
|
+
const BatchedGroupedCiphertext3HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
597
|
+
? { register: () => {}, unregister: () => {} }
|
|
598
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedgroupedciphertext3handlesvalidityproof_free(ptr >>> 0, 1));
|
|
599
|
+
/**
|
|
600
|
+
* Batched grouped ciphertext validity proof with two handles.
|
|
601
|
+
*/
|
|
602
|
+
class BatchedGroupedCiphertext3HandlesValidityProof {
|
|
603
|
+
|
|
604
|
+
__destroy_into_raw() {
|
|
605
|
+
const ptr = this.__wbg_ptr;
|
|
606
|
+
this.__wbg_ptr = 0;
|
|
607
|
+
BatchedGroupedCiphertext3HandlesValidityProofFinalization.unregister(this);
|
|
608
|
+
return ptr;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
free() {
|
|
612
|
+
const ptr = this.__destroy_into_raw();
|
|
613
|
+
wasm.__wbg_batchedgroupedciphertext3handlesvalidityproof_free(ptr, 0);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
module.exports.BatchedGroupedCiphertext3HandlesValidityProof = BatchedGroupedCiphertext3HandlesValidityProof;
|
|
617
|
+
|
|
618
|
+
const BatchedGroupedCiphertext3HandlesValidityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
619
|
+
? { register: () => {}, unregister: () => {} }
|
|
620
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedgroupedciphertext3handlesvalidityproofcontext_free(ptr >>> 0, 1));
|
|
621
|
+
|
|
622
|
+
class BatchedGroupedCiphertext3HandlesValidityProofContext {
|
|
623
|
+
|
|
624
|
+
static __wrap(ptr) {
|
|
625
|
+
ptr = ptr >>> 0;
|
|
626
|
+
const obj = Object.create(BatchedGroupedCiphertext3HandlesValidityProofContext.prototype);
|
|
627
|
+
obj.__wbg_ptr = ptr;
|
|
628
|
+
BatchedGroupedCiphertext3HandlesValidityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
629
|
+
return obj;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
__destroy_into_raw() {
|
|
633
|
+
const ptr = this.__wbg_ptr;
|
|
634
|
+
this.__wbg_ptr = 0;
|
|
635
|
+
BatchedGroupedCiphertext3HandlesValidityProofContextFinalization.unregister(this);
|
|
636
|
+
return ptr;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
free() {
|
|
640
|
+
const ptr = this.__destroy_into_raw();
|
|
641
|
+
wasm.__wbg_batchedgroupedciphertext3handlesvalidityproofcontext_free(ptr, 0);
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* @returns {PodElGamalPubkey}
|
|
645
|
+
*/
|
|
646
|
+
get first_pubkey() {
|
|
647
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
648
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* @param {PodElGamalPubkey} arg0
|
|
652
|
+
*/
|
|
653
|
+
set first_pubkey(arg0) {
|
|
654
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
655
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
656
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* @returns {PodElGamalPubkey}
|
|
660
|
+
*/
|
|
661
|
+
get second_pubkey() {
|
|
662
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr);
|
|
663
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* @param {PodElGamalPubkey} arg0
|
|
667
|
+
*/
|
|
668
|
+
set second_pubkey(arg0) {
|
|
669
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
670
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
671
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr, ptr0);
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* @returns {PodElGamalPubkey}
|
|
675
|
+
*/
|
|
676
|
+
get third_pubkey() {
|
|
677
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofcontext_third_pubkey(this.__wbg_ptr);
|
|
678
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* @param {PodElGamalPubkey} arg0
|
|
682
|
+
*/
|
|
683
|
+
set third_pubkey(arg0) {
|
|
684
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
685
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
686
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofcontext_third_pubkey(this.__wbg_ptr, ptr0);
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* @returns {PodGroupedElGamalCiphertext3Handles}
|
|
690
|
+
*/
|
|
691
|
+
get grouped_ciphertext_lo() {
|
|
692
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr);
|
|
693
|
+
return PodGroupedElGamalCiphertext3Handles.__wrap(ret);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* @param {PodGroupedElGamalCiphertext3Handles} arg0
|
|
697
|
+
*/
|
|
698
|
+
set grouped_ciphertext_lo(arg0) {
|
|
699
|
+
_assertClass(arg0, PodGroupedElGamalCiphertext3Handles);
|
|
700
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
701
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr, ptr0);
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* @returns {PodGroupedElGamalCiphertext3Handles}
|
|
705
|
+
*/
|
|
706
|
+
get grouped_ciphertext_hi() {
|
|
707
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofcontext_grouped_ciphertext_hi(this.__wbg_ptr);
|
|
708
|
+
return PodGroupedElGamalCiphertext3Handles.__wrap(ret);
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* @param {PodGroupedElGamalCiphertext3Handles} arg0
|
|
712
|
+
*/
|
|
713
|
+
set grouped_ciphertext_hi(arg0) {
|
|
714
|
+
_assertClass(arg0, PodGroupedElGamalCiphertext3Handles);
|
|
715
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
716
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofcontext_grouped_ciphertext_hi(this.__wbg_ptr, ptr0);
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* @returns {Uint8Array}
|
|
720
|
+
*/
|
|
721
|
+
toBytes() {
|
|
722
|
+
const ret = wasm.batchedgroupedciphertext3handlesvalidityproofcontext_toBytes(this.__wbg_ptr);
|
|
723
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
724
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
725
|
+
return v1;
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* @param {Uint8Array} bytes
|
|
729
|
+
* @returns {BatchedGroupedCiphertext3HandlesValidityProofContext}
|
|
730
|
+
*/
|
|
731
|
+
static fromBytes(bytes) {
|
|
732
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
733
|
+
const len0 = WASM_VECTOR_LEN;
|
|
734
|
+
const ret = wasm.batchedgroupedciphertext3handlesvalidityproofcontext_fromBytes(ptr0, len0);
|
|
735
|
+
if (ret[2]) {
|
|
736
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
737
|
+
}
|
|
738
|
+
return BatchedGroupedCiphertext3HandlesValidityProofContext.__wrap(ret[0]);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
module.exports.BatchedGroupedCiphertext3HandlesValidityProofContext = BatchedGroupedCiphertext3HandlesValidityProofContext;
|
|
742
|
+
|
|
743
|
+
const BatchedGroupedCiphertext3HandlesValidityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
744
|
+
? { register: () => {}, unregister: () => {} }
|
|
745
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedgroupedciphertext3handlesvalidityproofdata_free(ptr >>> 0, 1));
|
|
746
|
+
/**
|
|
747
|
+
* The instruction data that is needed for the
|
|
748
|
+
* `ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity` instruction.
|
|
749
|
+
*
|
|
750
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
751
|
+
* the proof.
|
|
752
|
+
*/
|
|
753
|
+
class BatchedGroupedCiphertext3HandlesValidityProofData {
|
|
754
|
+
|
|
755
|
+
static __wrap(ptr) {
|
|
756
|
+
ptr = ptr >>> 0;
|
|
757
|
+
const obj = Object.create(BatchedGroupedCiphertext3HandlesValidityProofData.prototype);
|
|
758
|
+
obj.__wbg_ptr = ptr;
|
|
759
|
+
BatchedGroupedCiphertext3HandlesValidityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
760
|
+
return obj;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
__destroy_into_raw() {
|
|
764
|
+
const ptr = this.__wbg_ptr;
|
|
765
|
+
this.__wbg_ptr = 0;
|
|
766
|
+
BatchedGroupedCiphertext3HandlesValidityProofDataFinalization.unregister(this);
|
|
767
|
+
return ptr;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
free() {
|
|
771
|
+
const ptr = this.__destroy_into_raw();
|
|
772
|
+
wasm.__wbg_batchedgroupedciphertext3handlesvalidityproofdata_free(ptr, 0);
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* @returns {BatchedGroupedCiphertext3HandlesValidityProofContext}
|
|
776
|
+
*/
|
|
777
|
+
get context() {
|
|
778
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofdata_context(this.__wbg_ptr);
|
|
779
|
+
return BatchedGroupedCiphertext3HandlesValidityProofContext.__wrap(ret);
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* @param {BatchedGroupedCiphertext3HandlesValidityProofContext} arg0
|
|
783
|
+
*/
|
|
784
|
+
set context(arg0) {
|
|
785
|
+
_assertClass(arg0, BatchedGroupedCiphertext3HandlesValidityProofContext);
|
|
786
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
787
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofdata_context(this.__wbg_ptr, ptr0);
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* @returns {PodBatchedGroupedCiphertext3HandlesValidityProof}
|
|
791
|
+
*/
|
|
792
|
+
get proof() {
|
|
793
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofdata_proof(this.__wbg_ptr);
|
|
794
|
+
return PodBatchedGroupedCiphertext3HandlesValidityProof.__wrap(ret);
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* @param {PodBatchedGroupedCiphertext3HandlesValidityProof} arg0
|
|
798
|
+
*/
|
|
799
|
+
set proof(arg0) {
|
|
800
|
+
_assertClass(arg0, PodBatchedGroupedCiphertext3HandlesValidityProof);
|
|
801
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
802
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofdata_proof(this.__wbg_ptr, ptr0);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
806
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
807
|
+
* @param {ElGamalPubkey} third_pubkey
|
|
808
|
+
* @param {GroupedElGamalCiphertext3Handles} grouped_ciphertext_lo
|
|
809
|
+
* @param {GroupedElGamalCiphertext3Handles} grouped_ciphertext_hi
|
|
810
|
+
* @param {bigint} amount_lo
|
|
811
|
+
* @param {bigint} amount_hi
|
|
812
|
+
* @param {PedersenOpening} opening_lo
|
|
813
|
+
* @param {PedersenOpening} opening_hi
|
|
814
|
+
* @returns {BatchedGroupedCiphertext3HandlesValidityProofData}
|
|
815
|
+
*/
|
|
816
|
+
static new(first_pubkey, second_pubkey, third_pubkey, grouped_ciphertext_lo, grouped_ciphertext_hi, amount_lo, amount_hi, opening_lo, opening_hi) {
|
|
817
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
818
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
819
|
+
_assertClass(third_pubkey, ElGamalPubkey);
|
|
820
|
+
_assertClass(grouped_ciphertext_lo, GroupedElGamalCiphertext3Handles);
|
|
821
|
+
_assertClass(grouped_ciphertext_hi, GroupedElGamalCiphertext3Handles);
|
|
822
|
+
_assertClass(opening_lo, PedersenOpening);
|
|
823
|
+
_assertClass(opening_hi, PedersenOpening);
|
|
824
|
+
const ret = wasm.batchedgroupedciphertext3handlesvalidityproofdata_new(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, third_pubkey.__wbg_ptr, grouped_ciphertext_lo.__wbg_ptr, grouped_ciphertext_hi.__wbg_ptr, amount_lo, amount_hi, opening_lo.__wbg_ptr, opening_hi.__wbg_ptr);
|
|
825
|
+
if (ret[2]) {
|
|
826
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
827
|
+
}
|
|
828
|
+
return BatchedGroupedCiphertext3HandlesValidityProofData.__wrap(ret[0]);
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* @returns {Uint8Array}
|
|
832
|
+
*/
|
|
833
|
+
toBytes() {
|
|
834
|
+
const ret = wasm.batchedgroupedciphertext3handlesvalidityproofdata_toBytes(this.__wbg_ptr);
|
|
835
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
836
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
837
|
+
return v1;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* @param {Uint8Array} bytes
|
|
841
|
+
* @returns {BatchedGroupedCiphertext3HandlesValidityProofData}
|
|
842
|
+
*/
|
|
843
|
+
static fromBytes(bytes) {
|
|
844
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
845
|
+
const len0 = WASM_VECTOR_LEN;
|
|
846
|
+
const ret = wasm.batchedgroupedciphertext3handlesvalidityproofdata_fromBytes(ptr0, len0);
|
|
847
|
+
if (ret[2]) {
|
|
848
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
849
|
+
}
|
|
850
|
+
return BatchedGroupedCiphertext3HandlesValidityProofData.__wrap(ret[0]);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
module.exports.BatchedGroupedCiphertext3HandlesValidityProofData = BatchedGroupedCiphertext3HandlesValidityProofData;
|
|
854
|
+
|
|
855
|
+
const CiphertextCiphertextEqualityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
856
|
+
? { register: () => {}, unregister: () => {} }
|
|
857
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertextciphertextequalityproof_free(ptr >>> 0, 1));
|
|
858
|
+
/**
|
|
859
|
+
* The ciphertext-ciphertext equality proof.
|
|
860
|
+
*
|
|
861
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
862
|
+
*/
|
|
863
|
+
class CiphertextCiphertextEqualityProof {
|
|
864
|
+
|
|
865
|
+
__destroy_into_raw() {
|
|
866
|
+
const ptr = this.__wbg_ptr;
|
|
867
|
+
this.__wbg_ptr = 0;
|
|
868
|
+
CiphertextCiphertextEqualityProofFinalization.unregister(this);
|
|
869
|
+
return ptr;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
free() {
|
|
873
|
+
const ptr = this.__destroy_into_raw();
|
|
874
|
+
wasm.__wbg_ciphertextciphertextequalityproof_free(ptr, 0);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
module.exports.CiphertextCiphertextEqualityProof = CiphertextCiphertextEqualityProof;
|
|
878
|
+
|
|
879
|
+
const CiphertextCiphertextEqualityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
880
|
+
? { register: () => {}, unregister: () => {} }
|
|
881
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertextciphertextequalityproofcontext_free(ptr >>> 0, 1));
|
|
882
|
+
/**
|
|
883
|
+
* The context data needed to verify a ciphertext-ciphertext equality proof.
|
|
884
|
+
*/
|
|
885
|
+
class CiphertextCiphertextEqualityProofContext {
|
|
886
|
+
|
|
887
|
+
static __wrap(ptr) {
|
|
888
|
+
ptr = ptr >>> 0;
|
|
889
|
+
const obj = Object.create(CiphertextCiphertextEqualityProofContext.prototype);
|
|
890
|
+
obj.__wbg_ptr = ptr;
|
|
891
|
+
CiphertextCiphertextEqualityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
892
|
+
return obj;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
__destroy_into_raw() {
|
|
896
|
+
const ptr = this.__wbg_ptr;
|
|
897
|
+
this.__wbg_ptr = 0;
|
|
898
|
+
CiphertextCiphertextEqualityProofContextFinalization.unregister(this);
|
|
899
|
+
return ptr;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
free() {
|
|
903
|
+
const ptr = this.__destroy_into_raw();
|
|
904
|
+
wasm.__wbg_ciphertextciphertextequalityproofcontext_free(ptr, 0);
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* @returns {PodElGamalPubkey}
|
|
908
|
+
*/
|
|
909
|
+
get first_pubkey() {
|
|
910
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
911
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* @param {PodElGamalPubkey} arg0
|
|
915
|
+
*/
|
|
916
|
+
set first_pubkey(arg0) {
|
|
917
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
918
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
919
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* @returns {PodElGamalPubkey}
|
|
923
|
+
*/
|
|
924
|
+
get second_pubkey() {
|
|
925
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr);
|
|
926
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* @param {PodElGamalPubkey} arg0
|
|
930
|
+
*/
|
|
931
|
+
set second_pubkey(arg0) {
|
|
932
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
933
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
934
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr, ptr0);
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* @returns {PodElGamalCiphertext}
|
|
938
|
+
*/
|
|
939
|
+
get first_ciphertext() {
|
|
940
|
+
const ret = wasm.__wbg_get_ciphertextciphertextequalityproofcontext_first_ciphertext(this.__wbg_ptr);
|
|
941
|
+
return PodElGamalCiphertext.__wrap(ret);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* @param {PodElGamalCiphertext} arg0
|
|
945
|
+
*/
|
|
946
|
+
set first_ciphertext(arg0) {
|
|
947
|
+
_assertClass(arg0, PodElGamalCiphertext);
|
|
948
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
949
|
+
wasm.__wbg_set_ciphertextciphertextequalityproofcontext_first_ciphertext(this.__wbg_ptr, ptr0);
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* @returns {PodElGamalCiphertext}
|
|
953
|
+
*/
|
|
954
|
+
get second_ciphertext() {
|
|
955
|
+
const ret = wasm.__wbg_get_ciphertextciphertextequalityproofcontext_second_ciphertext(this.__wbg_ptr);
|
|
956
|
+
return PodElGamalCiphertext.__wrap(ret);
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* @param {PodElGamalCiphertext} arg0
|
|
960
|
+
*/
|
|
961
|
+
set second_ciphertext(arg0) {
|
|
962
|
+
_assertClass(arg0, PodElGamalCiphertext);
|
|
963
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
964
|
+
wasm.__wbg_set_ciphertextciphertextequalityproofcontext_second_ciphertext(this.__wbg_ptr, ptr0);
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* @returns {Uint8Array}
|
|
968
|
+
*/
|
|
969
|
+
toBytes() {
|
|
970
|
+
const ret = wasm.ciphertextciphertextequalityproofcontext_toBytes(this.__wbg_ptr);
|
|
971
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
972
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
973
|
+
return v1;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* @param {Uint8Array} bytes
|
|
977
|
+
* @returns {CiphertextCiphertextEqualityProofContext}
|
|
978
|
+
*/
|
|
979
|
+
static fromBytes(bytes) {
|
|
980
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
981
|
+
const len0 = WASM_VECTOR_LEN;
|
|
982
|
+
const ret = wasm.ciphertextciphertextequalityproofcontext_fromBytes(ptr0, len0);
|
|
983
|
+
if (ret[2]) {
|
|
984
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
985
|
+
}
|
|
986
|
+
return CiphertextCiphertextEqualityProofContext.__wrap(ret[0]);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
module.exports.CiphertextCiphertextEqualityProofContext = CiphertextCiphertextEqualityProofContext;
|
|
990
|
+
|
|
991
|
+
const CiphertextCiphertextEqualityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
992
|
+
? { register: () => {}, unregister: () => {} }
|
|
993
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertextciphertextequalityproofdata_free(ptr >>> 0, 1));
|
|
994
|
+
/**
|
|
995
|
+
* The instruction data that is needed for the
|
|
996
|
+
* `ProofInstruction::VerifyCiphertextCiphertextEquality` instruction.
|
|
997
|
+
*
|
|
998
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
999
|
+
* the proof.
|
|
1000
|
+
*/
|
|
1001
|
+
class CiphertextCiphertextEqualityProofData {
|
|
1002
|
+
|
|
1003
|
+
static __wrap(ptr) {
|
|
1004
|
+
ptr = ptr >>> 0;
|
|
1005
|
+
const obj = Object.create(CiphertextCiphertextEqualityProofData.prototype);
|
|
1006
|
+
obj.__wbg_ptr = ptr;
|
|
1007
|
+
CiphertextCiphertextEqualityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1008
|
+
return obj;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
__destroy_into_raw() {
|
|
1012
|
+
const ptr = this.__wbg_ptr;
|
|
1013
|
+
this.__wbg_ptr = 0;
|
|
1014
|
+
CiphertextCiphertextEqualityProofDataFinalization.unregister(this);
|
|
1015
|
+
return ptr;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
free() {
|
|
1019
|
+
const ptr = this.__destroy_into_raw();
|
|
1020
|
+
wasm.__wbg_ciphertextciphertextequalityproofdata_free(ptr, 0);
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* @returns {CiphertextCiphertextEqualityProofContext}
|
|
1024
|
+
*/
|
|
1025
|
+
get context() {
|
|
1026
|
+
const ret = wasm.__wbg_get_ciphertextciphertextequalityproofdata_context(this.__wbg_ptr);
|
|
1027
|
+
return CiphertextCiphertextEqualityProofContext.__wrap(ret);
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* @param {CiphertextCiphertextEqualityProofContext} arg0
|
|
1031
|
+
*/
|
|
1032
|
+
set context(arg0) {
|
|
1033
|
+
_assertClass(arg0, CiphertextCiphertextEqualityProofContext);
|
|
1034
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1035
|
+
wasm.__wbg_set_ciphertextciphertextequalityproofdata_context(this.__wbg_ptr, ptr0);
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* @returns {PodCiphertextCiphertextEqualityProof}
|
|
1039
|
+
*/
|
|
1040
|
+
get proof() {
|
|
1041
|
+
const ret = wasm.__wbg_get_ciphertextciphertextequalityproofdata_proof(this.__wbg_ptr);
|
|
1042
|
+
return PodCiphertextCiphertextEqualityProof.__wrap(ret);
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* @param {PodCiphertextCiphertextEqualityProof} arg0
|
|
1046
|
+
*/
|
|
1047
|
+
set proof(arg0) {
|
|
1048
|
+
_assertClass(arg0, PodCiphertextCiphertextEqualityProof);
|
|
1049
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1050
|
+
wasm.__wbg_set_ciphertextciphertextequalityproofdata_proof(this.__wbg_ptr, ptr0);
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* @param {ElGamalKeypair} first_keypair
|
|
1054
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
1055
|
+
* @param {ElGamalCiphertext} first_ciphertext
|
|
1056
|
+
* @param {ElGamalCiphertext} second_ciphertext
|
|
1057
|
+
* @param {PedersenOpening} second_opening
|
|
1058
|
+
* @param {bigint} amount
|
|
1059
|
+
* @returns {CiphertextCiphertextEqualityProofData}
|
|
1060
|
+
*/
|
|
1061
|
+
static new(first_keypair, second_pubkey, first_ciphertext, second_ciphertext, second_opening, amount) {
|
|
1062
|
+
_assertClass(first_keypair, ElGamalKeypair);
|
|
1063
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
1064
|
+
_assertClass(first_ciphertext, ElGamalCiphertext);
|
|
1065
|
+
_assertClass(second_ciphertext, ElGamalCiphertext);
|
|
1066
|
+
_assertClass(second_opening, PedersenOpening);
|
|
1067
|
+
const ret = wasm.ciphertextciphertextequalityproofdata_new(first_keypair.__wbg_ptr, second_pubkey.__wbg_ptr, first_ciphertext.__wbg_ptr, second_ciphertext.__wbg_ptr, second_opening.__wbg_ptr, amount);
|
|
1068
|
+
if (ret[2]) {
|
|
1069
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1070
|
+
}
|
|
1071
|
+
return CiphertextCiphertextEqualityProofData.__wrap(ret[0]);
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* @returns {Uint8Array}
|
|
1075
|
+
*/
|
|
1076
|
+
toBytes() {
|
|
1077
|
+
const ret = wasm.ciphertextciphertextequalityproofdata_toBytes(this.__wbg_ptr);
|
|
1078
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1079
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1080
|
+
return v1;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* @param {Uint8Array} bytes
|
|
1084
|
+
* @returns {CiphertextCiphertextEqualityProofData}
|
|
1085
|
+
*/
|
|
1086
|
+
static fromBytes(bytes) {
|
|
1087
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1088
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1089
|
+
const ret = wasm.ciphertextciphertextequalityproofdata_fromBytes(ptr0, len0);
|
|
1090
|
+
if (ret[2]) {
|
|
1091
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1092
|
+
}
|
|
1093
|
+
return CiphertextCiphertextEqualityProofData.__wrap(ret[0]);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
module.exports.CiphertextCiphertextEqualityProofData = CiphertextCiphertextEqualityProofData;
|
|
1097
|
+
|
|
1098
|
+
const CiphertextCommitmentEqualityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1099
|
+
? { register: () => {}, unregister: () => {} }
|
|
1100
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertextcommitmentequalityproof_free(ptr >>> 0, 1));
|
|
1101
|
+
/**
|
|
1102
|
+
* Equality proof.
|
|
1103
|
+
*
|
|
1104
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
1105
|
+
*/
|
|
1106
|
+
class CiphertextCommitmentEqualityProof {
|
|
1107
|
+
|
|
1108
|
+
__destroy_into_raw() {
|
|
1109
|
+
const ptr = this.__wbg_ptr;
|
|
1110
|
+
this.__wbg_ptr = 0;
|
|
1111
|
+
CiphertextCommitmentEqualityProofFinalization.unregister(this);
|
|
1112
|
+
return ptr;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
free() {
|
|
1116
|
+
const ptr = this.__destroy_into_raw();
|
|
1117
|
+
wasm.__wbg_ciphertextcommitmentequalityproof_free(ptr, 0);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
module.exports.CiphertextCommitmentEqualityProof = CiphertextCommitmentEqualityProof;
|
|
1121
|
+
|
|
1122
|
+
const CiphertextCommitmentEqualityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1123
|
+
? { register: () => {}, unregister: () => {} }
|
|
1124
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertextcommitmentequalityproofcontext_free(ptr >>> 0, 1));
|
|
1125
|
+
/**
|
|
1126
|
+
* The context data needed to verify a ciphertext-commitment equality proof.
|
|
1127
|
+
*/
|
|
1128
|
+
class CiphertextCommitmentEqualityProofContext {
|
|
1129
|
+
|
|
1130
|
+
static __wrap(ptr) {
|
|
1131
|
+
ptr = ptr >>> 0;
|
|
1132
|
+
const obj = Object.create(CiphertextCommitmentEqualityProofContext.prototype);
|
|
1133
|
+
obj.__wbg_ptr = ptr;
|
|
1134
|
+
CiphertextCommitmentEqualityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1135
|
+
return obj;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
__destroy_into_raw() {
|
|
1139
|
+
const ptr = this.__wbg_ptr;
|
|
1140
|
+
this.__wbg_ptr = 0;
|
|
1141
|
+
CiphertextCommitmentEqualityProofContextFinalization.unregister(this);
|
|
1142
|
+
return ptr;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
free() {
|
|
1146
|
+
const ptr = this.__destroy_into_raw();
|
|
1147
|
+
wasm.__wbg_ciphertextcommitmentequalityproofcontext_free(ptr, 0);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* The ElGamal pubkey
|
|
1151
|
+
* @returns {PodElGamalPubkey}
|
|
1152
|
+
*/
|
|
1153
|
+
get pubkey() {
|
|
1154
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
1155
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* The ElGamal pubkey
|
|
1159
|
+
* @param {PodElGamalPubkey} arg0
|
|
1160
|
+
*/
|
|
1161
|
+
set pubkey(arg0) {
|
|
1162
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
1163
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1164
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* The ciphertext encrypted under the ElGamal pubkey
|
|
1168
|
+
* @returns {PodElGamalCiphertext}
|
|
1169
|
+
*/
|
|
1170
|
+
get ciphertext() {
|
|
1171
|
+
const ret = wasm.__wbg_get_ciphertextcommitmentequalityproofcontext_ciphertext(this.__wbg_ptr);
|
|
1172
|
+
return PodElGamalCiphertext.__wrap(ret);
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* The ciphertext encrypted under the ElGamal pubkey
|
|
1176
|
+
* @param {PodElGamalCiphertext} arg0
|
|
1177
|
+
*/
|
|
1178
|
+
set ciphertext(arg0) {
|
|
1179
|
+
_assertClass(arg0, PodElGamalCiphertext);
|
|
1180
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1181
|
+
wasm.__wbg_set_ciphertextcommitmentequalityproofcontext_ciphertext(this.__wbg_ptr, ptr0);
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* The Pedersen commitment
|
|
1185
|
+
* @returns {PodPedersenCommitment}
|
|
1186
|
+
*/
|
|
1187
|
+
get commitment() {
|
|
1188
|
+
const ret = wasm.__wbg_get_ciphertextcommitmentequalityproofcontext_commitment(this.__wbg_ptr);
|
|
1189
|
+
return PodPedersenCommitment.__wrap(ret);
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* The Pedersen commitment
|
|
1193
|
+
* @param {PodPedersenCommitment} arg0
|
|
1194
|
+
*/
|
|
1195
|
+
set commitment(arg0) {
|
|
1196
|
+
_assertClass(arg0, PodPedersenCommitment);
|
|
1197
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1198
|
+
wasm.__wbg_set_ciphertextcommitmentequalityproofcontext_commitment(this.__wbg_ptr, ptr0);
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* @returns {Uint8Array}
|
|
1202
|
+
*/
|
|
1203
|
+
toBytes() {
|
|
1204
|
+
const ret = wasm.ciphertextcommitmentequalityproofcontext_toBytes(this.__wbg_ptr);
|
|
1205
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1206
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1207
|
+
return v1;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* @param {Uint8Array} bytes
|
|
1211
|
+
* @returns {CiphertextCommitmentEqualityProofContext}
|
|
1212
|
+
*/
|
|
1213
|
+
static fromBytes(bytes) {
|
|
1214
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1215
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1216
|
+
const ret = wasm.ciphertextcommitmentequalityproofcontext_fromBytes(ptr0, len0);
|
|
1217
|
+
if (ret[2]) {
|
|
1218
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1219
|
+
}
|
|
1220
|
+
return CiphertextCommitmentEqualityProofContext.__wrap(ret[0]);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
module.exports.CiphertextCommitmentEqualityProofContext = CiphertextCommitmentEqualityProofContext;
|
|
1224
|
+
|
|
1225
|
+
const CiphertextCommitmentEqualityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1226
|
+
? { register: () => {}, unregister: () => {} }
|
|
1227
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ciphertextcommitmentequalityproofdata_free(ptr >>> 0, 1));
|
|
1228
|
+
/**
|
|
1229
|
+
* The instruction data that is needed for the
|
|
1230
|
+
* `ProofInstruction::VerifyCiphertextCommitmentEquality` instruction.
|
|
1231
|
+
*
|
|
1232
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
1233
|
+
* the proof.
|
|
1234
|
+
*/
|
|
1235
|
+
class CiphertextCommitmentEqualityProofData {
|
|
1236
|
+
|
|
1237
|
+
static __wrap(ptr) {
|
|
1238
|
+
ptr = ptr >>> 0;
|
|
1239
|
+
const obj = Object.create(CiphertextCommitmentEqualityProofData.prototype);
|
|
1240
|
+
obj.__wbg_ptr = ptr;
|
|
1241
|
+
CiphertextCommitmentEqualityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1242
|
+
return obj;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
__destroy_into_raw() {
|
|
1246
|
+
const ptr = this.__wbg_ptr;
|
|
1247
|
+
this.__wbg_ptr = 0;
|
|
1248
|
+
CiphertextCommitmentEqualityProofDataFinalization.unregister(this);
|
|
1249
|
+
return ptr;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
free() {
|
|
1253
|
+
const ptr = this.__destroy_into_raw();
|
|
1254
|
+
wasm.__wbg_ciphertextcommitmentequalityproofdata_free(ptr, 0);
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* @returns {CiphertextCommitmentEqualityProofContext}
|
|
1258
|
+
*/
|
|
1259
|
+
get context() {
|
|
1260
|
+
const ret = wasm.__wbg_get_ciphertextcommitmentequalityproofdata_context(this.__wbg_ptr);
|
|
1261
|
+
return CiphertextCommitmentEqualityProofContext.__wrap(ret);
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* @param {CiphertextCommitmentEqualityProofContext} arg0
|
|
1265
|
+
*/
|
|
1266
|
+
set context(arg0) {
|
|
1267
|
+
_assertClass(arg0, CiphertextCommitmentEqualityProofContext);
|
|
1268
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1269
|
+
wasm.__wbg_set_ciphertextcommitmentequalityproofdata_context(this.__wbg_ptr, ptr0);
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* @returns {PodCiphertextCommitmentEqualityProof}
|
|
1273
|
+
*/
|
|
1274
|
+
get proof() {
|
|
1275
|
+
const ret = wasm.__wbg_get_ciphertextcommitmentequalityproofdata_proof(this.__wbg_ptr);
|
|
1276
|
+
return PodCiphertextCommitmentEqualityProof.__wrap(ret);
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* @param {PodCiphertextCommitmentEqualityProof} arg0
|
|
1280
|
+
*/
|
|
1281
|
+
set proof(arg0) {
|
|
1282
|
+
_assertClass(arg0, PodCiphertextCommitmentEqualityProof);
|
|
1283
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1284
|
+
wasm.__wbg_set_ciphertextcommitmentequalityproofdata_proof(this.__wbg_ptr, ptr0);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* @param {ElGamalKeypair} keypair
|
|
1288
|
+
* @param {ElGamalCiphertext} ciphertext
|
|
1289
|
+
* @param {PedersenCommitment} commitment
|
|
1290
|
+
* @param {PedersenOpening} opening
|
|
1291
|
+
* @param {bigint} amount
|
|
1292
|
+
* @returns {CiphertextCommitmentEqualityProofData}
|
|
1293
|
+
*/
|
|
1294
|
+
static new(keypair, ciphertext, commitment, opening, amount) {
|
|
1295
|
+
_assertClass(keypair, ElGamalKeypair);
|
|
1296
|
+
_assertClass(ciphertext, ElGamalCiphertext);
|
|
1297
|
+
_assertClass(commitment, PedersenCommitment);
|
|
1298
|
+
_assertClass(opening, PedersenOpening);
|
|
1299
|
+
const ret = wasm.ciphertextcommitmentequalityproofdata_new(keypair.__wbg_ptr, ciphertext.__wbg_ptr, commitment.__wbg_ptr, opening.__wbg_ptr, amount);
|
|
1300
|
+
if (ret[2]) {
|
|
1301
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1302
|
+
}
|
|
1303
|
+
return CiphertextCommitmentEqualityProofData.__wrap(ret[0]);
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* @returns {Uint8Array}
|
|
1307
|
+
*/
|
|
1308
|
+
toBytes() {
|
|
1309
|
+
const ret = wasm.ciphertextcommitmentequalityproofdata_toBytes(this.__wbg_ptr);
|
|
1310
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1311
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1312
|
+
return v1;
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* @param {Uint8Array} bytes
|
|
1316
|
+
* @returns {CiphertextCommitmentEqualityProofData}
|
|
1317
|
+
*/
|
|
1318
|
+
static fromBytes(bytes) {
|
|
1319
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1320
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1321
|
+
const ret = wasm.ciphertextcommitmentequalityproofdata_fromBytes(ptr0, len0);
|
|
1322
|
+
if (ret[2]) {
|
|
1323
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1324
|
+
}
|
|
1325
|
+
return CiphertextCommitmentEqualityProofData.__wrap(ret[0]);
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
module.exports.CiphertextCommitmentEqualityProofData = CiphertextCommitmentEqualityProofData;
|
|
1329
|
+
|
|
1330
|
+
const DecryptHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1331
|
+
? { register: () => {}, unregister: () => {} }
|
|
1332
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decrypthandle_free(ptr >>> 0, 1));
|
|
1333
|
+
/**
|
|
1334
|
+
* Decryption handle for Pedersen commitment.
|
|
1335
|
+
*/
|
|
1336
|
+
class DecryptHandle {
|
|
1337
|
+
|
|
1338
|
+
static __wrap(ptr) {
|
|
1339
|
+
ptr = ptr >>> 0;
|
|
1340
|
+
const obj = Object.create(DecryptHandle.prototype);
|
|
1341
|
+
obj.__wbg_ptr = ptr;
|
|
1342
|
+
DecryptHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1343
|
+
return obj;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
__destroy_into_raw() {
|
|
1347
|
+
const ptr = this.__wbg_ptr;
|
|
1348
|
+
this.__wbg_ptr = 0;
|
|
1349
|
+
DecryptHandleFinalization.unregister(this);
|
|
1350
|
+
return ptr;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
free() {
|
|
1354
|
+
const ptr = this.__destroy_into_raw();
|
|
1355
|
+
wasm.__wbg_decrypthandle_free(ptr, 0);
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
module.exports.DecryptHandle = DecryptHandle;
|
|
1359
|
+
|
|
1360
|
+
const ElGamalCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1361
|
+
? { register: () => {}, unregister: () => {} }
|
|
1362
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_elgamalciphertext_free(ptr >>> 0, 1));
|
|
1363
|
+
/**
|
|
1364
|
+
* Ciphertext for the ElGamal encryption scheme.
|
|
1365
|
+
*/
|
|
1366
|
+
class ElGamalCiphertext {
|
|
1367
|
+
|
|
1368
|
+
static __wrap(ptr) {
|
|
1369
|
+
ptr = ptr >>> 0;
|
|
1370
|
+
const obj = Object.create(ElGamalCiphertext.prototype);
|
|
1371
|
+
obj.__wbg_ptr = ptr;
|
|
1372
|
+
ElGamalCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1373
|
+
return obj;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
__destroy_into_raw() {
|
|
1377
|
+
const ptr = this.__wbg_ptr;
|
|
1378
|
+
this.__wbg_ptr = 0;
|
|
1379
|
+
ElGamalCiphertextFinalization.unregister(this);
|
|
1380
|
+
return ptr;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
free() {
|
|
1384
|
+
const ptr = this.__destroy_into_raw();
|
|
1385
|
+
wasm.__wbg_elgamalciphertext_free(ptr, 0);
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* @returns {PedersenCommitment}
|
|
1389
|
+
*/
|
|
1390
|
+
get commitment() {
|
|
1391
|
+
const ret = wasm.__wbg_get_elgamalciphertext_commitment(this.__wbg_ptr);
|
|
1392
|
+
return PedersenCommitment.__wrap(ret);
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* @param {PedersenCommitment} arg0
|
|
1396
|
+
*/
|
|
1397
|
+
set commitment(arg0) {
|
|
1398
|
+
_assertClass(arg0, PedersenCommitment);
|
|
1399
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1400
|
+
wasm.__wbg_set_elgamalciphertext_commitment(this.__wbg_ptr, ptr0);
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* @returns {DecryptHandle}
|
|
1404
|
+
*/
|
|
1405
|
+
get handle() {
|
|
1406
|
+
const ret = wasm.__wbg_get_elgamalciphertext_handle(this.__wbg_ptr);
|
|
1407
|
+
return DecryptHandle.__wrap(ret);
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* @param {DecryptHandle} arg0
|
|
1411
|
+
*/
|
|
1412
|
+
set handle(arg0) {
|
|
1413
|
+
_assertClass(arg0, DecryptHandle);
|
|
1414
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1415
|
+
wasm.__wbg_set_elgamalciphertext_handle(this.__wbg_ptr, ptr0);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
module.exports.ElGamalCiphertext = ElGamalCiphertext;
|
|
1419
|
+
|
|
1420
|
+
const ElGamalKeypairFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1421
|
+
? { register: () => {}, unregister: () => {} }
|
|
1422
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_elgamalkeypair_free(ptr >>> 0, 1));
|
|
1423
|
+
/**
|
|
1424
|
+
* A (twisted) ElGamal encryption keypair.
|
|
1425
|
+
*
|
|
1426
|
+
* The instances of the secret key are zeroized on drop.
|
|
1427
|
+
*/
|
|
1428
|
+
class ElGamalKeypair {
|
|
1429
|
+
|
|
1430
|
+
static __wrap(ptr) {
|
|
1431
|
+
ptr = ptr >>> 0;
|
|
1432
|
+
const obj = Object.create(ElGamalKeypair.prototype);
|
|
1433
|
+
obj.__wbg_ptr = ptr;
|
|
1434
|
+
ElGamalKeypairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1435
|
+
return obj;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
__destroy_into_raw() {
|
|
1439
|
+
const ptr = this.__wbg_ptr;
|
|
1440
|
+
this.__wbg_ptr = 0;
|
|
1441
|
+
ElGamalKeypairFinalization.unregister(this);
|
|
1442
|
+
return ptr;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
free() {
|
|
1446
|
+
const ptr = this.__destroy_into_raw();
|
|
1447
|
+
wasm.__wbg_elgamalkeypair_free(ptr, 0);
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Generates the public and secret keys for ElGamal encryption.
|
|
1451
|
+
*
|
|
1452
|
+
* This function is randomized. It internally samples a scalar element using `OsRng`.
|
|
1453
|
+
* @returns {ElGamalKeypair}
|
|
1454
|
+
*/
|
|
1455
|
+
static newRand() {
|
|
1456
|
+
const ret = wasm.elgamalkeypair_newRand();
|
|
1457
|
+
return ElGamalKeypair.__wrap(ret);
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* @returns {ElGamalPubkey}
|
|
1461
|
+
*/
|
|
1462
|
+
pubkeyOwned() {
|
|
1463
|
+
const ret = wasm.elgamalkeypair_pubkeyOwned(this.__wbg_ptr);
|
|
1464
|
+
return ElGamalPubkey.__wrap(ret);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
module.exports.ElGamalKeypair = ElGamalKeypair;
|
|
1468
|
+
|
|
1469
|
+
const ElGamalPubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1470
|
+
? { register: () => {}, unregister: () => {} }
|
|
1471
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_elgamalpubkey_free(ptr >>> 0, 1));
|
|
1472
|
+
/**
|
|
1473
|
+
* Public key for the ElGamal encryption scheme.
|
|
1474
|
+
*/
|
|
1475
|
+
class ElGamalPubkey {
|
|
1476
|
+
|
|
1477
|
+
static __wrap(ptr) {
|
|
1478
|
+
ptr = ptr >>> 0;
|
|
1479
|
+
const obj = Object.create(ElGamalPubkey.prototype);
|
|
1480
|
+
obj.__wbg_ptr = ptr;
|
|
1481
|
+
ElGamalPubkeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1482
|
+
return obj;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
__destroy_into_raw() {
|
|
1486
|
+
const ptr = this.__wbg_ptr;
|
|
1487
|
+
this.__wbg_ptr = 0;
|
|
1488
|
+
ElGamalPubkeyFinalization.unregister(this);
|
|
1489
|
+
return ptr;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
free() {
|
|
1493
|
+
const ptr = this.__destroy_into_raw();
|
|
1494
|
+
wasm.__wbg_elgamalpubkey_free(ptr, 0);
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* @param {bigint} amount
|
|
1498
|
+
* @returns {ElGamalCiphertext}
|
|
1499
|
+
*/
|
|
1500
|
+
encryptU64(amount) {
|
|
1501
|
+
const ret = wasm.elgamalpubkey_encryptU64(this.__wbg_ptr, amount);
|
|
1502
|
+
return ElGamalCiphertext.__wrap(ret);
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* @param {bigint} amount
|
|
1506
|
+
* @param {PedersenOpening} opening
|
|
1507
|
+
* @returns {ElGamalCiphertext}
|
|
1508
|
+
*/
|
|
1509
|
+
encryptWithU64(amount, opening) {
|
|
1510
|
+
_assertClass(opening, PedersenOpening);
|
|
1511
|
+
const ret = wasm.elgamalpubkey_encryptWithU64(this.__wbg_ptr, amount, opening.__wbg_ptr);
|
|
1512
|
+
return ElGamalCiphertext.__wrap(ret);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
module.exports.ElGamalPubkey = ElGamalPubkey;
|
|
1516
|
+
|
|
1517
|
+
const GroupedCiphertext2HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1518
|
+
? { register: () => {}, unregister: () => {} }
|
|
1519
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedciphertext2handlesvalidityproof_free(ptr >>> 0, 1));
|
|
1520
|
+
/**
|
|
1521
|
+
* The grouped ciphertext validity proof for 2 handles.
|
|
1522
|
+
*
|
|
1523
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
1524
|
+
*/
|
|
1525
|
+
class GroupedCiphertext2HandlesValidityProof {
|
|
1526
|
+
|
|
1527
|
+
__destroy_into_raw() {
|
|
1528
|
+
const ptr = this.__wbg_ptr;
|
|
1529
|
+
this.__wbg_ptr = 0;
|
|
1530
|
+
GroupedCiphertext2HandlesValidityProofFinalization.unregister(this);
|
|
1531
|
+
return ptr;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
free() {
|
|
1535
|
+
const ptr = this.__destroy_into_raw();
|
|
1536
|
+
wasm.__wbg_groupedciphertext2handlesvalidityproof_free(ptr, 0);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
module.exports.GroupedCiphertext2HandlesValidityProof = GroupedCiphertext2HandlesValidityProof;
|
|
1540
|
+
|
|
1541
|
+
const GroupedCiphertext2HandlesValidityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1542
|
+
? { register: () => {}, unregister: () => {} }
|
|
1543
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedciphertext2handlesvalidityproofcontext_free(ptr >>> 0, 1));
|
|
1544
|
+
|
|
1545
|
+
class GroupedCiphertext2HandlesValidityProofContext {
|
|
1546
|
+
|
|
1547
|
+
static __wrap(ptr) {
|
|
1548
|
+
ptr = ptr >>> 0;
|
|
1549
|
+
const obj = Object.create(GroupedCiphertext2HandlesValidityProofContext.prototype);
|
|
1550
|
+
obj.__wbg_ptr = ptr;
|
|
1551
|
+
GroupedCiphertext2HandlesValidityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1552
|
+
return obj;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
__destroy_into_raw() {
|
|
1556
|
+
const ptr = this.__wbg_ptr;
|
|
1557
|
+
this.__wbg_ptr = 0;
|
|
1558
|
+
GroupedCiphertext2HandlesValidityProofContextFinalization.unregister(this);
|
|
1559
|
+
return ptr;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
free() {
|
|
1563
|
+
const ptr = this.__destroy_into_raw();
|
|
1564
|
+
wasm.__wbg_groupedciphertext2handlesvalidityproofcontext_free(ptr, 0);
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* @returns {PodElGamalPubkey}
|
|
1568
|
+
*/
|
|
1569
|
+
get first_pubkey() {
|
|
1570
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
1571
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* @param {PodElGamalPubkey} arg0
|
|
1575
|
+
*/
|
|
1576
|
+
set first_pubkey(arg0) {
|
|
1577
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
1578
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1579
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* @returns {PodElGamalPubkey}
|
|
1583
|
+
*/
|
|
1584
|
+
get second_pubkey() {
|
|
1585
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr);
|
|
1586
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* @param {PodElGamalPubkey} arg0
|
|
1590
|
+
*/
|
|
1591
|
+
set second_pubkey(arg0) {
|
|
1592
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
1593
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1594
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr, ptr0);
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* @returns {PodGroupedElGamalCiphertext2Handles}
|
|
1598
|
+
*/
|
|
1599
|
+
get grouped_ciphertext() {
|
|
1600
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr);
|
|
1601
|
+
return PodGroupedElGamalCiphertext2Handles.__wrap(ret);
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* @param {PodGroupedElGamalCiphertext2Handles} arg0
|
|
1605
|
+
*/
|
|
1606
|
+
set grouped_ciphertext(arg0) {
|
|
1607
|
+
_assertClass(arg0, PodGroupedElGamalCiphertext2Handles);
|
|
1608
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1609
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr, ptr0);
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* @returns {Uint8Array}
|
|
1613
|
+
*/
|
|
1614
|
+
toBytes() {
|
|
1615
|
+
const ret = wasm.groupedciphertext2handlesvalidityproofcontext_toBytes(this.__wbg_ptr);
|
|
1616
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1617
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1618
|
+
return v1;
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* @param {Uint8Array} bytes
|
|
1622
|
+
* @returns {GroupedCiphertext2HandlesValidityProofContext}
|
|
1623
|
+
*/
|
|
1624
|
+
static fromBytes(bytes) {
|
|
1625
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1626
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1627
|
+
const ret = wasm.groupedciphertext2handlesvalidityproofcontext_fromBytes(ptr0, len0);
|
|
1628
|
+
if (ret[2]) {
|
|
1629
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1630
|
+
}
|
|
1631
|
+
return GroupedCiphertext2HandlesValidityProofContext.__wrap(ret[0]);
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
module.exports.GroupedCiphertext2HandlesValidityProofContext = GroupedCiphertext2HandlesValidityProofContext;
|
|
1635
|
+
|
|
1636
|
+
const GroupedCiphertext2HandlesValidityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1637
|
+
? { register: () => {}, unregister: () => {} }
|
|
1638
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedciphertext2handlesvalidityproofdata_free(ptr >>> 0, 1));
|
|
1639
|
+
/**
|
|
1640
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyGroupedCiphertextValidity`
|
|
1641
|
+
* instruction.
|
|
1642
|
+
*
|
|
1643
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
1644
|
+
* the proof.
|
|
1645
|
+
*/
|
|
1646
|
+
class GroupedCiphertext2HandlesValidityProofData {
|
|
1647
|
+
|
|
1648
|
+
static __wrap(ptr) {
|
|
1649
|
+
ptr = ptr >>> 0;
|
|
1650
|
+
const obj = Object.create(GroupedCiphertext2HandlesValidityProofData.prototype);
|
|
1651
|
+
obj.__wbg_ptr = ptr;
|
|
1652
|
+
GroupedCiphertext2HandlesValidityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1653
|
+
return obj;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
__destroy_into_raw() {
|
|
1657
|
+
const ptr = this.__wbg_ptr;
|
|
1658
|
+
this.__wbg_ptr = 0;
|
|
1659
|
+
GroupedCiphertext2HandlesValidityProofDataFinalization.unregister(this);
|
|
1660
|
+
return ptr;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
free() {
|
|
1664
|
+
const ptr = this.__destroy_into_raw();
|
|
1665
|
+
wasm.__wbg_groupedciphertext2handlesvalidityproofdata_free(ptr, 0);
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* @returns {GroupedCiphertext2HandlesValidityProofContext}
|
|
1669
|
+
*/
|
|
1670
|
+
get context() {
|
|
1671
|
+
const ret = wasm.__wbg_get_groupedciphertext2handlesvalidityproofdata_context(this.__wbg_ptr);
|
|
1672
|
+
return GroupedCiphertext2HandlesValidityProofContext.__wrap(ret);
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* @param {GroupedCiphertext2HandlesValidityProofContext} arg0
|
|
1676
|
+
*/
|
|
1677
|
+
set context(arg0) {
|
|
1678
|
+
_assertClass(arg0, GroupedCiphertext2HandlesValidityProofContext);
|
|
1679
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1680
|
+
wasm.__wbg_set_groupedciphertext2handlesvalidityproofdata_context(this.__wbg_ptr, ptr0);
|
|
1681
|
+
}
|
|
1682
|
+
/**
|
|
1683
|
+
* @returns {PodGroupedCiphertext2HandlesValidityProof}
|
|
1684
|
+
*/
|
|
1685
|
+
get proof() {
|
|
1686
|
+
const ret = wasm.__wbg_get_groupedciphertext2handlesvalidityproofdata_proof(this.__wbg_ptr);
|
|
1687
|
+
return PodGroupedCiphertext2HandlesValidityProof.__wrap(ret);
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* @param {PodGroupedCiphertext2HandlesValidityProof} arg0
|
|
1691
|
+
*/
|
|
1692
|
+
set proof(arg0) {
|
|
1693
|
+
_assertClass(arg0, PodGroupedCiphertext2HandlesValidityProof);
|
|
1694
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1695
|
+
wasm.__wbg_set_groupedciphertext2handlesvalidityproofdata_proof(this.__wbg_ptr, ptr0);
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
1699
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
1700
|
+
* @param {GroupedElGamalCiphertext2Handles} grouped_ciphertext
|
|
1701
|
+
* @param {bigint} amount
|
|
1702
|
+
* @param {PedersenOpening} opening
|
|
1703
|
+
* @returns {GroupedCiphertext2HandlesValidityProofData}
|
|
1704
|
+
*/
|
|
1705
|
+
static new(first_pubkey, second_pubkey, grouped_ciphertext, amount, opening) {
|
|
1706
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
1707
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
1708
|
+
_assertClass(grouped_ciphertext, GroupedElGamalCiphertext2Handles);
|
|
1709
|
+
_assertClass(opening, PedersenOpening);
|
|
1710
|
+
const ret = wasm.groupedciphertext2handlesvalidityproofdata_new(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, grouped_ciphertext.__wbg_ptr, amount, opening.__wbg_ptr);
|
|
1711
|
+
if (ret[2]) {
|
|
1712
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1713
|
+
}
|
|
1714
|
+
return GroupedCiphertext2HandlesValidityProofData.__wrap(ret[0]);
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* @returns {Uint8Array}
|
|
1718
|
+
*/
|
|
1719
|
+
toBytes() {
|
|
1720
|
+
const ret = wasm.groupedciphertext2handlesvalidityproofdata_toBytes(this.__wbg_ptr);
|
|
1721
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1722
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1723
|
+
return v1;
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* @param {Uint8Array} bytes
|
|
1727
|
+
* @returns {GroupedCiphertext2HandlesValidityProofData}
|
|
1728
|
+
*/
|
|
1729
|
+
static fromBytes(bytes) {
|
|
1730
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1731
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1732
|
+
const ret = wasm.groupedciphertext2handlesvalidityproofdata_fromBytes(ptr0, len0);
|
|
1733
|
+
if (ret[2]) {
|
|
1734
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1735
|
+
}
|
|
1736
|
+
return GroupedCiphertext2HandlesValidityProofData.__wrap(ret[0]);
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
module.exports.GroupedCiphertext2HandlesValidityProofData = GroupedCiphertext2HandlesValidityProofData;
|
|
1740
|
+
|
|
1741
|
+
const GroupedCiphertext3HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1742
|
+
? { register: () => {}, unregister: () => {} }
|
|
1743
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedciphertext3handlesvalidityproof_free(ptr >>> 0, 1));
|
|
1744
|
+
/**
|
|
1745
|
+
* The grouped ciphertext validity proof for 3 handles.
|
|
1746
|
+
*
|
|
1747
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
1748
|
+
*/
|
|
1749
|
+
class GroupedCiphertext3HandlesValidityProof {
|
|
1750
|
+
|
|
1751
|
+
__destroy_into_raw() {
|
|
1752
|
+
const ptr = this.__wbg_ptr;
|
|
1753
|
+
this.__wbg_ptr = 0;
|
|
1754
|
+
GroupedCiphertext3HandlesValidityProofFinalization.unregister(this);
|
|
1755
|
+
return ptr;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
free() {
|
|
1759
|
+
const ptr = this.__destroy_into_raw();
|
|
1760
|
+
wasm.__wbg_groupedciphertext3handlesvalidityproof_free(ptr, 0);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
module.exports.GroupedCiphertext3HandlesValidityProof = GroupedCiphertext3HandlesValidityProof;
|
|
1764
|
+
|
|
1765
|
+
const GroupedCiphertext3HandlesValidityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1766
|
+
? { register: () => {}, unregister: () => {} }
|
|
1767
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedciphertext3handlesvalidityproofcontext_free(ptr >>> 0, 1));
|
|
1768
|
+
|
|
1769
|
+
class GroupedCiphertext3HandlesValidityProofContext {
|
|
1770
|
+
|
|
1771
|
+
static __wrap(ptr) {
|
|
1772
|
+
ptr = ptr >>> 0;
|
|
1773
|
+
const obj = Object.create(GroupedCiphertext3HandlesValidityProofContext.prototype);
|
|
1774
|
+
obj.__wbg_ptr = ptr;
|
|
1775
|
+
GroupedCiphertext3HandlesValidityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1776
|
+
return obj;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
__destroy_into_raw() {
|
|
1780
|
+
const ptr = this.__wbg_ptr;
|
|
1781
|
+
this.__wbg_ptr = 0;
|
|
1782
|
+
GroupedCiphertext3HandlesValidityProofContextFinalization.unregister(this);
|
|
1783
|
+
return ptr;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
free() {
|
|
1787
|
+
const ptr = this.__destroy_into_raw();
|
|
1788
|
+
wasm.__wbg_groupedciphertext3handlesvalidityproofcontext_free(ptr, 0);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* @returns {PodElGamalPubkey}
|
|
1792
|
+
*/
|
|
1793
|
+
get first_pubkey() {
|
|
1794
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
1795
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* @param {PodElGamalPubkey} arg0
|
|
1799
|
+
*/
|
|
1800
|
+
set first_pubkey(arg0) {
|
|
1801
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
1802
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1803
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* @returns {PodElGamalPubkey}
|
|
1807
|
+
*/
|
|
1808
|
+
get second_pubkey() {
|
|
1809
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr);
|
|
1810
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* @param {PodElGamalPubkey} arg0
|
|
1814
|
+
*/
|
|
1815
|
+
set second_pubkey(arg0) {
|
|
1816
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
1817
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1818
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr, ptr0);
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* @returns {PodElGamalPubkey}
|
|
1822
|
+
*/
|
|
1823
|
+
get third_pubkey() {
|
|
1824
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofcontext_third_pubkey(this.__wbg_ptr);
|
|
1825
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* @param {PodElGamalPubkey} arg0
|
|
1829
|
+
*/
|
|
1830
|
+
set third_pubkey(arg0) {
|
|
1831
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
1832
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1833
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofcontext_third_pubkey(this.__wbg_ptr, ptr0);
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* @returns {PodGroupedElGamalCiphertext3Handles}
|
|
1837
|
+
*/
|
|
1838
|
+
get grouped_ciphertext() {
|
|
1839
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr);
|
|
1840
|
+
return PodGroupedElGamalCiphertext3Handles.__wrap(ret);
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* @param {PodGroupedElGamalCiphertext3Handles} arg0
|
|
1844
|
+
*/
|
|
1845
|
+
set grouped_ciphertext(arg0) {
|
|
1846
|
+
_assertClass(arg0, PodGroupedElGamalCiphertext3Handles);
|
|
1847
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1848
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofcontext_grouped_ciphertext_lo(this.__wbg_ptr, ptr0);
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* @returns {Uint8Array}
|
|
1852
|
+
*/
|
|
1853
|
+
toBytes() {
|
|
1854
|
+
const ret = wasm.groupedciphertext3handlesvalidityproofcontext_toBytes(this.__wbg_ptr);
|
|
1855
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1856
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1857
|
+
return v1;
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* @param {Uint8Array} bytes
|
|
1861
|
+
* @returns {GroupedCiphertext3HandlesValidityProofContext}
|
|
1862
|
+
*/
|
|
1863
|
+
static fromBytes(bytes) {
|
|
1864
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1865
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1866
|
+
const ret = wasm.groupedciphertext3handlesvalidityproofcontext_fromBytes(ptr0, len0);
|
|
1867
|
+
if (ret[2]) {
|
|
1868
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1869
|
+
}
|
|
1870
|
+
return GroupedCiphertext3HandlesValidityProofContext.__wrap(ret[0]);
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
module.exports.GroupedCiphertext3HandlesValidityProofContext = GroupedCiphertext3HandlesValidityProofContext;
|
|
1874
|
+
|
|
1875
|
+
const GroupedCiphertext3HandlesValidityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1876
|
+
? { register: () => {}, unregister: () => {} }
|
|
1877
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedciphertext3handlesvalidityproofdata_free(ptr >>> 0, 1));
|
|
1878
|
+
/**
|
|
1879
|
+
* The instruction data that is needed for the
|
|
1880
|
+
* `ProofInstruction::VerifyGroupedCiphertext3HandlesValidity` instruction.
|
|
1881
|
+
*
|
|
1882
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
1883
|
+
* the proof.
|
|
1884
|
+
*/
|
|
1885
|
+
class GroupedCiphertext3HandlesValidityProofData {
|
|
1886
|
+
|
|
1887
|
+
static __wrap(ptr) {
|
|
1888
|
+
ptr = ptr >>> 0;
|
|
1889
|
+
const obj = Object.create(GroupedCiphertext3HandlesValidityProofData.prototype);
|
|
1890
|
+
obj.__wbg_ptr = ptr;
|
|
1891
|
+
GroupedCiphertext3HandlesValidityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1892
|
+
return obj;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
__destroy_into_raw() {
|
|
1896
|
+
const ptr = this.__wbg_ptr;
|
|
1897
|
+
this.__wbg_ptr = 0;
|
|
1898
|
+
GroupedCiphertext3HandlesValidityProofDataFinalization.unregister(this);
|
|
1899
|
+
return ptr;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
free() {
|
|
1903
|
+
const ptr = this.__destroy_into_raw();
|
|
1904
|
+
wasm.__wbg_groupedciphertext3handlesvalidityproofdata_free(ptr, 0);
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* @returns {GroupedCiphertext3HandlesValidityProofContext}
|
|
1908
|
+
*/
|
|
1909
|
+
get context() {
|
|
1910
|
+
const ret = wasm.__wbg_get_groupedciphertext3handlesvalidityproofdata_context(this.__wbg_ptr);
|
|
1911
|
+
return GroupedCiphertext3HandlesValidityProofContext.__wrap(ret);
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* @param {GroupedCiphertext3HandlesValidityProofContext} arg0
|
|
1915
|
+
*/
|
|
1916
|
+
set context(arg0) {
|
|
1917
|
+
_assertClass(arg0, GroupedCiphertext3HandlesValidityProofContext);
|
|
1918
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1919
|
+
wasm.__wbg_set_groupedciphertext3handlesvalidityproofdata_context(this.__wbg_ptr, ptr0);
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* @returns {PodGroupedCiphertext3HandlesValidityProof}
|
|
1923
|
+
*/
|
|
1924
|
+
get proof() {
|
|
1925
|
+
const ret = wasm.__wbg_get_groupedciphertext3handlesvalidityproofdata_proof(this.__wbg_ptr);
|
|
1926
|
+
return PodGroupedCiphertext3HandlesValidityProof.__wrap(ret);
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* @param {PodGroupedCiphertext3HandlesValidityProof} arg0
|
|
1930
|
+
*/
|
|
1931
|
+
set proof(arg0) {
|
|
1932
|
+
_assertClass(arg0, PodGroupedCiphertext3HandlesValidityProof);
|
|
1933
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1934
|
+
wasm.__wbg_set_groupedciphertext3handlesvalidityproofdata_proof(this.__wbg_ptr, ptr0);
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
1938
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
1939
|
+
* @param {ElGamalPubkey} third_pubkey
|
|
1940
|
+
* @param {GroupedElGamalCiphertext3Handles} grouped_ciphertext
|
|
1941
|
+
* @param {bigint} amount
|
|
1942
|
+
* @param {PedersenOpening} opening
|
|
1943
|
+
* @returns {GroupedCiphertext3HandlesValidityProofData}
|
|
1944
|
+
*/
|
|
1945
|
+
static new(first_pubkey, second_pubkey, third_pubkey, grouped_ciphertext, amount, opening) {
|
|
1946
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
1947
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
1948
|
+
_assertClass(third_pubkey, ElGamalPubkey);
|
|
1949
|
+
_assertClass(grouped_ciphertext, GroupedElGamalCiphertext3Handles);
|
|
1950
|
+
_assertClass(opening, PedersenOpening);
|
|
1951
|
+
const ret = wasm.groupedciphertext3handlesvalidityproofdata_new(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, third_pubkey.__wbg_ptr, grouped_ciphertext.__wbg_ptr, amount, opening.__wbg_ptr);
|
|
1952
|
+
if (ret[2]) {
|
|
1953
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1954
|
+
}
|
|
1955
|
+
return GroupedCiphertext3HandlesValidityProofData.__wrap(ret[0]);
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* @returns {Uint8Array}
|
|
1959
|
+
*/
|
|
1960
|
+
toBytes() {
|
|
1961
|
+
const ret = wasm.groupedciphertext3handlesvalidityproofdata_toBytes(this.__wbg_ptr);
|
|
1962
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1963
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1964
|
+
return v1;
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* @param {Uint8Array} bytes
|
|
1968
|
+
* @returns {GroupedCiphertext3HandlesValidityProofData}
|
|
1969
|
+
*/
|
|
1970
|
+
static fromBytes(bytes) {
|
|
1971
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1972
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1973
|
+
const ret = wasm.groupedciphertext3handlesvalidityproofdata_fromBytes(ptr0, len0);
|
|
1974
|
+
if (ret[2]) {
|
|
1975
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1976
|
+
}
|
|
1977
|
+
return GroupedCiphertext3HandlesValidityProofData.__wrap(ret[0]);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
module.exports.GroupedCiphertext3HandlesValidityProofData = GroupedCiphertext3HandlesValidityProofData;
|
|
1981
|
+
|
|
1982
|
+
const GroupedElGamalCiphertext2HandlesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1983
|
+
? { register: () => {}, unregister: () => {} }
|
|
1984
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedelgamalciphertext2handles_free(ptr >>> 0, 1));
|
|
1985
|
+
|
|
1986
|
+
class GroupedElGamalCiphertext2Handles {
|
|
1987
|
+
|
|
1988
|
+
static __wrap(ptr) {
|
|
1989
|
+
ptr = ptr >>> 0;
|
|
1990
|
+
const obj = Object.create(GroupedElGamalCiphertext2Handles.prototype);
|
|
1991
|
+
obj.__wbg_ptr = ptr;
|
|
1992
|
+
GroupedElGamalCiphertext2HandlesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1993
|
+
return obj;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
__destroy_into_raw() {
|
|
1997
|
+
const ptr = this.__wbg_ptr;
|
|
1998
|
+
this.__wbg_ptr = 0;
|
|
1999
|
+
GroupedElGamalCiphertext2HandlesFinalization.unregister(this);
|
|
2000
|
+
return ptr;
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
free() {
|
|
2004
|
+
const ptr = this.__destroy_into_raw();
|
|
2005
|
+
wasm.__wbg_groupedelgamalciphertext2handles_free(ptr, 0);
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
2009
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
2010
|
+
* @param {bigint} amount
|
|
2011
|
+
* @returns {GroupedElGamalCiphertext2Handles}
|
|
2012
|
+
*/
|
|
2013
|
+
static encryptU64(first_pubkey, second_pubkey, amount) {
|
|
2014
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
2015
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
2016
|
+
const ret = wasm.groupedelgamalciphertext2handles_encryptU64(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, amount);
|
|
2017
|
+
return GroupedElGamalCiphertext2Handles.__wrap(ret);
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
2021
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
2022
|
+
* @param {bigint} amount
|
|
2023
|
+
* @param {PedersenOpening} opening
|
|
2024
|
+
* @returns {GroupedElGamalCiphertext2Handles}
|
|
2025
|
+
*/
|
|
2026
|
+
static encryptWithU64(first_pubkey, second_pubkey, amount, opening) {
|
|
2027
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
2028
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
2029
|
+
_assertClass(opening, PedersenOpening);
|
|
2030
|
+
const ret = wasm.groupedelgamalciphertext2handles_encryptWithU64(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, amount, opening.__wbg_ptr);
|
|
2031
|
+
return GroupedElGamalCiphertext2Handles.__wrap(ret);
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
module.exports.GroupedElGamalCiphertext2Handles = GroupedElGamalCiphertext2Handles;
|
|
2035
|
+
|
|
2036
|
+
const GroupedElGamalCiphertext3HandlesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2037
|
+
? { register: () => {}, unregister: () => {} }
|
|
2038
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groupedelgamalciphertext3handles_free(ptr >>> 0, 1));
|
|
2039
|
+
|
|
2040
|
+
class GroupedElGamalCiphertext3Handles {
|
|
2041
|
+
|
|
2042
|
+
static __wrap(ptr) {
|
|
2043
|
+
ptr = ptr >>> 0;
|
|
2044
|
+
const obj = Object.create(GroupedElGamalCiphertext3Handles.prototype);
|
|
2045
|
+
obj.__wbg_ptr = ptr;
|
|
2046
|
+
GroupedElGamalCiphertext3HandlesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2047
|
+
return obj;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
__destroy_into_raw() {
|
|
2051
|
+
const ptr = this.__wbg_ptr;
|
|
2052
|
+
this.__wbg_ptr = 0;
|
|
2053
|
+
GroupedElGamalCiphertext3HandlesFinalization.unregister(this);
|
|
2054
|
+
return ptr;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
free() {
|
|
2058
|
+
const ptr = this.__destroy_into_raw();
|
|
2059
|
+
wasm.__wbg_groupedelgamalciphertext3handles_free(ptr, 0);
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
2063
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
2064
|
+
* @param {ElGamalPubkey} third_pubkey
|
|
2065
|
+
* @param {bigint} amount
|
|
2066
|
+
* @returns {GroupedElGamalCiphertext3Handles}
|
|
2067
|
+
*/
|
|
2068
|
+
static encryptU64(first_pubkey, second_pubkey, third_pubkey, amount) {
|
|
2069
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
2070
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
2071
|
+
_assertClass(third_pubkey, ElGamalPubkey);
|
|
2072
|
+
const ret = wasm.groupedelgamalciphertext3handles_encryptU64(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, third_pubkey.__wbg_ptr, amount);
|
|
2073
|
+
return GroupedElGamalCiphertext3Handles.__wrap(ret);
|
|
2074
|
+
}
|
|
2075
|
+
/**
|
|
2076
|
+
* @param {ElGamalPubkey} first_pubkey
|
|
2077
|
+
* @param {ElGamalPubkey} second_pubkey
|
|
2078
|
+
* @param {ElGamalPubkey} third_pubkey
|
|
2079
|
+
* @param {bigint} amount
|
|
2080
|
+
* @param {PedersenOpening} opening
|
|
2081
|
+
* @returns {GroupedElGamalCiphertext3Handles}
|
|
2082
|
+
*/
|
|
2083
|
+
static encryptWithU64(first_pubkey, second_pubkey, third_pubkey, amount, opening) {
|
|
2084
|
+
_assertClass(first_pubkey, ElGamalPubkey);
|
|
2085
|
+
_assertClass(second_pubkey, ElGamalPubkey);
|
|
2086
|
+
_assertClass(third_pubkey, ElGamalPubkey);
|
|
2087
|
+
_assertClass(opening, PedersenOpening);
|
|
2088
|
+
const ret = wasm.groupedelgamalciphertext3handles_encryptWithU64(first_pubkey.__wbg_ptr, second_pubkey.__wbg_ptr, third_pubkey.__wbg_ptr, amount, opening.__wbg_ptr);
|
|
2089
|
+
return GroupedElGamalCiphertext3Handles.__wrap(ret);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
module.exports.GroupedElGamalCiphertext3Handles = GroupedElGamalCiphertext3Handles;
|
|
2093
|
+
|
|
2094
|
+
const PedersenFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2095
|
+
? { register: () => {}, unregister: () => {} }
|
|
2096
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pedersen_free(ptr >>> 0, 1));
|
|
2097
|
+
/**
|
|
2098
|
+
* Algorithm handle for the Pedersen commitment scheme.
|
|
2099
|
+
*/
|
|
2100
|
+
class Pedersen {
|
|
2101
|
+
|
|
2102
|
+
__destroy_into_raw() {
|
|
2103
|
+
const ptr = this.__wbg_ptr;
|
|
2104
|
+
this.__wbg_ptr = 0;
|
|
2105
|
+
PedersenFinalization.unregister(this);
|
|
2106
|
+
return ptr;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
free() {
|
|
2110
|
+
const ptr = this.__destroy_into_raw();
|
|
2111
|
+
wasm.__wbg_pedersen_free(ptr, 0);
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* @param {bigint} amount
|
|
2115
|
+
* @param {PedersenOpening} opening
|
|
2116
|
+
* @returns {PedersenCommitment}
|
|
2117
|
+
*/
|
|
2118
|
+
static withU64(amount, opening) {
|
|
2119
|
+
_assertClass(opening, PedersenOpening);
|
|
2120
|
+
const ret = wasm.pedersen_withU64(amount, opening.__wbg_ptr);
|
|
2121
|
+
return PedersenCommitment.__wrap(ret);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
module.exports.Pedersen = Pedersen;
|
|
2125
|
+
|
|
2126
|
+
const PedersenCommitmentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2127
|
+
? { register: () => {}, unregister: () => {} }
|
|
2128
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pedersencommitment_free(ptr >>> 0, 1));
|
|
2129
|
+
/**
|
|
2130
|
+
* Pedersen commitment type.
|
|
2131
|
+
*/
|
|
2132
|
+
class PedersenCommitment {
|
|
2133
|
+
|
|
2134
|
+
static __wrap(ptr) {
|
|
2135
|
+
ptr = ptr >>> 0;
|
|
2136
|
+
const obj = Object.create(PedersenCommitment.prototype);
|
|
2137
|
+
obj.__wbg_ptr = ptr;
|
|
2138
|
+
PedersenCommitmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2139
|
+
return obj;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
__destroy_into_raw() {
|
|
2143
|
+
const ptr = this.__wbg_ptr;
|
|
2144
|
+
this.__wbg_ptr = 0;
|
|
2145
|
+
PedersenCommitmentFinalization.unregister(this);
|
|
2146
|
+
return ptr;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
free() {
|
|
2150
|
+
const ptr = this.__destroy_into_raw();
|
|
2151
|
+
wasm.__wbg_pedersencommitment_free(ptr, 0);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
module.exports.PedersenCommitment = PedersenCommitment;
|
|
2155
|
+
|
|
2156
|
+
const PedersenOpeningFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2157
|
+
? { register: () => {}, unregister: () => {} }
|
|
2158
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pedersenopening_free(ptr >>> 0, 1));
|
|
2159
|
+
/**
|
|
2160
|
+
* Pedersen opening type.
|
|
2161
|
+
*
|
|
2162
|
+
* Instances of Pedersen openings are zeroized on drop.
|
|
2163
|
+
*/
|
|
2164
|
+
class PedersenOpening {
|
|
2165
|
+
|
|
2166
|
+
static __wrap(ptr) {
|
|
2167
|
+
ptr = ptr >>> 0;
|
|
2168
|
+
const obj = Object.create(PedersenOpening.prototype);
|
|
2169
|
+
obj.__wbg_ptr = ptr;
|
|
2170
|
+
PedersenOpeningFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2171
|
+
return obj;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
__destroy_into_raw() {
|
|
2175
|
+
const ptr = this.__wbg_ptr;
|
|
2176
|
+
this.__wbg_ptr = 0;
|
|
2177
|
+
PedersenOpeningFinalization.unregister(this);
|
|
2178
|
+
return ptr;
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
free() {
|
|
2182
|
+
const ptr = this.__destroy_into_raw();
|
|
2183
|
+
wasm.__wbg_pedersenopening_free(ptr, 0);
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* @returns {PedersenOpening}
|
|
2187
|
+
*/
|
|
2188
|
+
static newRand() {
|
|
2189
|
+
const ret = wasm.pedersenopening_newRand();
|
|
2190
|
+
return PedersenOpening.__wrap(ret);
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
module.exports.PedersenOpening = PedersenOpening;
|
|
2194
|
+
|
|
2195
|
+
const PercentageWithCapProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2196
|
+
? { register: () => {}, unregister: () => {} }
|
|
2197
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_percentagewithcapproof_free(ptr >>> 0, 1));
|
|
2198
|
+
/**
|
|
2199
|
+
* Percentage-with-cap proof.
|
|
2200
|
+
*
|
|
2201
|
+
* The proof consists of two main components: `percentage_max_proof` and
|
|
2202
|
+
* `percentage_equality_proof`. If the committed amount is greater than the maximum cap value,
|
|
2203
|
+
* then the `percentage_max_proof` is properly generated and `percentage_equality_proof` is
|
|
2204
|
+
* simulated. If the committed amount is smaller than the maximum cap bound, the
|
|
2205
|
+
* `percentage_equality_proof` is properly generated and `percentage_max_proof` is simulated.
|
|
2206
|
+
*/
|
|
2207
|
+
class PercentageWithCapProof {
|
|
2208
|
+
|
|
2209
|
+
__destroy_into_raw() {
|
|
2210
|
+
const ptr = this.__wbg_ptr;
|
|
2211
|
+
this.__wbg_ptr = 0;
|
|
2212
|
+
PercentageWithCapProofFinalization.unregister(this);
|
|
2213
|
+
return ptr;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
free() {
|
|
2217
|
+
const ptr = this.__destroy_into_raw();
|
|
2218
|
+
wasm.__wbg_percentagewithcapproof_free(ptr, 0);
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
module.exports.PercentageWithCapProof = PercentageWithCapProof;
|
|
2222
|
+
|
|
2223
|
+
const PercentageWithCapProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2224
|
+
? { register: () => {}, unregister: () => {} }
|
|
2225
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_percentagewithcapproofcontext_free(ptr >>> 0, 1));
|
|
2226
|
+
/**
|
|
2227
|
+
* The context data needed to verify a percentage-with-cap proof.
|
|
2228
|
+
*
|
|
2229
|
+
* We refer to [`ZK ElGamal proof`] for the formal details on how the percentage-with-cap proof is
|
|
2230
|
+
* computed.
|
|
2231
|
+
*
|
|
2232
|
+
* [`ZK ElGamal proof`]: https://docs.solanalabs.com/runtime/zk-token-proof
|
|
2233
|
+
*/
|
|
2234
|
+
class PercentageWithCapProofContext {
|
|
2235
|
+
|
|
2236
|
+
static __wrap(ptr) {
|
|
2237
|
+
ptr = ptr >>> 0;
|
|
2238
|
+
const obj = Object.create(PercentageWithCapProofContext.prototype);
|
|
2239
|
+
obj.__wbg_ptr = ptr;
|
|
2240
|
+
PercentageWithCapProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2241
|
+
return obj;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
__destroy_into_raw() {
|
|
2245
|
+
const ptr = this.__wbg_ptr;
|
|
2246
|
+
this.__wbg_ptr = 0;
|
|
2247
|
+
PercentageWithCapProofContextFinalization.unregister(this);
|
|
2248
|
+
return ptr;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
free() {
|
|
2252
|
+
const ptr = this.__destroy_into_raw();
|
|
2253
|
+
wasm.__wbg_percentagewithcapproofcontext_free(ptr, 0);
|
|
2254
|
+
}
|
|
2255
|
+
/**
|
|
2256
|
+
* The Pedersen commitment to the percentage amount.
|
|
2257
|
+
* @returns {PodPedersenCommitment}
|
|
2258
|
+
*/
|
|
2259
|
+
get percentage_commitment() {
|
|
2260
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
2261
|
+
return PodPedersenCommitment.__wrap(ret);
|
|
2262
|
+
}
|
|
2263
|
+
/**
|
|
2264
|
+
* The Pedersen commitment to the percentage amount.
|
|
2265
|
+
* @param {PodPedersenCommitment} arg0
|
|
2266
|
+
*/
|
|
2267
|
+
set percentage_commitment(arg0) {
|
|
2268
|
+
_assertClass(arg0, PodPedersenCommitment);
|
|
2269
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2270
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* The Pedersen commitment to the delta amount.
|
|
2274
|
+
* @returns {PodPedersenCommitment}
|
|
2275
|
+
*/
|
|
2276
|
+
get delta_commitment() {
|
|
2277
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr);
|
|
2278
|
+
return PodPedersenCommitment.__wrap(ret);
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* The Pedersen commitment to the delta amount.
|
|
2282
|
+
* @param {PodPedersenCommitment} arg0
|
|
2283
|
+
*/
|
|
2284
|
+
set delta_commitment(arg0) {
|
|
2285
|
+
_assertClass(arg0, PodPedersenCommitment);
|
|
2286
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2287
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_second_pubkey(this.__wbg_ptr, ptr0);
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* The Pedersen commitment to the claimed amount.
|
|
2291
|
+
* @returns {PodPedersenCommitment}
|
|
2292
|
+
*/
|
|
2293
|
+
get claimed_commitment() {
|
|
2294
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext3handlesvalidityproofcontext_third_pubkey(this.__wbg_ptr);
|
|
2295
|
+
return PodPedersenCommitment.__wrap(ret);
|
|
2296
|
+
}
|
|
2297
|
+
/**
|
|
2298
|
+
* The Pedersen commitment to the claimed amount.
|
|
2299
|
+
* @param {PodPedersenCommitment} arg0
|
|
2300
|
+
*/
|
|
2301
|
+
set claimed_commitment(arg0) {
|
|
2302
|
+
_assertClass(arg0, PodPedersenCommitment);
|
|
2303
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2304
|
+
wasm.__wbg_set_batchedgroupedciphertext3handlesvalidityproofcontext_third_pubkey(this.__wbg_ptr, ptr0);
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* The maximum cap bound.
|
|
2308
|
+
* @returns {PodU64}
|
|
2309
|
+
*/
|
|
2310
|
+
get max_value() {
|
|
2311
|
+
const ret = wasm.__wbg_get_percentagewithcapproofcontext_max_value(this.__wbg_ptr);
|
|
2312
|
+
return PodU64.__wrap(ret);
|
|
2313
|
+
}
|
|
2314
|
+
/**
|
|
2315
|
+
* The maximum cap bound.
|
|
2316
|
+
* @param {PodU64} arg0
|
|
2317
|
+
*/
|
|
2318
|
+
set max_value(arg0) {
|
|
2319
|
+
_assertClass(arg0, PodU64);
|
|
2320
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2321
|
+
wasm.__wbg_set_percentagewithcapproofcontext_max_value(this.__wbg_ptr, ptr0);
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* @returns {Uint8Array}
|
|
2325
|
+
*/
|
|
2326
|
+
toBytes() {
|
|
2327
|
+
const ret = wasm.percentagewithcapproofcontext_toBytes(this.__wbg_ptr);
|
|
2328
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2329
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2330
|
+
return v1;
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* @param {Uint8Array} bytes
|
|
2334
|
+
* @returns {PercentageWithCapProofContext}
|
|
2335
|
+
*/
|
|
2336
|
+
static fromBytes(bytes) {
|
|
2337
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
2338
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2339
|
+
const ret = wasm.percentagewithcapproofcontext_fromBytes(ptr0, len0);
|
|
2340
|
+
if (ret[2]) {
|
|
2341
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2342
|
+
}
|
|
2343
|
+
return PercentageWithCapProofContext.__wrap(ret[0]);
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
module.exports.PercentageWithCapProofContext = PercentageWithCapProofContext;
|
|
2347
|
+
|
|
2348
|
+
const PercentageWithCapProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2349
|
+
? { register: () => {}, unregister: () => {} }
|
|
2350
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_percentagewithcapproofdata_free(ptr >>> 0, 1));
|
|
2351
|
+
/**
|
|
2352
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyPercentageWithCap`
|
|
2353
|
+
* instruction.
|
|
2354
|
+
*
|
|
2355
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
2356
|
+
* the proof.
|
|
2357
|
+
*/
|
|
2358
|
+
class PercentageWithCapProofData {
|
|
2359
|
+
|
|
2360
|
+
static __wrap(ptr) {
|
|
2361
|
+
ptr = ptr >>> 0;
|
|
2362
|
+
const obj = Object.create(PercentageWithCapProofData.prototype);
|
|
2363
|
+
obj.__wbg_ptr = ptr;
|
|
2364
|
+
PercentageWithCapProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2365
|
+
return obj;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
__destroy_into_raw() {
|
|
2369
|
+
const ptr = this.__wbg_ptr;
|
|
2370
|
+
this.__wbg_ptr = 0;
|
|
2371
|
+
PercentageWithCapProofDataFinalization.unregister(this);
|
|
2372
|
+
return ptr;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
free() {
|
|
2376
|
+
const ptr = this.__destroy_into_raw();
|
|
2377
|
+
wasm.__wbg_percentagewithcapproofdata_free(ptr, 0);
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* @returns {PercentageWithCapProofContext}
|
|
2381
|
+
*/
|
|
2382
|
+
get context() {
|
|
2383
|
+
const ret = wasm.__wbg_get_percentagewithcapproofdata_context(this.__wbg_ptr);
|
|
2384
|
+
return PercentageWithCapProofContext.__wrap(ret);
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* @param {PercentageWithCapProofContext} arg0
|
|
2388
|
+
*/
|
|
2389
|
+
set context(arg0) {
|
|
2390
|
+
_assertClass(arg0, PercentageWithCapProofContext);
|
|
2391
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2392
|
+
wasm.__wbg_set_percentagewithcapproofdata_context(this.__wbg_ptr, ptr0);
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* @returns {PodPercentageWithCapProof}
|
|
2396
|
+
*/
|
|
2397
|
+
get proof() {
|
|
2398
|
+
const ret = wasm.__wbg_get_percentagewithcapproofdata_proof(this.__wbg_ptr);
|
|
2399
|
+
return PodPercentageWithCapProof.__wrap(ret);
|
|
2400
|
+
}
|
|
2401
|
+
/**
|
|
2402
|
+
* @param {PodPercentageWithCapProof} arg0
|
|
2403
|
+
*/
|
|
2404
|
+
set proof(arg0) {
|
|
2405
|
+
_assertClass(arg0, PodPercentageWithCapProof);
|
|
2406
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2407
|
+
wasm.__wbg_set_percentagewithcapproofdata_proof(this.__wbg_ptr, ptr0);
|
|
2408
|
+
}
|
|
2409
|
+
/**
|
|
2410
|
+
* @param {PedersenCommitment} percentage_commitment
|
|
2411
|
+
* @param {PedersenOpening} percentage_opening
|
|
2412
|
+
* @param {bigint} percentage_amount
|
|
2413
|
+
* @param {PedersenCommitment} delta_commitment
|
|
2414
|
+
* @param {PedersenOpening} delta_opening
|
|
2415
|
+
* @param {bigint} delta_amount
|
|
2416
|
+
* @param {PedersenCommitment} claimed_commitment
|
|
2417
|
+
* @param {PedersenOpening} claimed_opening
|
|
2418
|
+
* @param {bigint} max_value
|
|
2419
|
+
* @returns {PercentageWithCapProofData}
|
|
2420
|
+
*/
|
|
2421
|
+
static new(percentage_commitment, percentage_opening, percentage_amount, delta_commitment, delta_opening, delta_amount, claimed_commitment, claimed_opening, max_value) {
|
|
2422
|
+
_assertClass(percentage_commitment, PedersenCommitment);
|
|
2423
|
+
_assertClass(percentage_opening, PedersenOpening);
|
|
2424
|
+
_assertClass(delta_commitment, PedersenCommitment);
|
|
2425
|
+
_assertClass(delta_opening, PedersenOpening);
|
|
2426
|
+
_assertClass(claimed_commitment, PedersenCommitment);
|
|
2427
|
+
_assertClass(claimed_opening, PedersenOpening);
|
|
2428
|
+
const ret = wasm.percentagewithcapproofdata_new(percentage_commitment.__wbg_ptr, percentage_opening.__wbg_ptr, percentage_amount, delta_commitment.__wbg_ptr, delta_opening.__wbg_ptr, delta_amount, claimed_commitment.__wbg_ptr, claimed_opening.__wbg_ptr, max_value);
|
|
2429
|
+
if (ret[2]) {
|
|
2430
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2431
|
+
}
|
|
2432
|
+
return PercentageWithCapProofData.__wrap(ret[0]);
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* @returns {Uint8Array}
|
|
2436
|
+
*/
|
|
2437
|
+
toBytes() {
|
|
2438
|
+
const ret = wasm.percentagewithcapproofdata_toBytes(this.__wbg_ptr);
|
|
2439
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2440
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2441
|
+
return v1;
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* @param {Uint8Array} bytes
|
|
2445
|
+
* @returns {PercentageWithCapProofData}
|
|
2446
|
+
*/
|
|
2447
|
+
static fromBytes(bytes) {
|
|
2448
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
2449
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2450
|
+
const ret = wasm.percentagewithcapproofdata_fromBytes(ptr0, len0);
|
|
2451
|
+
if (ret[2]) {
|
|
2452
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2453
|
+
}
|
|
2454
|
+
return PercentageWithCapProofData.__wrap(ret[0]);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
module.exports.PercentageWithCapProofData = PercentageWithCapProofData;
|
|
2458
|
+
|
|
2459
|
+
const PodAeCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2460
|
+
? { register: () => {}, unregister: () => {} }
|
|
2461
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podaeciphertext_free(ptr >>> 0, 1));
|
|
2462
|
+
/**
|
|
2463
|
+
* The `AeCiphertext` type as a `Pod`.
|
|
2464
|
+
*/
|
|
2465
|
+
class PodAeCiphertext {
|
|
2466
|
+
|
|
2467
|
+
static __wrap(ptr) {
|
|
2468
|
+
ptr = ptr >>> 0;
|
|
2469
|
+
const obj = Object.create(PodAeCiphertext.prototype);
|
|
2470
|
+
obj.__wbg_ptr = ptr;
|
|
2471
|
+
PodAeCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2472
|
+
return obj;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
__destroy_into_raw() {
|
|
2476
|
+
const ptr = this.__wbg_ptr;
|
|
2477
|
+
this.__wbg_ptr = 0;
|
|
2478
|
+
PodAeCiphertextFinalization.unregister(this);
|
|
2479
|
+
return ptr;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
free() {
|
|
2483
|
+
const ptr = this.__destroy_into_raw();
|
|
2484
|
+
wasm.__wbg_podaeciphertext_free(ptr, 0);
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* @param {any} value
|
|
2488
|
+
*/
|
|
2489
|
+
constructor(value) {
|
|
2490
|
+
const ret = wasm.podaeciphertext_constructor(value);
|
|
2491
|
+
if (ret[2]) {
|
|
2492
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2493
|
+
}
|
|
2494
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
2495
|
+
PodAeCiphertextFinalization.register(this, this.__wbg_ptr, this);
|
|
2496
|
+
return this;
|
|
2497
|
+
}
|
|
2498
|
+
/**
|
|
2499
|
+
* @returns {string}
|
|
2500
|
+
*/
|
|
2501
|
+
toString() {
|
|
2502
|
+
let deferred1_0;
|
|
2503
|
+
let deferred1_1;
|
|
2504
|
+
try {
|
|
2505
|
+
const ret = wasm.podaeciphertext_toString(this.__wbg_ptr);
|
|
2506
|
+
deferred1_0 = ret[0];
|
|
2507
|
+
deferred1_1 = ret[1];
|
|
2508
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2509
|
+
} finally {
|
|
2510
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* @param {PodAeCiphertext} other
|
|
2515
|
+
* @returns {boolean}
|
|
2516
|
+
*/
|
|
2517
|
+
equals(other) {
|
|
2518
|
+
_assertClass(other, PodAeCiphertext);
|
|
2519
|
+
const ret = wasm.podaeciphertext_equals(this.__wbg_ptr, other.__wbg_ptr);
|
|
2520
|
+
return ret !== 0;
|
|
2521
|
+
}
|
|
2522
|
+
/**
|
|
2523
|
+
* @returns {Uint8Array}
|
|
2524
|
+
*/
|
|
2525
|
+
toBytes() {
|
|
2526
|
+
const ret = wasm.podaeciphertext_toBytes(this.__wbg_ptr);
|
|
2527
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2528
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2529
|
+
return v1;
|
|
2530
|
+
}
|
|
2531
|
+
/**
|
|
2532
|
+
* @returns {PodAeCiphertext}
|
|
2533
|
+
*/
|
|
2534
|
+
static zeroed() {
|
|
2535
|
+
const ret = wasm.podaeciphertext_zeroed();
|
|
2536
|
+
return PodAeCiphertext.__wrap(ret);
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* @param {AeCiphertext} decoded
|
|
2540
|
+
* @returns {PodAeCiphertext}
|
|
2541
|
+
*/
|
|
2542
|
+
static encode(decoded) {
|
|
2543
|
+
_assertClass(decoded, AeCiphertext);
|
|
2544
|
+
const ret = wasm.podaeciphertext_encode(decoded.__wbg_ptr);
|
|
2545
|
+
return PodAeCiphertext.__wrap(ret);
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* @returns {AeCiphertext}
|
|
2549
|
+
*/
|
|
2550
|
+
decode() {
|
|
2551
|
+
const ret = wasm.podaeciphertext_decode(this.__wbg_ptr);
|
|
2552
|
+
if (ret[2]) {
|
|
2553
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2554
|
+
}
|
|
2555
|
+
return AeCiphertext.__wrap(ret[0]);
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
module.exports.PodAeCiphertext = PodAeCiphertext;
|
|
2559
|
+
|
|
2560
|
+
const PodBatchedGroupedCiphertext2HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2561
|
+
? { register: () => {}, unregister: () => {} }
|
|
2562
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podbatchedgroupedciphertext2handlesvalidityproof_free(ptr >>> 0, 1));
|
|
2563
|
+
/**
|
|
2564
|
+
* The `BatchedGroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
2565
|
+
*/
|
|
2566
|
+
class PodBatchedGroupedCiphertext2HandlesValidityProof {
|
|
2567
|
+
|
|
2568
|
+
static __wrap(ptr) {
|
|
2569
|
+
ptr = ptr >>> 0;
|
|
2570
|
+
const obj = Object.create(PodBatchedGroupedCiphertext2HandlesValidityProof.prototype);
|
|
2571
|
+
obj.__wbg_ptr = ptr;
|
|
2572
|
+
PodBatchedGroupedCiphertext2HandlesValidityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2573
|
+
return obj;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
__destroy_into_raw() {
|
|
2577
|
+
const ptr = this.__wbg_ptr;
|
|
2578
|
+
this.__wbg_ptr = 0;
|
|
2579
|
+
PodBatchedGroupedCiphertext2HandlesValidityProofFinalization.unregister(this);
|
|
2580
|
+
return ptr;
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
free() {
|
|
2584
|
+
const ptr = this.__destroy_into_raw();
|
|
2585
|
+
wasm.__wbg_podbatchedgroupedciphertext2handlesvalidityproof_free(ptr, 0);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
module.exports.PodBatchedGroupedCiphertext2HandlesValidityProof = PodBatchedGroupedCiphertext2HandlesValidityProof;
|
|
2589
|
+
|
|
2590
|
+
const PodBatchedGroupedCiphertext3HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2591
|
+
? { register: () => {}, unregister: () => {} }
|
|
2592
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podbatchedgroupedciphertext3handlesvalidityproof_free(ptr >>> 0, 1));
|
|
2593
|
+
/**
|
|
2594
|
+
* The `BatchedGroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
2595
|
+
*/
|
|
2596
|
+
class PodBatchedGroupedCiphertext3HandlesValidityProof {
|
|
2597
|
+
|
|
2598
|
+
static __wrap(ptr) {
|
|
2599
|
+
ptr = ptr >>> 0;
|
|
2600
|
+
const obj = Object.create(PodBatchedGroupedCiphertext3HandlesValidityProof.prototype);
|
|
2601
|
+
obj.__wbg_ptr = ptr;
|
|
2602
|
+
PodBatchedGroupedCiphertext3HandlesValidityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2603
|
+
return obj;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
__destroy_into_raw() {
|
|
2607
|
+
const ptr = this.__wbg_ptr;
|
|
2608
|
+
this.__wbg_ptr = 0;
|
|
2609
|
+
PodBatchedGroupedCiphertext3HandlesValidityProofFinalization.unregister(this);
|
|
2610
|
+
return ptr;
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
free() {
|
|
2614
|
+
const ptr = this.__destroy_into_raw();
|
|
2615
|
+
wasm.__wbg_podbatchedgroupedciphertext3handlesvalidityproof_free(ptr, 0);
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
module.exports.PodBatchedGroupedCiphertext3HandlesValidityProof = PodBatchedGroupedCiphertext3HandlesValidityProof;
|
|
2619
|
+
|
|
2620
|
+
const PodCiphertextCiphertextEqualityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2621
|
+
? { register: () => {}, unregister: () => {} }
|
|
2622
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podciphertextciphertextequalityproof_free(ptr >>> 0, 1));
|
|
2623
|
+
/**
|
|
2624
|
+
* The `CiphertextCiphertextEqualityProof` type as a `Pod`.
|
|
2625
|
+
*/
|
|
2626
|
+
class PodCiphertextCiphertextEqualityProof {
|
|
2627
|
+
|
|
2628
|
+
static __wrap(ptr) {
|
|
2629
|
+
ptr = ptr >>> 0;
|
|
2630
|
+
const obj = Object.create(PodCiphertextCiphertextEqualityProof.prototype);
|
|
2631
|
+
obj.__wbg_ptr = ptr;
|
|
2632
|
+
PodCiphertextCiphertextEqualityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2633
|
+
return obj;
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
__destroy_into_raw() {
|
|
2637
|
+
const ptr = this.__wbg_ptr;
|
|
2638
|
+
this.__wbg_ptr = 0;
|
|
2639
|
+
PodCiphertextCiphertextEqualityProofFinalization.unregister(this);
|
|
2640
|
+
return ptr;
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
free() {
|
|
2644
|
+
const ptr = this.__destroy_into_raw();
|
|
2645
|
+
wasm.__wbg_podciphertextciphertextequalityproof_free(ptr, 0);
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
module.exports.PodCiphertextCiphertextEqualityProof = PodCiphertextCiphertextEqualityProof;
|
|
2649
|
+
|
|
2650
|
+
const PodCiphertextCommitmentEqualityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2651
|
+
? { register: () => {}, unregister: () => {} }
|
|
2652
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podciphertextcommitmentequalityproof_free(ptr >>> 0, 1));
|
|
2653
|
+
/**
|
|
2654
|
+
* The `CiphertextCommitmentEqualityProof` type as a `Pod`.
|
|
2655
|
+
*/
|
|
2656
|
+
class PodCiphertextCommitmentEqualityProof {
|
|
2657
|
+
|
|
2658
|
+
static __wrap(ptr) {
|
|
2659
|
+
ptr = ptr >>> 0;
|
|
2660
|
+
const obj = Object.create(PodCiphertextCommitmentEqualityProof.prototype);
|
|
2661
|
+
obj.__wbg_ptr = ptr;
|
|
2662
|
+
PodCiphertextCommitmentEqualityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2663
|
+
return obj;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
__destroy_into_raw() {
|
|
2667
|
+
const ptr = this.__wbg_ptr;
|
|
2668
|
+
this.__wbg_ptr = 0;
|
|
2669
|
+
PodCiphertextCommitmentEqualityProofFinalization.unregister(this);
|
|
2670
|
+
return ptr;
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
free() {
|
|
2674
|
+
const ptr = this.__destroy_into_raw();
|
|
2675
|
+
wasm.__wbg_podciphertextcommitmentequalityproof_free(ptr, 0);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
module.exports.PodCiphertextCommitmentEqualityProof = PodCiphertextCommitmentEqualityProof;
|
|
2679
|
+
|
|
2680
|
+
const PodElGamalCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2681
|
+
? { register: () => {}, unregister: () => {} }
|
|
2682
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podelgamalciphertext_free(ptr >>> 0, 1));
|
|
2683
|
+
/**
|
|
2684
|
+
* The `ElGamalCiphertext` type as a `Pod`.
|
|
2685
|
+
*/
|
|
2686
|
+
class PodElGamalCiphertext {
|
|
2687
|
+
|
|
2688
|
+
static __wrap(ptr) {
|
|
2689
|
+
ptr = ptr >>> 0;
|
|
2690
|
+
const obj = Object.create(PodElGamalCiphertext.prototype);
|
|
2691
|
+
obj.__wbg_ptr = ptr;
|
|
2692
|
+
PodElGamalCiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2693
|
+
return obj;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
__destroy_into_raw() {
|
|
2697
|
+
const ptr = this.__wbg_ptr;
|
|
2698
|
+
this.__wbg_ptr = 0;
|
|
2699
|
+
PodElGamalCiphertextFinalization.unregister(this);
|
|
2700
|
+
return ptr;
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
free() {
|
|
2704
|
+
const ptr = this.__destroy_into_raw();
|
|
2705
|
+
wasm.__wbg_podelgamalciphertext_free(ptr, 0);
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2708
|
+
* @param {any} value
|
|
2709
|
+
*/
|
|
2710
|
+
constructor(value) {
|
|
2711
|
+
const ret = wasm.podelgamalciphertext_constructor(value);
|
|
2712
|
+
if (ret[2]) {
|
|
2713
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2714
|
+
}
|
|
2715
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
2716
|
+
PodElGamalCiphertextFinalization.register(this, this.__wbg_ptr, this);
|
|
2717
|
+
return this;
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
2720
|
+
* @returns {string}
|
|
2721
|
+
*/
|
|
2722
|
+
toString() {
|
|
2723
|
+
let deferred1_0;
|
|
2724
|
+
let deferred1_1;
|
|
2725
|
+
try {
|
|
2726
|
+
const ret = wasm.podelgamalciphertext_toString(this.__wbg_ptr);
|
|
2727
|
+
deferred1_0 = ret[0];
|
|
2728
|
+
deferred1_1 = ret[1];
|
|
2729
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2730
|
+
} finally {
|
|
2731
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* @param {PodElGamalCiphertext} other
|
|
2736
|
+
* @returns {boolean}
|
|
2737
|
+
*/
|
|
2738
|
+
equals(other) {
|
|
2739
|
+
_assertClass(other, PodElGamalCiphertext);
|
|
2740
|
+
const ret = wasm.podelgamalciphertext_equals(this.__wbg_ptr, other.__wbg_ptr);
|
|
2741
|
+
return ret !== 0;
|
|
2742
|
+
}
|
|
2743
|
+
/**
|
|
2744
|
+
* @returns {Uint8Array}
|
|
2745
|
+
*/
|
|
2746
|
+
toBytes() {
|
|
2747
|
+
const ret = wasm.podelgamalciphertext_toBytes(this.__wbg_ptr);
|
|
2748
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2749
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2750
|
+
return v1;
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* @returns {PodElGamalCiphertext}
|
|
2754
|
+
*/
|
|
2755
|
+
static zeroed() {
|
|
2756
|
+
const ret = wasm.podaeciphertext_zeroed();
|
|
2757
|
+
return PodElGamalCiphertext.__wrap(ret);
|
|
2758
|
+
}
|
|
2759
|
+
/**
|
|
2760
|
+
* @param {ElGamalCiphertext} decoded
|
|
2761
|
+
* @returns {PodElGamalCiphertext}
|
|
2762
|
+
*/
|
|
2763
|
+
static encode(decoded) {
|
|
2764
|
+
_assertClass(decoded, ElGamalCiphertext);
|
|
2765
|
+
const ret = wasm.podelgamalciphertext_encode(decoded.__wbg_ptr);
|
|
2766
|
+
return PodElGamalCiphertext.__wrap(ret);
|
|
2767
|
+
}
|
|
2768
|
+
/**
|
|
2769
|
+
* @returns {ElGamalCiphertext}
|
|
2770
|
+
*/
|
|
2771
|
+
decode() {
|
|
2772
|
+
const ret = wasm.podelgamalciphertext_decode(this.__wbg_ptr);
|
|
2773
|
+
if (ret[2]) {
|
|
2774
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2775
|
+
}
|
|
2776
|
+
return ElGamalCiphertext.__wrap(ret[0]);
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
module.exports.PodElGamalCiphertext = PodElGamalCiphertext;
|
|
2780
|
+
|
|
2781
|
+
const PodElGamalPubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2782
|
+
? { register: () => {}, unregister: () => {} }
|
|
2783
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podelgamalpubkey_free(ptr >>> 0, 1));
|
|
2784
|
+
/**
|
|
2785
|
+
* The `ElGamalPubkey` type as a `Pod`.
|
|
2786
|
+
*/
|
|
2787
|
+
class PodElGamalPubkey {
|
|
2788
|
+
|
|
2789
|
+
static __wrap(ptr) {
|
|
2790
|
+
ptr = ptr >>> 0;
|
|
2791
|
+
const obj = Object.create(PodElGamalPubkey.prototype);
|
|
2792
|
+
obj.__wbg_ptr = ptr;
|
|
2793
|
+
PodElGamalPubkeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2794
|
+
return obj;
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
__destroy_into_raw() {
|
|
2798
|
+
const ptr = this.__wbg_ptr;
|
|
2799
|
+
this.__wbg_ptr = 0;
|
|
2800
|
+
PodElGamalPubkeyFinalization.unregister(this);
|
|
2801
|
+
return ptr;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
free() {
|
|
2805
|
+
const ptr = this.__destroy_into_raw();
|
|
2806
|
+
wasm.__wbg_podelgamalpubkey_free(ptr, 0);
|
|
2807
|
+
}
|
|
2808
|
+
/**
|
|
2809
|
+
* @param {any} value
|
|
2810
|
+
*/
|
|
2811
|
+
constructor(value) {
|
|
2812
|
+
const ret = wasm.podelgamalpubkey_constructor(value);
|
|
2813
|
+
if (ret[2]) {
|
|
2814
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2815
|
+
}
|
|
2816
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
2817
|
+
PodElGamalPubkeyFinalization.register(this, this.__wbg_ptr, this);
|
|
2818
|
+
return this;
|
|
2819
|
+
}
|
|
2820
|
+
/**
|
|
2821
|
+
* @returns {string}
|
|
2822
|
+
*/
|
|
2823
|
+
toString() {
|
|
2824
|
+
let deferred1_0;
|
|
2825
|
+
let deferred1_1;
|
|
2826
|
+
try {
|
|
2827
|
+
const ret = wasm.podelgamalpubkey_toString(this.__wbg_ptr);
|
|
2828
|
+
deferred1_0 = ret[0];
|
|
2829
|
+
deferred1_1 = ret[1];
|
|
2830
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2831
|
+
} finally {
|
|
2832
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* @param {PodElGamalPubkey} other
|
|
2837
|
+
* @returns {boolean}
|
|
2838
|
+
*/
|
|
2839
|
+
equals(other) {
|
|
2840
|
+
_assertClass(other, PodElGamalPubkey);
|
|
2841
|
+
const ret = wasm.podelgamalpubkey_equals(this.__wbg_ptr, other.__wbg_ptr);
|
|
2842
|
+
return ret !== 0;
|
|
2843
|
+
}
|
|
2844
|
+
/**
|
|
2845
|
+
* @returns {Uint8Array}
|
|
2846
|
+
*/
|
|
2847
|
+
toBytes() {
|
|
2848
|
+
const ret = wasm.podelgamalpubkey_toBytes(this.__wbg_ptr);
|
|
2849
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2850
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2851
|
+
return v1;
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* @returns {PodElGamalPubkey}
|
|
2855
|
+
*/
|
|
2856
|
+
static zeroed() {
|
|
2857
|
+
const ret = wasm.podelgamalpubkey_zeroed();
|
|
2858
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
2859
|
+
}
|
|
2860
|
+
/**
|
|
2861
|
+
* @param {ElGamalPubkey} decoded
|
|
2862
|
+
* @returns {PodElGamalPubkey}
|
|
2863
|
+
*/
|
|
2864
|
+
static encode(decoded) {
|
|
2865
|
+
_assertClass(decoded, ElGamalPubkey);
|
|
2866
|
+
const ret = wasm.podelgamalpubkey_encode(decoded.__wbg_ptr);
|
|
2867
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
2868
|
+
}
|
|
2869
|
+
/**
|
|
2870
|
+
* @returns {ElGamalPubkey}
|
|
2871
|
+
*/
|
|
2872
|
+
decode() {
|
|
2873
|
+
const ret = wasm.podelgamalpubkey_decode(this.__wbg_ptr);
|
|
2874
|
+
if (ret[2]) {
|
|
2875
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2876
|
+
}
|
|
2877
|
+
return ElGamalPubkey.__wrap(ret[0]);
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
module.exports.PodElGamalPubkey = PodElGamalPubkey;
|
|
2881
|
+
|
|
2882
|
+
const PodGroupedCiphertext2HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2883
|
+
? { register: () => {}, unregister: () => {} }
|
|
2884
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podgroupedciphertext2handlesvalidityproof_free(ptr >>> 0, 1));
|
|
2885
|
+
/**
|
|
2886
|
+
* The `GroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
2887
|
+
*/
|
|
2888
|
+
class PodGroupedCiphertext2HandlesValidityProof {
|
|
2889
|
+
|
|
2890
|
+
static __wrap(ptr) {
|
|
2891
|
+
ptr = ptr >>> 0;
|
|
2892
|
+
const obj = Object.create(PodGroupedCiphertext2HandlesValidityProof.prototype);
|
|
2893
|
+
obj.__wbg_ptr = ptr;
|
|
2894
|
+
PodGroupedCiphertext2HandlesValidityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2895
|
+
return obj;
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
__destroy_into_raw() {
|
|
2899
|
+
const ptr = this.__wbg_ptr;
|
|
2900
|
+
this.__wbg_ptr = 0;
|
|
2901
|
+
PodGroupedCiphertext2HandlesValidityProofFinalization.unregister(this);
|
|
2902
|
+
return ptr;
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
free() {
|
|
2906
|
+
const ptr = this.__destroy_into_raw();
|
|
2907
|
+
wasm.__wbg_podgroupedciphertext2handlesvalidityproof_free(ptr, 0);
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
module.exports.PodGroupedCiphertext2HandlesValidityProof = PodGroupedCiphertext2HandlesValidityProof;
|
|
2911
|
+
|
|
2912
|
+
const PodGroupedCiphertext3HandlesValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2913
|
+
? { register: () => {}, unregister: () => {} }
|
|
2914
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podgroupedciphertext3handlesvalidityproof_free(ptr >>> 0, 1));
|
|
2915
|
+
/**
|
|
2916
|
+
* The `GroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
2917
|
+
*/
|
|
2918
|
+
class PodGroupedCiphertext3HandlesValidityProof {
|
|
2919
|
+
|
|
2920
|
+
static __wrap(ptr) {
|
|
2921
|
+
ptr = ptr >>> 0;
|
|
2922
|
+
const obj = Object.create(PodGroupedCiphertext3HandlesValidityProof.prototype);
|
|
2923
|
+
obj.__wbg_ptr = ptr;
|
|
2924
|
+
PodGroupedCiphertext3HandlesValidityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2925
|
+
return obj;
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
__destroy_into_raw() {
|
|
2929
|
+
const ptr = this.__wbg_ptr;
|
|
2930
|
+
this.__wbg_ptr = 0;
|
|
2931
|
+
PodGroupedCiphertext3HandlesValidityProofFinalization.unregister(this);
|
|
2932
|
+
return ptr;
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
free() {
|
|
2936
|
+
const ptr = this.__destroy_into_raw();
|
|
2937
|
+
wasm.__wbg_podgroupedciphertext3handlesvalidityproof_free(ptr, 0);
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
module.exports.PodGroupedCiphertext3HandlesValidityProof = PodGroupedCiphertext3HandlesValidityProof;
|
|
2941
|
+
|
|
2942
|
+
const PodGroupedElGamalCiphertext2HandlesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2943
|
+
? { register: () => {}, unregister: () => {} }
|
|
2944
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podgroupedelgamalciphertext2handles_free(ptr >>> 0, 1));
|
|
2945
|
+
/**
|
|
2946
|
+
* The `GroupedElGamalCiphertext` type with two decryption handles as a `Pod`
|
|
2947
|
+
*/
|
|
2948
|
+
class PodGroupedElGamalCiphertext2Handles {
|
|
2949
|
+
|
|
2950
|
+
static __wrap(ptr) {
|
|
2951
|
+
ptr = ptr >>> 0;
|
|
2952
|
+
const obj = Object.create(PodGroupedElGamalCiphertext2Handles.prototype);
|
|
2953
|
+
obj.__wbg_ptr = ptr;
|
|
2954
|
+
PodGroupedElGamalCiphertext2HandlesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2955
|
+
return obj;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
__destroy_into_raw() {
|
|
2959
|
+
const ptr = this.__wbg_ptr;
|
|
2960
|
+
this.__wbg_ptr = 0;
|
|
2961
|
+
PodGroupedElGamalCiphertext2HandlesFinalization.unregister(this);
|
|
2962
|
+
return ptr;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
free() {
|
|
2966
|
+
const ptr = this.__destroy_into_raw();
|
|
2967
|
+
wasm.__wbg_podgroupedelgamalciphertext2handles_free(ptr, 0);
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
module.exports.PodGroupedElGamalCiphertext2Handles = PodGroupedElGamalCiphertext2Handles;
|
|
2971
|
+
|
|
2972
|
+
const PodGroupedElGamalCiphertext3HandlesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2973
|
+
? { register: () => {}, unregister: () => {} }
|
|
2974
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podgroupedelgamalciphertext3handles_free(ptr >>> 0, 1));
|
|
2975
|
+
/**
|
|
2976
|
+
* The `GroupedElGamalCiphertext` type with three decryption handles as a `Pod`
|
|
2977
|
+
*/
|
|
2978
|
+
class PodGroupedElGamalCiphertext3Handles {
|
|
2979
|
+
|
|
2980
|
+
static __wrap(ptr) {
|
|
2981
|
+
ptr = ptr >>> 0;
|
|
2982
|
+
const obj = Object.create(PodGroupedElGamalCiphertext3Handles.prototype);
|
|
2983
|
+
obj.__wbg_ptr = ptr;
|
|
2984
|
+
PodGroupedElGamalCiphertext3HandlesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2985
|
+
return obj;
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
__destroy_into_raw() {
|
|
2989
|
+
const ptr = this.__wbg_ptr;
|
|
2990
|
+
this.__wbg_ptr = 0;
|
|
2991
|
+
PodGroupedElGamalCiphertext3HandlesFinalization.unregister(this);
|
|
2992
|
+
return ptr;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
free() {
|
|
2996
|
+
const ptr = this.__destroy_into_raw();
|
|
2997
|
+
wasm.__wbg_podgroupedelgamalciphertext3handles_free(ptr, 0);
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
module.exports.PodGroupedElGamalCiphertext3Handles = PodGroupedElGamalCiphertext3Handles;
|
|
3001
|
+
|
|
3002
|
+
const PodPedersenCommitmentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3003
|
+
? { register: () => {}, unregister: () => {} }
|
|
3004
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podpedersencommitment_free(ptr >>> 0, 1));
|
|
3005
|
+
/**
|
|
3006
|
+
* The `PedersenCommitment` type as a `Pod`.
|
|
3007
|
+
*/
|
|
3008
|
+
class PodPedersenCommitment {
|
|
3009
|
+
|
|
3010
|
+
static __wrap(ptr) {
|
|
3011
|
+
ptr = ptr >>> 0;
|
|
3012
|
+
const obj = Object.create(PodPedersenCommitment.prototype);
|
|
3013
|
+
obj.__wbg_ptr = ptr;
|
|
3014
|
+
PodPedersenCommitmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3015
|
+
return obj;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
__destroy_into_raw() {
|
|
3019
|
+
const ptr = this.__wbg_ptr;
|
|
3020
|
+
this.__wbg_ptr = 0;
|
|
3021
|
+
PodPedersenCommitmentFinalization.unregister(this);
|
|
3022
|
+
return ptr;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
free() {
|
|
3026
|
+
const ptr = this.__destroy_into_raw();
|
|
3027
|
+
wasm.__wbg_podpedersencommitment_free(ptr, 0);
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
module.exports.PodPedersenCommitment = PodPedersenCommitment;
|
|
3031
|
+
|
|
3032
|
+
const PodPercentageWithCapProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3033
|
+
? { register: () => {}, unregister: () => {} }
|
|
3034
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podpercentagewithcapproof_free(ptr >>> 0, 1));
|
|
3035
|
+
/**
|
|
3036
|
+
* The `PercentageWithCapProof` type as a `Pod`.
|
|
3037
|
+
*/
|
|
3038
|
+
class PodPercentageWithCapProof {
|
|
3039
|
+
|
|
3040
|
+
static __wrap(ptr) {
|
|
3041
|
+
ptr = ptr >>> 0;
|
|
3042
|
+
const obj = Object.create(PodPercentageWithCapProof.prototype);
|
|
3043
|
+
obj.__wbg_ptr = ptr;
|
|
3044
|
+
PodPercentageWithCapProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3045
|
+
return obj;
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
__destroy_into_raw() {
|
|
3049
|
+
const ptr = this.__wbg_ptr;
|
|
3050
|
+
this.__wbg_ptr = 0;
|
|
3051
|
+
PodPercentageWithCapProofFinalization.unregister(this);
|
|
3052
|
+
return ptr;
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
free() {
|
|
3056
|
+
const ptr = this.__destroy_into_raw();
|
|
3057
|
+
wasm.__wbg_podpercentagewithcapproof_free(ptr, 0);
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
module.exports.PodPercentageWithCapProof = PodPercentageWithCapProof;
|
|
3061
|
+
|
|
3062
|
+
const PodPubkeyValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3063
|
+
? { register: () => {}, unregister: () => {} }
|
|
3064
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podpubkeyvalidityproof_free(ptr >>> 0, 1));
|
|
3065
|
+
/**
|
|
3066
|
+
* The `PubkeyValidityProof` type as a `Pod`.
|
|
3067
|
+
*/
|
|
3068
|
+
class PodPubkeyValidityProof {
|
|
3069
|
+
|
|
3070
|
+
static __wrap(ptr) {
|
|
3071
|
+
ptr = ptr >>> 0;
|
|
3072
|
+
const obj = Object.create(PodPubkeyValidityProof.prototype);
|
|
3073
|
+
obj.__wbg_ptr = ptr;
|
|
3074
|
+
PodPubkeyValidityProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3075
|
+
return obj;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
__destroy_into_raw() {
|
|
3079
|
+
const ptr = this.__wbg_ptr;
|
|
3080
|
+
this.__wbg_ptr = 0;
|
|
3081
|
+
PodPubkeyValidityProofFinalization.unregister(this);
|
|
3082
|
+
return ptr;
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
free() {
|
|
3086
|
+
const ptr = this.__destroy_into_raw();
|
|
3087
|
+
wasm.__wbg_podpubkeyvalidityproof_free(ptr, 0);
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
module.exports.PodPubkeyValidityProof = PodPubkeyValidityProof;
|
|
3091
|
+
|
|
3092
|
+
const PodU64Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
3093
|
+
? { register: () => {}, unregister: () => {} }
|
|
3094
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podu64_free(ptr >>> 0, 1));
|
|
3095
|
+
|
|
3096
|
+
class PodU64 {
|
|
3097
|
+
|
|
3098
|
+
static __wrap(ptr) {
|
|
3099
|
+
ptr = ptr >>> 0;
|
|
3100
|
+
const obj = Object.create(PodU64.prototype);
|
|
3101
|
+
obj.__wbg_ptr = ptr;
|
|
3102
|
+
PodU64Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
3103
|
+
return obj;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
__destroy_into_raw() {
|
|
3107
|
+
const ptr = this.__wbg_ptr;
|
|
3108
|
+
this.__wbg_ptr = 0;
|
|
3109
|
+
PodU64Finalization.unregister(this);
|
|
3110
|
+
return ptr;
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
free() {
|
|
3114
|
+
const ptr = this.__destroy_into_raw();
|
|
3115
|
+
wasm.__wbg_podu64_free(ptr, 0);
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
module.exports.PodU64 = PodU64;
|
|
3119
|
+
|
|
3120
|
+
const PodZeroCiphertextProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3121
|
+
? { register: () => {}, unregister: () => {} }
|
|
3122
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_podzerociphertextproof_free(ptr >>> 0, 1));
|
|
3123
|
+
/**
|
|
3124
|
+
* The `ZeroCiphertextProof` type as a `Pod`.
|
|
3125
|
+
*/
|
|
3126
|
+
class PodZeroCiphertextProof {
|
|
3127
|
+
|
|
3128
|
+
static __wrap(ptr) {
|
|
3129
|
+
ptr = ptr >>> 0;
|
|
3130
|
+
const obj = Object.create(PodZeroCiphertextProof.prototype);
|
|
3131
|
+
obj.__wbg_ptr = ptr;
|
|
3132
|
+
PodZeroCiphertextProofFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3133
|
+
return obj;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
__destroy_into_raw() {
|
|
3137
|
+
const ptr = this.__wbg_ptr;
|
|
3138
|
+
this.__wbg_ptr = 0;
|
|
3139
|
+
PodZeroCiphertextProofFinalization.unregister(this);
|
|
3140
|
+
return ptr;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
free() {
|
|
3144
|
+
const ptr = this.__destroy_into_raw();
|
|
3145
|
+
wasm.__wbg_podzerociphertextproof_free(ptr, 0);
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
module.exports.PodZeroCiphertextProof = PodZeroCiphertextProof;
|
|
3149
|
+
|
|
3150
|
+
const PubkeyValidityProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3151
|
+
? { register: () => {}, unregister: () => {} }
|
|
3152
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkeyvalidityproof_free(ptr >>> 0, 1));
|
|
3153
|
+
/**
|
|
3154
|
+
* Public-key proof.
|
|
3155
|
+
*
|
|
3156
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
3157
|
+
*/
|
|
3158
|
+
class PubkeyValidityProof {
|
|
3159
|
+
|
|
3160
|
+
__destroy_into_raw() {
|
|
3161
|
+
const ptr = this.__wbg_ptr;
|
|
3162
|
+
this.__wbg_ptr = 0;
|
|
3163
|
+
PubkeyValidityProofFinalization.unregister(this);
|
|
3164
|
+
return ptr;
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
free() {
|
|
3168
|
+
const ptr = this.__destroy_into_raw();
|
|
3169
|
+
wasm.__wbg_pubkeyvalidityproof_free(ptr, 0);
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
module.exports.PubkeyValidityProof = PubkeyValidityProof;
|
|
3173
|
+
|
|
3174
|
+
const PubkeyValidityProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3175
|
+
? { register: () => {}, unregister: () => {} }
|
|
3176
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkeyvalidityproofcontext_free(ptr >>> 0, 1));
|
|
3177
|
+
/**
|
|
3178
|
+
* The context data needed to verify a pubkey validity proof.
|
|
3179
|
+
*/
|
|
3180
|
+
class PubkeyValidityProofContext {
|
|
3181
|
+
|
|
3182
|
+
static __wrap(ptr) {
|
|
3183
|
+
ptr = ptr >>> 0;
|
|
3184
|
+
const obj = Object.create(PubkeyValidityProofContext.prototype);
|
|
3185
|
+
obj.__wbg_ptr = ptr;
|
|
3186
|
+
PubkeyValidityProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3187
|
+
return obj;
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
__destroy_into_raw() {
|
|
3191
|
+
const ptr = this.__wbg_ptr;
|
|
3192
|
+
this.__wbg_ptr = 0;
|
|
3193
|
+
PubkeyValidityProofContextFinalization.unregister(this);
|
|
3194
|
+
return ptr;
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
free() {
|
|
3198
|
+
const ptr = this.__destroy_into_raw();
|
|
3199
|
+
wasm.__wbg_pubkeyvalidityproofcontext_free(ptr, 0);
|
|
3200
|
+
}
|
|
3201
|
+
/**
|
|
3202
|
+
* The public key to be proved
|
|
3203
|
+
* @returns {PodElGamalPubkey}
|
|
3204
|
+
*/
|
|
3205
|
+
get pubkey() {
|
|
3206
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
3207
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
3208
|
+
}
|
|
3209
|
+
/**
|
|
3210
|
+
* The public key to be proved
|
|
3211
|
+
* @param {PodElGamalPubkey} arg0
|
|
3212
|
+
*/
|
|
3213
|
+
set pubkey(arg0) {
|
|
3214
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
3215
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3216
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
3217
|
+
}
|
|
3218
|
+
/**
|
|
3219
|
+
* @returns {Uint8Array}
|
|
3220
|
+
*/
|
|
3221
|
+
toBytes() {
|
|
3222
|
+
const ret = wasm.pubkeyvalidityproofcontext_toBytes(this.__wbg_ptr);
|
|
3223
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
3224
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
3225
|
+
return v1;
|
|
3226
|
+
}
|
|
3227
|
+
/**
|
|
3228
|
+
* @param {Uint8Array} bytes
|
|
3229
|
+
* @returns {PubkeyValidityProofContext}
|
|
3230
|
+
*/
|
|
3231
|
+
static fromBytes(bytes) {
|
|
3232
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
3233
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3234
|
+
const ret = wasm.pubkeyvalidityproofcontext_fromBytes(ptr0, len0);
|
|
3235
|
+
if (ret[2]) {
|
|
3236
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3237
|
+
}
|
|
3238
|
+
return PubkeyValidityProofContext.__wrap(ret[0]);
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
module.exports.PubkeyValidityProofContext = PubkeyValidityProofContext;
|
|
3242
|
+
|
|
3243
|
+
const PubkeyValidityProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3244
|
+
? { register: () => {}, unregister: () => {} }
|
|
3245
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkeyvalidityproofdata_free(ptr >>> 0, 1));
|
|
3246
|
+
/**
|
|
3247
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyPubkeyValidity`
|
|
3248
|
+
* instruction.
|
|
3249
|
+
*
|
|
3250
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
3251
|
+
* the proof.
|
|
3252
|
+
*/
|
|
3253
|
+
class PubkeyValidityProofData {
|
|
3254
|
+
|
|
3255
|
+
static __wrap(ptr) {
|
|
3256
|
+
ptr = ptr >>> 0;
|
|
3257
|
+
const obj = Object.create(PubkeyValidityProofData.prototype);
|
|
3258
|
+
obj.__wbg_ptr = ptr;
|
|
3259
|
+
PubkeyValidityProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3260
|
+
return obj;
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
__destroy_into_raw() {
|
|
3264
|
+
const ptr = this.__wbg_ptr;
|
|
3265
|
+
this.__wbg_ptr = 0;
|
|
3266
|
+
PubkeyValidityProofDataFinalization.unregister(this);
|
|
3267
|
+
return ptr;
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
free() {
|
|
3271
|
+
const ptr = this.__destroy_into_raw();
|
|
3272
|
+
wasm.__wbg_pubkeyvalidityproofdata_free(ptr, 0);
|
|
3273
|
+
}
|
|
3274
|
+
/**
|
|
3275
|
+
* The context data for the public key validity proof
|
|
3276
|
+
* @returns {PubkeyValidityProofContext}
|
|
3277
|
+
*/
|
|
3278
|
+
get context() {
|
|
3279
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
3280
|
+
return PubkeyValidityProofContext.__wrap(ret);
|
|
3281
|
+
}
|
|
3282
|
+
/**
|
|
3283
|
+
* The context data for the public key validity proof
|
|
3284
|
+
* @param {PubkeyValidityProofContext} arg0
|
|
3285
|
+
*/
|
|
3286
|
+
set context(arg0) {
|
|
3287
|
+
_assertClass(arg0, PubkeyValidityProofContext);
|
|
3288
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3289
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
3290
|
+
}
|
|
3291
|
+
/**
|
|
3292
|
+
* Proof that the public key is well-formed
|
|
3293
|
+
* @returns {PodPubkeyValidityProof}
|
|
3294
|
+
*/
|
|
3295
|
+
get proof() {
|
|
3296
|
+
const ret = wasm.__wbg_get_ciphertextcommitmentequalityproofcontext_ciphertext(this.__wbg_ptr);
|
|
3297
|
+
return PodPubkeyValidityProof.__wrap(ret);
|
|
3298
|
+
}
|
|
3299
|
+
/**
|
|
3300
|
+
* Proof that the public key is well-formed
|
|
3301
|
+
* @param {PodPubkeyValidityProof} arg0
|
|
3302
|
+
*/
|
|
3303
|
+
set proof(arg0) {
|
|
3304
|
+
_assertClass(arg0, PodPubkeyValidityProof);
|
|
3305
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3306
|
+
wasm.__wbg_set_ciphertextcommitmentequalityproofcontext_ciphertext(this.__wbg_ptr, ptr0);
|
|
3307
|
+
}
|
|
3308
|
+
/**
|
|
3309
|
+
* @param {ElGamalKeypair} keypair
|
|
3310
|
+
* @returns {PubkeyValidityProofData}
|
|
3311
|
+
*/
|
|
3312
|
+
static new(keypair) {
|
|
3313
|
+
_assertClass(keypair, ElGamalKeypair);
|
|
3314
|
+
const ret = wasm.pubkeyvalidityproofdata_new(keypair.__wbg_ptr);
|
|
3315
|
+
if (ret[2]) {
|
|
3316
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3317
|
+
}
|
|
3318
|
+
return PubkeyValidityProofData.__wrap(ret[0]);
|
|
3319
|
+
}
|
|
3320
|
+
/**
|
|
3321
|
+
* @returns {Uint8Array}
|
|
3322
|
+
*/
|
|
3323
|
+
toBytes() {
|
|
3324
|
+
const ret = wasm.pubkeyvalidityproofdata_toBytes(this.__wbg_ptr);
|
|
3325
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
3326
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
3327
|
+
return v1;
|
|
3328
|
+
}
|
|
3329
|
+
/**
|
|
3330
|
+
* @param {Uint8Array} bytes
|
|
3331
|
+
* @returns {PubkeyValidityProofData}
|
|
3332
|
+
*/
|
|
3333
|
+
static fromBytes(bytes) {
|
|
3334
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
3335
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3336
|
+
const ret = wasm.pubkeyvalidityproofdata_fromBytes(ptr0, len0);
|
|
3337
|
+
if (ret[2]) {
|
|
3338
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3339
|
+
}
|
|
3340
|
+
return PubkeyValidityProofData.__wrap(ret[0]);
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3343
|
+
module.exports.PubkeyValidityProofData = PubkeyValidityProofData;
|
|
3344
|
+
|
|
3345
|
+
const ZeroCiphertextProofFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3346
|
+
? { register: () => {}, unregister: () => {} }
|
|
3347
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zerociphertextproof_free(ptr >>> 0, 1));
|
|
3348
|
+
/**
|
|
3349
|
+
* Zero-ciphertext proof.
|
|
3350
|
+
*
|
|
3351
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
3352
|
+
*/
|
|
3353
|
+
class ZeroCiphertextProof {
|
|
3354
|
+
|
|
3355
|
+
__destroy_into_raw() {
|
|
3356
|
+
const ptr = this.__wbg_ptr;
|
|
3357
|
+
this.__wbg_ptr = 0;
|
|
3358
|
+
ZeroCiphertextProofFinalization.unregister(this);
|
|
3359
|
+
return ptr;
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
free() {
|
|
3363
|
+
const ptr = this.__destroy_into_raw();
|
|
3364
|
+
wasm.__wbg_zerociphertextproof_free(ptr, 0);
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3367
|
+
module.exports.ZeroCiphertextProof = ZeroCiphertextProof;
|
|
3368
|
+
|
|
3369
|
+
const ZeroCiphertextProofContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3370
|
+
? { register: () => {}, unregister: () => {} }
|
|
3371
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zerociphertextproofcontext_free(ptr >>> 0, 1));
|
|
3372
|
+
/**
|
|
3373
|
+
* The context data needed to verify a zero-ciphertext proof.
|
|
3374
|
+
*/
|
|
3375
|
+
class ZeroCiphertextProofContext {
|
|
3376
|
+
|
|
3377
|
+
static __wrap(ptr) {
|
|
3378
|
+
ptr = ptr >>> 0;
|
|
3379
|
+
const obj = Object.create(ZeroCiphertextProofContext.prototype);
|
|
3380
|
+
obj.__wbg_ptr = ptr;
|
|
3381
|
+
ZeroCiphertextProofContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3382
|
+
return obj;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
__destroy_into_raw() {
|
|
3386
|
+
const ptr = this.__wbg_ptr;
|
|
3387
|
+
this.__wbg_ptr = 0;
|
|
3388
|
+
ZeroCiphertextProofContextFinalization.unregister(this);
|
|
3389
|
+
return ptr;
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
free() {
|
|
3393
|
+
const ptr = this.__destroy_into_raw();
|
|
3394
|
+
wasm.__wbg_zerociphertextproofcontext_free(ptr, 0);
|
|
3395
|
+
}
|
|
3396
|
+
/**
|
|
3397
|
+
* The ElGamal pubkey associated with the ElGamal ciphertext
|
|
3398
|
+
* @returns {PodElGamalPubkey}
|
|
3399
|
+
*/
|
|
3400
|
+
get pubkey() {
|
|
3401
|
+
const ret = wasm.__wbg_get_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr);
|
|
3402
|
+
return PodElGamalPubkey.__wrap(ret);
|
|
3403
|
+
}
|
|
3404
|
+
/**
|
|
3405
|
+
* The ElGamal pubkey associated with the ElGamal ciphertext
|
|
3406
|
+
* @param {PodElGamalPubkey} arg0
|
|
3407
|
+
*/
|
|
3408
|
+
set pubkey(arg0) {
|
|
3409
|
+
_assertClass(arg0, PodElGamalPubkey);
|
|
3410
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3411
|
+
wasm.__wbg_set_batchedgroupedciphertext2handlesvalidityproofcontext_first_pubkey(this.__wbg_ptr, ptr0);
|
|
3412
|
+
}
|
|
3413
|
+
/**
|
|
3414
|
+
* The ElGamal ciphertext that encrypts zero
|
|
3415
|
+
* @returns {PodElGamalCiphertext}
|
|
3416
|
+
*/
|
|
3417
|
+
get ciphertext() {
|
|
3418
|
+
const ret = wasm.__wbg_get_ciphertextcommitmentequalityproofcontext_ciphertext(this.__wbg_ptr);
|
|
3419
|
+
return PodElGamalCiphertext.__wrap(ret);
|
|
3420
|
+
}
|
|
3421
|
+
/**
|
|
3422
|
+
* The ElGamal ciphertext that encrypts zero
|
|
3423
|
+
* @param {PodElGamalCiphertext} arg0
|
|
3424
|
+
*/
|
|
3425
|
+
set ciphertext(arg0) {
|
|
3426
|
+
_assertClass(arg0, PodElGamalCiphertext);
|
|
3427
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3428
|
+
wasm.__wbg_set_ciphertextcommitmentequalityproofcontext_ciphertext(this.__wbg_ptr, ptr0);
|
|
3429
|
+
}
|
|
3430
|
+
/**
|
|
3431
|
+
* @returns {Uint8Array}
|
|
3432
|
+
*/
|
|
3433
|
+
toBytes() {
|
|
3434
|
+
const ret = wasm.zerociphertextproofcontext_toBytes(this.__wbg_ptr);
|
|
3435
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
3436
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
3437
|
+
return v1;
|
|
3438
|
+
}
|
|
3439
|
+
/**
|
|
3440
|
+
* @param {Uint8Array} bytes
|
|
3441
|
+
* @returns {ZeroCiphertextProofContext}
|
|
3442
|
+
*/
|
|
3443
|
+
static fromBytes(bytes) {
|
|
3444
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
3445
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3446
|
+
const ret = wasm.zerociphertextproofcontext_fromBytes(ptr0, len0);
|
|
3447
|
+
if (ret[2]) {
|
|
3448
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3449
|
+
}
|
|
3450
|
+
return ZeroCiphertextProofContext.__wrap(ret[0]);
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
module.exports.ZeroCiphertextProofContext = ZeroCiphertextProofContext;
|
|
3454
|
+
|
|
3455
|
+
const ZeroCiphertextProofDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3456
|
+
? { register: () => {}, unregister: () => {} }
|
|
3457
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zerociphertextproofdata_free(ptr >>> 0, 1));
|
|
3458
|
+
/**
|
|
3459
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyZeroCiphertext` instruction.
|
|
3460
|
+
*
|
|
3461
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
3462
|
+
* the proof.
|
|
3463
|
+
*/
|
|
3464
|
+
class ZeroCiphertextProofData {
|
|
3465
|
+
|
|
3466
|
+
static __wrap(ptr) {
|
|
3467
|
+
ptr = ptr >>> 0;
|
|
3468
|
+
const obj = Object.create(ZeroCiphertextProofData.prototype);
|
|
3469
|
+
obj.__wbg_ptr = ptr;
|
|
3470
|
+
ZeroCiphertextProofDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3471
|
+
return obj;
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3474
|
+
__destroy_into_raw() {
|
|
3475
|
+
const ptr = this.__wbg_ptr;
|
|
3476
|
+
this.__wbg_ptr = 0;
|
|
3477
|
+
ZeroCiphertextProofDataFinalization.unregister(this);
|
|
3478
|
+
return ptr;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
free() {
|
|
3482
|
+
const ptr = this.__destroy_into_raw();
|
|
3483
|
+
wasm.__wbg_zerociphertextproofdata_free(ptr, 0);
|
|
3484
|
+
}
|
|
3485
|
+
/**
|
|
3486
|
+
* The context data for the zero-ciphertext proof
|
|
3487
|
+
* @returns {ZeroCiphertextProofContext}
|
|
3488
|
+
*/
|
|
3489
|
+
get context() {
|
|
3490
|
+
const ret = wasm.__wbg_get_zerociphertextproofdata_context(this.__wbg_ptr);
|
|
3491
|
+
return ZeroCiphertextProofContext.__wrap(ret);
|
|
3492
|
+
}
|
|
3493
|
+
/**
|
|
3494
|
+
* The context data for the zero-ciphertext proof
|
|
3495
|
+
* @param {ZeroCiphertextProofContext} arg0
|
|
3496
|
+
*/
|
|
3497
|
+
set context(arg0) {
|
|
3498
|
+
_assertClass(arg0, ZeroCiphertextProofContext);
|
|
3499
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3500
|
+
wasm.__wbg_set_zerociphertextproofdata_context(this.__wbg_ptr, ptr0);
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* Proof that the ciphertext is zero
|
|
3504
|
+
* @returns {PodZeroCiphertextProof}
|
|
3505
|
+
*/
|
|
3506
|
+
get proof() {
|
|
3507
|
+
const ret = wasm.__wbg_get_zerociphertextproofdata_proof(this.__wbg_ptr);
|
|
3508
|
+
return PodZeroCiphertextProof.__wrap(ret);
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* Proof that the ciphertext is zero
|
|
3512
|
+
* @param {PodZeroCiphertextProof} arg0
|
|
3513
|
+
*/
|
|
3514
|
+
set proof(arg0) {
|
|
3515
|
+
_assertClass(arg0, PodZeroCiphertextProof);
|
|
3516
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3517
|
+
wasm.__wbg_set_zerociphertextproofdata_proof(this.__wbg_ptr, ptr0);
|
|
3518
|
+
}
|
|
3519
|
+
/**
|
|
3520
|
+
* @param {ElGamalKeypair} keypair
|
|
3521
|
+
* @param {ElGamalCiphertext} ciphertext
|
|
3522
|
+
* @returns {ZeroCiphertextProofData}
|
|
3523
|
+
*/
|
|
3524
|
+
static new(keypair, ciphertext) {
|
|
3525
|
+
_assertClass(keypair, ElGamalKeypair);
|
|
3526
|
+
_assertClass(ciphertext, ElGamalCiphertext);
|
|
3527
|
+
const ret = wasm.zerociphertextproofdata_new(keypair.__wbg_ptr, ciphertext.__wbg_ptr);
|
|
3528
|
+
if (ret[2]) {
|
|
3529
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3530
|
+
}
|
|
3531
|
+
return ZeroCiphertextProofData.__wrap(ret[0]);
|
|
3532
|
+
}
|
|
3533
|
+
/**
|
|
3534
|
+
* @returns {Uint8Array}
|
|
3535
|
+
*/
|
|
3536
|
+
toBytes() {
|
|
3537
|
+
const ret = wasm.zerociphertextproofdata_toBytes(this.__wbg_ptr);
|
|
3538
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
3539
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
3540
|
+
return v1;
|
|
3541
|
+
}
|
|
3542
|
+
/**
|
|
3543
|
+
* @param {Uint8Array} bytes
|
|
3544
|
+
* @returns {ZeroCiphertextProofData}
|
|
3545
|
+
*/
|
|
3546
|
+
static fromBytes(bytes) {
|
|
3547
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
3548
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3549
|
+
const ret = wasm.zerociphertextproofdata_fromBytes(ptr0, len0);
|
|
3550
|
+
if (ret[2]) {
|
|
3551
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3552
|
+
}
|
|
3553
|
+
return ZeroCiphertextProofData.__wrap(ret[0]);
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
module.exports.ZeroCiphertextProofData = ZeroCiphertextProofData;
|
|
3557
|
+
|
|
3558
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
3559
|
+
const ret = arg0.buffer;
|
|
3560
|
+
return ret;
|
|
3561
|
+
};
|
|
3562
|
+
|
|
3563
|
+
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
3564
|
+
const ret = arg0.call(arg1);
|
|
3565
|
+
return ret;
|
|
3566
|
+
}, arguments) };
|
|
3567
|
+
|
|
3568
|
+
module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
3569
|
+
const ret = arg0.call(arg1, arg2);
|
|
3570
|
+
return ret;
|
|
3571
|
+
}, arguments) };
|
|
3572
|
+
|
|
3573
|
+
module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
3574
|
+
const ret = arg0.crypto;
|
|
3575
|
+
return ret;
|
|
3576
|
+
};
|
|
3577
|
+
|
|
3578
|
+
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
3579
|
+
const ret = arg0.done;
|
|
3580
|
+
return ret;
|
|
3581
|
+
};
|
|
3582
|
+
|
|
3583
|
+
module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
|
|
3584
|
+
arg0.getRandomValues(arg1);
|
|
3585
|
+
}, arguments) };
|
|
3586
|
+
|
|
3587
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
3588
|
+
const ret = Reflect.get(arg0, arg1);
|
|
3589
|
+
return ret;
|
|
3590
|
+
}, arguments) };
|
|
3591
|
+
|
|
3592
|
+
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
3593
|
+
let result;
|
|
3594
|
+
try {
|
|
3595
|
+
result = arg0 instanceof Uint8Array;
|
|
3596
|
+
} catch (_) {
|
|
3597
|
+
result = false;
|
|
3598
|
+
}
|
|
3599
|
+
const ret = result;
|
|
3600
|
+
return ret;
|
|
3601
|
+
};
|
|
3602
|
+
|
|
3603
|
+
module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
3604
|
+
const ret = Array.isArray(arg0);
|
|
3605
|
+
return ret;
|
|
3606
|
+
};
|
|
3607
|
+
|
|
3608
|
+
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
3609
|
+
const ret = Symbol.iterator;
|
|
3610
|
+
return ret;
|
|
3611
|
+
};
|
|
3612
|
+
|
|
3613
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
3614
|
+
const ret = arg0.length;
|
|
3615
|
+
return ret;
|
|
3616
|
+
};
|
|
3617
|
+
|
|
3618
|
+
module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
3619
|
+
const ret = arg0.msCrypto;
|
|
3620
|
+
return ret;
|
|
3621
|
+
};
|
|
3622
|
+
|
|
3623
|
+
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
3624
|
+
const ret = new Uint8Array(arg0);
|
|
3625
|
+
return ret;
|
|
3626
|
+
};
|
|
3627
|
+
|
|
3628
|
+
module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
3629
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
3630
|
+
return ret;
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3633
|
+
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
3634
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
3635
|
+
return ret;
|
|
3636
|
+
};
|
|
3637
|
+
|
|
3638
|
+
module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
3639
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
3640
|
+
return ret;
|
|
3641
|
+
};
|
|
3642
|
+
|
|
3643
|
+
module.exports.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
3644
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
3645
|
+
return ret;
|
|
3646
|
+
};
|
|
3647
|
+
|
|
3648
|
+
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
3649
|
+
const ret = arg0.next;
|
|
3650
|
+
return ret;
|
|
3651
|
+
};
|
|
3652
|
+
|
|
3653
|
+
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
3654
|
+
const ret = arg0.next();
|
|
3655
|
+
return ret;
|
|
3656
|
+
}, arguments) };
|
|
3657
|
+
|
|
3658
|
+
module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
|
|
3659
|
+
const ret = arg0.node;
|
|
3660
|
+
return ret;
|
|
3661
|
+
};
|
|
3662
|
+
|
|
3663
|
+
module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
|
|
3664
|
+
const ret = arg0.process;
|
|
3665
|
+
return ret;
|
|
3666
|
+
};
|
|
3667
|
+
|
|
3668
|
+
module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
3669
|
+
arg0.randomFillSync(arg1);
|
|
3670
|
+
}, arguments) };
|
|
3671
|
+
|
|
3672
|
+
module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
3673
|
+
const ret = module.require;
|
|
3674
|
+
return ret;
|
|
3675
|
+
}, arguments) };
|
|
3676
|
+
|
|
3677
|
+
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
3678
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
3679
|
+
};
|
|
3680
|
+
|
|
3681
|
+
module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
3682
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
3683
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3684
|
+
};
|
|
3685
|
+
|
|
3686
|
+
module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
3687
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
3688
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3689
|
+
};
|
|
3690
|
+
|
|
3691
|
+
module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
3692
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
3693
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3694
|
+
};
|
|
3695
|
+
|
|
3696
|
+
module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
3697
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
3698
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3699
|
+
};
|
|
3700
|
+
|
|
3701
|
+
module.exports.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
3702
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
3703
|
+
return ret;
|
|
3704
|
+
};
|
|
3705
|
+
|
|
3706
|
+
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
3707
|
+
const ret = arg0.value;
|
|
3708
|
+
return ret;
|
|
3709
|
+
};
|
|
3710
|
+
|
|
3711
|
+
module.exports.__wbg_values_99f7a68c7f313d66 = function(arg0) {
|
|
3712
|
+
const ret = arg0.values();
|
|
3713
|
+
return ret;
|
|
3714
|
+
};
|
|
3715
|
+
|
|
3716
|
+
module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
|
|
3717
|
+
const ret = arg0.versions;
|
|
3718
|
+
return ret;
|
|
3719
|
+
};
|
|
3720
|
+
|
|
3721
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
3722
|
+
const ret = debugString(arg1);
|
|
3723
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3724
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3725
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3726
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3727
|
+
};
|
|
3728
|
+
|
|
3729
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
3730
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
3731
|
+
return ret;
|
|
3732
|
+
};
|
|
3733
|
+
|
|
3734
|
+
module.exports.__wbindgen_init_externref_table = function() {
|
|
3735
|
+
const table = wasm.__wbindgen_export_2;
|
|
3736
|
+
const offset = table.grow(4);
|
|
3737
|
+
table.set(0, undefined);
|
|
3738
|
+
table.set(offset + 0, undefined);
|
|
3739
|
+
table.set(offset + 1, null);
|
|
3740
|
+
table.set(offset + 2, true);
|
|
3741
|
+
table.set(offset + 3, false);
|
|
3742
|
+
;
|
|
3743
|
+
};
|
|
3744
|
+
|
|
3745
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
3746
|
+
const ret = typeof(arg0) === 'function';
|
|
3747
|
+
return ret;
|
|
3748
|
+
};
|
|
3749
|
+
|
|
3750
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
3751
|
+
const val = arg0;
|
|
3752
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
3753
|
+
return ret;
|
|
3754
|
+
};
|
|
3755
|
+
|
|
3756
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
3757
|
+
const ret = typeof(arg0) === 'string';
|
|
3758
|
+
return ret;
|
|
3759
|
+
};
|
|
3760
|
+
|
|
3761
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
3762
|
+
const ret = arg0 === undefined;
|
|
3763
|
+
return ret;
|
|
3764
|
+
};
|
|
3765
|
+
|
|
3766
|
+
module.exports.__wbindgen_memory = function() {
|
|
3767
|
+
const ret = wasm.memory;
|
|
3768
|
+
return ret;
|
|
3769
|
+
};
|
|
3770
|
+
|
|
3771
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
3772
|
+
const obj = arg1;
|
|
3773
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
3774
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
3775
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3776
|
+
};
|
|
3777
|
+
|
|
3778
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
3779
|
+
const obj = arg1;
|
|
3780
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
3781
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3782
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3783
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3784
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3785
|
+
};
|
|
3786
|
+
|
|
3787
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
3788
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3789
|
+
return ret;
|
|
3790
|
+
};
|
|
3791
|
+
|
|
3792
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
3793
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3794
|
+
};
|
|
3795
|
+
|
|
3796
|
+
const path = require('path').join(__dirname, 'yellowstone_grpc_solana_encoding_wasm_bg.wasm');
|
|
3797
|
+
const bytes = require('fs').readFileSync(path);
|
|
3798
|
+
|
|
3799
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
|
3800
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
3801
|
+
wasm = wasmInstance.exports;
|
|
3802
|
+
module.exports.__wasm = wasm;
|
|
3803
|
+
|
|
3804
|
+
wasm.__wbindgen_start();
|
|
3805
|
+
|