@premai/reticle 0.3.0
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/README.md +113 -0
- package/package.json +30 -0
- package/prem_rs.d.ts +327 -0
- package/prem_rs.js +9 -0
- package/prem_rs_bg.js +1959 -0
- package/prem_rs_bg.wasm +0 -0
- package/prem_rs_main.js +1983 -0
package/prem_rs_main.js
ADDED
|
@@ -0,0 +1,1983 @@
|
|
|
1
|
+
/* @ts-self-types="./prem_rs.d.ts" */
|
|
2
|
+
|
|
3
|
+
class AttestHeaders {
|
|
4
|
+
static __wrap(ptr) {
|
|
5
|
+
ptr = ptr >>> 0;
|
|
6
|
+
const obj = Object.create(AttestHeaders.prototype);
|
|
7
|
+
obj.__wbg_ptr = ptr;
|
|
8
|
+
AttestHeadersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
9
|
+
return obj;
|
|
10
|
+
}
|
|
11
|
+
__destroy_into_raw() {
|
|
12
|
+
const ptr = this.__wbg_ptr;
|
|
13
|
+
this.__wbg_ptr = 0;
|
|
14
|
+
AttestHeadersFinalization.unregister(this);
|
|
15
|
+
return ptr;
|
|
16
|
+
}
|
|
17
|
+
free() {
|
|
18
|
+
const ptr = this.__destroy_into_raw();
|
|
19
|
+
wasm.__wbg_attestheaders_free(ptr, 0);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @returns {ResponseHeaders | undefined}
|
|
23
|
+
*/
|
|
24
|
+
cpu() {
|
|
25
|
+
const ret = wasm.attestheaders_cpu(this.__wbg_ptr);
|
|
26
|
+
return ret === 0 ? undefined : ResponseHeaders.__wrap(ret);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @returns {ResponseHeaders | undefined}
|
|
30
|
+
*/
|
|
31
|
+
gpu() {
|
|
32
|
+
const ret = wasm.attestheaders_gpu(this.__wbg_ptr);
|
|
33
|
+
return ret === 0 ? undefined : ResponseHeaders.__wrap(ret);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (Symbol.dispose) AttestHeaders.prototype[Symbol.dispose] = AttestHeaders.prototype.free;
|
|
37
|
+
exports.AttestHeaders = AttestHeaders;
|
|
38
|
+
|
|
39
|
+
class AttestResult {
|
|
40
|
+
static __wrap(ptr) {
|
|
41
|
+
ptr = ptr >>> 0;
|
|
42
|
+
const obj = Object.create(AttestResult.prototype);
|
|
43
|
+
obj.__wbg_ptr = ptr;
|
|
44
|
+
AttestResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
__destroy_into_raw() {
|
|
48
|
+
const ptr = this.__wbg_ptr;
|
|
49
|
+
this.__wbg_ptr = 0;
|
|
50
|
+
AttestResultFinalization.unregister(this);
|
|
51
|
+
return ptr;
|
|
52
|
+
}
|
|
53
|
+
free() {
|
|
54
|
+
const ptr = this.__destroy_into_raw();
|
|
55
|
+
wasm.__wbg_attestresult_free(ptr, 0);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @returns {AttestHeaders}
|
|
59
|
+
*/
|
|
60
|
+
headers() {
|
|
61
|
+
const ret = wasm.attestresult_headers(this.__wbg_ptr);
|
|
62
|
+
return AttestHeaders.__wrap(ret);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @returns {Modules}
|
|
66
|
+
*/
|
|
67
|
+
modules() {
|
|
68
|
+
const ret = wasm.attestresult_modules(this.__wbg_ptr);
|
|
69
|
+
return Modules.__wrap(ret);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (Symbol.dispose) AttestResult.prototype[Symbol.dispose] = AttestResult.prototype.free;
|
|
73
|
+
exports.AttestResult = AttestResult;
|
|
74
|
+
|
|
75
|
+
class Client {
|
|
76
|
+
static __wrap(ptr) {
|
|
77
|
+
ptr = ptr >>> 0;
|
|
78
|
+
const obj = Object.create(Client.prototype);
|
|
79
|
+
obj.__wbg_ptr = ptr;
|
|
80
|
+
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
__destroy_into_raw() {
|
|
84
|
+
const ptr = this.__wbg_ptr;
|
|
85
|
+
this.__wbg_ptr = 0;
|
|
86
|
+
ClientFinalization.unregister(this);
|
|
87
|
+
return ptr;
|
|
88
|
+
}
|
|
89
|
+
free() {
|
|
90
|
+
const ptr = this.__destroy_into_raw();
|
|
91
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Steps:
|
|
95
|
+
* - Gathers modules to attest from attestation server
|
|
96
|
+
* - Iterates through each module and performs end-to-end attestation
|
|
97
|
+
* - Returns the list of attested modules
|
|
98
|
+
* @param {QueryParams | null} [query]
|
|
99
|
+
* @returns {Promise<AttestResult>}
|
|
100
|
+
*/
|
|
101
|
+
attest(query) {
|
|
102
|
+
let ptr0 = 0;
|
|
103
|
+
if (!isLikeNone(query)) {
|
|
104
|
+
_assertClass(query, QueryParams);
|
|
105
|
+
ptr0 = query.__destroy_into_raw();
|
|
106
|
+
}
|
|
107
|
+
const ret = wasm.client_attest(this.__wbg_ptr, ptr0);
|
|
108
|
+
return ret;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Completes end-to-end nvidia attestation. Generates nonce and validates claims all in one
|
|
112
|
+
* @param {QueryParams | null} [query]
|
|
113
|
+
* @returns {Promise<ResponseHeaders>}
|
|
114
|
+
*/
|
|
115
|
+
attest_nvidia(query) {
|
|
116
|
+
let ptr0 = 0;
|
|
117
|
+
if (!isLikeNone(query)) {
|
|
118
|
+
_assertClass(query, QueryParams);
|
|
119
|
+
ptr0 = query.__destroy_into_raw();
|
|
120
|
+
}
|
|
121
|
+
const ret = wasm.client_attest_nvidia(this.__wbg_ptr, ptr0);
|
|
122
|
+
return ret;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Performs end-to-end sev-snp attestation. Generates nonce and validates claims all in one
|
|
126
|
+
* @param {QueryParams | null} [query]
|
|
127
|
+
* @returns {Promise<void>}
|
|
128
|
+
*/
|
|
129
|
+
attest_sev(query) {
|
|
130
|
+
let ptr0 = 0;
|
|
131
|
+
if (!isLikeNone(query)) {
|
|
132
|
+
_assertClass(query, QueryParams);
|
|
133
|
+
ptr0 = query.__destroy_into_raw();
|
|
134
|
+
}
|
|
135
|
+
const ret = wasm.client_attest_sev(this.__wbg_ptr, ptr0);
|
|
136
|
+
return ret;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Performs end-to-end tdx attestation. Generates nonce and validates claims all in one
|
|
140
|
+
* @param {QueryParams | null} [query]
|
|
141
|
+
* @returns {Promise<void>}
|
|
142
|
+
*/
|
|
143
|
+
attest_tdx(query) {
|
|
144
|
+
let ptr0 = 0;
|
|
145
|
+
if (!isLikeNone(query)) {
|
|
146
|
+
_assertClass(query, QueryParams);
|
|
147
|
+
ptr0 = query.__destroy_into_raw();
|
|
148
|
+
}
|
|
149
|
+
const ret = wasm.client_attest_tdx(this.__wbg_ptr, ptr0);
|
|
150
|
+
return ret;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Gather available attestable modules from remote attestation endpoint
|
|
154
|
+
* @param {QueryParams | null} [query]
|
|
155
|
+
* @returns {Promise<Modules>}
|
|
156
|
+
*/
|
|
157
|
+
request_modules(query) {
|
|
158
|
+
let ptr0 = 0;
|
|
159
|
+
if (!isLikeNone(query)) {
|
|
160
|
+
_assertClass(query, QueryParams);
|
|
161
|
+
ptr0 = query.__destroy_into_raw();
|
|
162
|
+
}
|
|
163
|
+
const ret = wasm.client_request_modules(this.__wbg_ptr, ptr0);
|
|
164
|
+
return ret;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Requests and parses an Nvidia EATToken attestation from the attestation server
|
|
168
|
+
*
|
|
169
|
+
* ### Warning
|
|
170
|
+
* This method exposes core functionality and does not perform cryptographic
|
|
171
|
+
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
172
|
+
* please refer to [`Self::attest_nvidia`]
|
|
173
|
+
* @param {NvidiaNonce} nonce
|
|
174
|
+
* @param {QueryParams} query
|
|
175
|
+
* @returns {Promise<NvidiaAttestResult>}
|
|
176
|
+
*/
|
|
177
|
+
request_nvidia(nonce, query) {
|
|
178
|
+
_assertClass(nonce, NvidiaNonce);
|
|
179
|
+
_assertClass(query, QueryParams);
|
|
180
|
+
const ret = wasm.client_request_nvidia(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
|
|
181
|
+
return ret;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Requests and parses a SEV-SNP attestation from the attestation server.
|
|
185
|
+
*
|
|
186
|
+
* ### Warning
|
|
187
|
+
* This method exposes core functionality and does not perform cryptographic
|
|
188
|
+
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
189
|
+
* please refer to [`Self::attest_sev`]
|
|
190
|
+
* @param {SevNonce} nonce
|
|
191
|
+
* @param {QueryParams} query
|
|
192
|
+
* @returns {Promise<ParsedAttestation>}
|
|
193
|
+
*/
|
|
194
|
+
request_sev(nonce, query) {
|
|
195
|
+
_assertClass(nonce, SevNonce);
|
|
196
|
+
_assertClass(query, QueryParams);
|
|
197
|
+
const ret = wasm.client_request_sev(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
|
|
198
|
+
return ret;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Requests and parses a TDX quote
|
|
202
|
+
*
|
|
203
|
+
* ### Warning
|
|
204
|
+
* This method exposes core functionality and does not perform cryptographic
|
|
205
|
+
* or measurement checks on the attestation. If you want to perform end-to-end attestation
|
|
206
|
+
* please refer to [`Self::attest_tdx`]
|
|
207
|
+
* @param {TdxNonce} nonce
|
|
208
|
+
* @param {QueryParams} query
|
|
209
|
+
* @returns {Promise<TdxQuote>}
|
|
210
|
+
*/
|
|
211
|
+
request_tdx(nonce, query) {
|
|
212
|
+
_assertClass(nonce, TdxNonce);
|
|
213
|
+
_assertClass(query, QueryParams);
|
|
214
|
+
const ret = wasm.client_request_tdx(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
|
|
215
|
+
return ret;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
219
|
+
exports.Client = Client;
|
|
220
|
+
|
|
221
|
+
class ClientBuilder {
|
|
222
|
+
static __wrap(ptr) {
|
|
223
|
+
ptr = ptr >>> 0;
|
|
224
|
+
const obj = Object.create(ClientBuilder.prototype);
|
|
225
|
+
obj.__wbg_ptr = ptr;
|
|
226
|
+
ClientBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
227
|
+
return obj;
|
|
228
|
+
}
|
|
229
|
+
__destroy_into_raw() {
|
|
230
|
+
const ptr = this.__wbg_ptr;
|
|
231
|
+
this.__wbg_ptr = 0;
|
|
232
|
+
ClientBuilderFinalization.unregister(this);
|
|
233
|
+
return ptr;
|
|
234
|
+
}
|
|
235
|
+
free() {
|
|
236
|
+
const ptr = this.__destroy_into_raw();
|
|
237
|
+
wasm.__wbg_clientbuilder_free(ptr, 0);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* @returns {Promise<Client>}
|
|
241
|
+
*/
|
|
242
|
+
build() {
|
|
243
|
+
const ptr = this.__destroy_into_raw();
|
|
244
|
+
const ret = wasm.clientbuilder_build(ptr);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @param {string} url
|
|
249
|
+
*/
|
|
250
|
+
constructor(url) {
|
|
251
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
253
|
+
const ret = wasm.clientbuilder_new(ptr0, len0);
|
|
254
|
+
this.__wbg_ptr = ret >>> 0;
|
|
255
|
+
ClientBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
256
|
+
return this;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Sets `Authorization` header
|
|
260
|
+
* @param {string} token
|
|
261
|
+
* @returns {ClientBuilder}
|
|
262
|
+
*/
|
|
263
|
+
with_authorization(token) {
|
|
264
|
+
const ptr = this.__destroy_into_raw();
|
|
265
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
266
|
+
const len0 = WASM_VECTOR_LEN;
|
|
267
|
+
const ret = wasm.clientbuilder_with_authorization(ptr, ptr0, len0);
|
|
268
|
+
if (ret[2]) {
|
|
269
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
270
|
+
}
|
|
271
|
+
return ClientBuilder.__wrap(ret[0]);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Sets custom KDS for AMD collateral server
|
|
275
|
+
* @param {Kds} kds
|
|
276
|
+
* @returns {ClientBuilder}
|
|
277
|
+
*/
|
|
278
|
+
with_kds(kds) {
|
|
279
|
+
const ptr = this.__destroy_into_raw();
|
|
280
|
+
_assertClass(kds, Kds);
|
|
281
|
+
var ptr0 = kds.__destroy_into_raw();
|
|
282
|
+
const ret = wasm.clientbuilder_with_kds(ptr, ptr0);
|
|
283
|
+
return ClientBuilder.__wrap(ret);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Sets custom PCS for Intel collateral server
|
|
287
|
+
* @param {Pcs} pcs
|
|
288
|
+
* @returns {ClientBuilder}
|
|
289
|
+
*/
|
|
290
|
+
with_pcs(pcs) {
|
|
291
|
+
const ptr = this.__destroy_into_raw();
|
|
292
|
+
_assertClass(pcs, Pcs);
|
|
293
|
+
var ptr0 = pcs.__destroy_into_raw();
|
|
294
|
+
const ret = wasm.clientbuilder_with_pcs(ptr, ptr0);
|
|
295
|
+
return ClientBuilder.__wrap(ret);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* sets custom url for OPA policies index
|
|
299
|
+
* @param {string} url
|
|
300
|
+
* @returns {ClientBuilder}
|
|
301
|
+
*/
|
|
302
|
+
with_policies_url(url) {
|
|
303
|
+
const ptr = this.__destroy_into_raw();
|
|
304
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
|
+
const len0 = WASM_VECTOR_LEN;
|
|
306
|
+
const ret = wasm.clientbuilder_with_policies_url(ptr, ptr0, len0);
|
|
307
|
+
return ClientBuilder.__wrap(ret);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (Symbol.dispose) ClientBuilder.prototype[Symbol.dispose] = ClientBuilder.prototype.free;
|
|
311
|
+
exports.ClientBuilder = ClientBuilder;
|
|
312
|
+
|
|
313
|
+
class Collateral {
|
|
314
|
+
static __wrap(ptr) {
|
|
315
|
+
ptr = ptr >>> 0;
|
|
316
|
+
const obj = Object.create(Collateral.prototype);
|
|
317
|
+
obj.__wbg_ptr = ptr;
|
|
318
|
+
CollateralFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
319
|
+
return obj;
|
|
320
|
+
}
|
|
321
|
+
__destroy_into_raw() {
|
|
322
|
+
const ptr = this.__wbg_ptr;
|
|
323
|
+
this.__wbg_ptr = 0;
|
|
324
|
+
CollateralFinalization.unregister(this);
|
|
325
|
+
return ptr;
|
|
326
|
+
}
|
|
327
|
+
free() {
|
|
328
|
+
const ptr = this.__destroy_into_raw();
|
|
329
|
+
wasm.__wbg_collateral_free(ptr, 0);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (Symbol.dispose) Collateral.prototype[Symbol.dispose] = Collateral.prototype.free;
|
|
333
|
+
exports.Collateral = Collateral;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @enum {0 | 1}
|
|
337
|
+
*/
|
|
338
|
+
const CpuModule = Object.freeze({
|
|
339
|
+
Sev: 0, "0": "Sev",
|
|
340
|
+
Tdx: 1, "1": "Tdx",
|
|
341
|
+
});
|
|
342
|
+
exports.CpuModule = CpuModule;
|
|
343
|
+
|
|
344
|
+
class GatewayError {
|
|
345
|
+
static __wrap(ptr) {
|
|
346
|
+
ptr = ptr >>> 0;
|
|
347
|
+
const obj = Object.create(GatewayError.prototype);
|
|
348
|
+
obj.__wbg_ptr = ptr;
|
|
349
|
+
GatewayErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
350
|
+
return obj;
|
|
351
|
+
}
|
|
352
|
+
__destroy_into_raw() {
|
|
353
|
+
const ptr = this.__wbg_ptr;
|
|
354
|
+
this.__wbg_ptr = 0;
|
|
355
|
+
GatewayErrorFinalization.unregister(this);
|
|
356
|
+
return ptr;
|
|
357
|
+
}
|
|
358
|
+
free() {
|
|
359
|
+
const ptr = this.__destroy_into_raw();
|
|
360
|
+
wasm.__wbg_gatewayerror_free(ptr, 0);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @returns {string}
|
|
364
|
+
*/
|
|
365
|
+
get message() {
|
|
366
|
+
let deferred1_0;
|
|
367
|
+
let deferred1_1;
|
|
368
|
+
try {
|
|
369
|
+
const ret = wasm.__wbg_get_gatewayerror_message(this.__wbg_ptr);
|
|
370
|
+
deferred1_0 = ret[0];
|
|
371
|
+
deferred1_1 = ret[1];
|
|
372
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
373
|
+
} finally {
|
|
374
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* @param {string} arg0
|
|
379
|
+
*/
|
|
380
|
+
set message(arg0) {
|
|
381
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
382
|
+
const len0 = WASM_VECTOR_LEN;
|
|
383
|
+
wasm.__wbg_set_gatewayerror_message(this.__wbg_ptr, ptr0, len0);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (Symbol.dispose) GatewayError.prototype[Symbol.dispose] = GatewayError.prototype.free;
|
|
387
|
+
exports.GatewayError = GatewayError;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @enum {0}
|
|
391
|
+
*/
|
|
392
|
+
const GpuModule = Object.freeze({
|
|
393
|
+
Nvidia: 0, "0": "Nvidia",
|
|
394
|
+
});
|
|
395
|
+
exports.GpuModule = GpuModule;
|
|
396
|
+
|
|
397
|
+
class Modules {
|
|
398
|
+
static __wrap(ptr) {
|
|
399
|
+
ptr = ptr >>> 0;
|
|
400
|
+
const obj = Object.create(Modules.prototype);
|
|
401
|
+
obj.__wbg_ptr = ptr;
|
|
402
|
+
ModulesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
403
|
+
return obj;
|
|
404
|
+
}
|
|
405
|
+
__destroy_into_raw() {
|
|
406
|
+
const ptr = this.__wbg_ptr;
|
|
407
|
+
this.__wbg_ptr = 0;
|
|
408
|
+
ModulesFinalization.unregister(this);
|
|
409
|
+
return ptr;
|
|
410
|
+
}
|
|
411
|
+
free() {
|
|
412
|
+
const ptr = this.__destroy_into_raw();
|
|
413
|
+
wasm.__wbg_modules_free(ptr, 0);
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @returns {CpuModule}
|
|
417
|
+
*/
|
|
418
|
+
cpu() {
|
|
419
|
+
const ret = wasm.modules_cpu(this.__wbg_ptr);
|
|
420
|
+
return ret;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* @returns {GpuModule | undefined}
|
|
424
|
+
*/
|
|
425
|
+
gpu() {
|
|
426
|
+
const ret = wasm.modules_gpu(this.__wbg_ptr);
|
|
427
|
+
return ret === 1 ? undefined : ret;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* @returns {boolean}
|
|
431
|
+
*/
|
|
432
|
+
has_gpu() {
|
|
433
|
+
const ret = wasm.modules_has_gpu(this.__wbg_ptr);
|
|
434
|
+
return ret !== 0;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
if (Symbol.dispose) Modules.prototype[Symbol.dispose] = Modules.prototype.free;
|
|
438
|
+
exports.Modules = Modules;
|
|
439
|
+
|
|
440
|
+
class NvidiaAttestResult {
|
|
441
|
+
static __wrap(ptr) {
|
|
442
|
+
ptr = ptr >>> 0;
|
|
443
|
+
const obj = Object.create(NvidiaAttestResult.prototype);
|
|
444
|
+
obj.__wbg_ptr = ptr;
|
|
445
|
+
NvidiaAttestResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
446
|
+
return obj;
|
|
447
|
+
}
|
|
448
|
+
__destroy_into_raw() {
|
|
449
|
+
const ptr = this.__wbg_ptr;
|
|
450
|
+
this.__wbg_ptr = 0;
|
|
451
|
+
NvidiaAttestResultFinalization.unregister(this);
|
|
452
|
+
return ptr;
|
|
453
|
+
}
|
|
454
|
+
free() {
|
|
455
|
+
const ptr = this.__destroy_into_raw();
|
|
456
|
+
wasm.__wbg_nvidiaattestresult_free(ptr, 0);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (Symbol.dispose) NvidiaAttestResult.prototype[Symbol.dispose] = NvidiaAttestResult.prototype.free;
|
|
460
|
+
exports.NvidiaAttestResult = NvidiaAttestResult;
|
|
461
|
+
|
|
462
|
+
class Pcs {
|
|
463
|
+
__destroy_into_raw() {
|
|
464
|
+
const ptr = this.__wbg_ptr;
|
|
465
|
+
this.__wbg_ptr = 0;
|
|
466
|
+
PcsFinalization.unregister(this);
|
|
467
|
+
return ptr;
|
|
468
|
+
}
|
|
469
|
+
free() {
|
|
470
|
+
const ptr = this.__destroy_into_raw();
|
|
471
|
+
wasm.__wbg_pcs_free(ptr, 0);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* @param {TdxQuote} quote
|
|
475
|
+
* @returns {Promise<Collateral>}
|
|
476
|
+
*/
|
|
477
|
+
fetch_collateral(quote) {
|
|
478
|
+
_assertClass(quote, TdxQuote);
|
|
479
|
+
const ret = wasm.pcs_fetch_collateral(this.__wbg_ptr, quote.__wbg_ptr);
|
|
480
|
+
return ret;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* @param {string} base_url
|
|
484
|
+
*/
|
|
485
|
+
constructor(base_url) {
|
|
486
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
|
+
const len0 = WASM_VECTOR_LEN;
|
|
488
|
+
const ret = wasm.pcs_new(ptr0, len0);
|
|
489
|
+
if (ret[2]) {
|
|
490
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
491
|
+
}
|
|
492
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
493
|
+
PcsFinalization.register(this, this.__wbg_ptr, this);
|
|
494
|
+
return this;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (Symbol.dispose) Pcs.prototype[Symbol.dispose] = Pcs.prototype.free;
|
|
498
|
+
exports.Pcs = Pcs;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Generic per-request query parameters.
|
|
502
|
+
*
|
|
503
|
+
* The `nonce` key is reserved and will be rejected.
|
|
504
|
+
*/
|
|
505
|
+
class QueryParams {
|
|
506
|
+
static __wrap(ptr) {
|
|
507
|
+
ptr = ptr >>> 0;
|
|
508
|
+
const obj = Object.create(QueryParams.prototype);
|
|
509
|
+
obj.__wbg_ptr = ptr;
|
|
510
|
+
QueryParamsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
511
|
+
return obj;
|
|
512
|
+
}
|
|
513
|
+
__destroy_into_raw() {
|
|
514
|
+
const ptr = this.__wbg_ptr;
|
|
515
|
+
this.__wbg_ptr = 0;
|
|
516
|
+
QueryParamsFinalization.unregister(this);
|
|
517
|
+
return ptr;
|
|
518
|
+
}
|
|
519
|
+
free() {
|
|
520
|
+
const ptr = this.__destroy_into_raw();
|
|
521
|
+
wasm.__wbg_queryparams_free(ptr, 0);
|
|
522
|
+
}
|
|
523
|
+
constructor() {
|
|
524
|
+
const ret = wasm.queryparams_new();
|
|
525
|
+
this.__wbg_ptr = ret >>> 0;
|
|
526
|
+
QueryParamsFinalization.register(this, this.__wbg_ptr, this);
|
|
527
|
+
return this;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Appends a query parameter.
|
|
531
|
+
*
|
|
532
|
+
* Reserved keywords for specific queries will get overwritten
|
|
533
|
+
* @param {string} key
|
|
534
|
+
* @param {string} value
|
|
535
|
+
* @returns {QueryParams}
|
|
536
|
+
*/
|
|
537
|
+
with(key, value) {
|
|
538
|
+
const ptr = this.__destroy_into_raw();
|
|
539
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
|
+
const len0 = WASM_VECTOR_LEN;
|
|
541
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
542
|
+
const len1 = WASM_VECTOR_LEN;
|
|
543
|
+
const ret = wasm.queryparams_with(ptr, ptr0, len0, ptr1, len1);
|
|
544
|
+
return QueryParams.__wrap(ret);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (Symbol.dispose) QueryParams.prototype[Symbol.dispose] = QueryParams.prototype.free;
|
|
548
|
+
exports.QueryParams = QueryParams;
|
|
549
|
+
|
|
550
|
+
class QuoteVerifier {
|
|
551
|
+
__destroy_into_raw() {
|
|
552
|
+
const ptr = this.__wbg_ptr;
|
|
553
|
+
this.__wbg_ptr = 0;
|
|
554
|
+
QuoteVerifierFinalization.unregister(this);
|
|
555
|
+
return ptr;
|
|
556
|
+
}
|
|
557
|
+
free() {
|
|
558
|
+
const ptr = this.__destroy_into_raw();
|
|
559
|
+
wasm.__wbg_quoteverifier_free(ptr, 0);
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* @param {Collateral} collateral
|
|
563
|
+
* @param {TdxQuote} quote
|
|
564
|
+
*/
|
|
565
|
+
constructor(collateral, quote) {
|
|
566
|
+
_assertClass(collateral, Collateral);
|
|
567
|
+
var ptr0 = collateral.__destroy_into_raw();
|
|
568
|
+
_assertClass(quote, TdxQuote);
|
|
569
|
+
var ptr1 = quote.__destroy_into_raw();
|
|
570
|
+
const ret = wasm.quoteverifier_new(ptr0, ptr1);
|
|
571
|
+
this.__wbg_ptr = ret >>> 0;
|
|
572
|
+
QuoteVerifierFinalization.register(this, this.__wbg_ptr, this);
|
|
573
|
+
return this;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* @param {TdxNonce} nonce
|
|
577
|
+
*/
|
|
578
|
+
verify(nonce) {
|
|
579
|
+
_assertClass(nonce, TdxNonce);
|
|
580
|
+
const ret = wasm.quoteverifier_verify(this.__wbg_ptr, nonce.__wbg_ptr);
|
|
581
|
+
if (ret[1]) {
|
|
582
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
if (Symbol.dispose) QuoteVerifier.prototype[Symbol.dispose] = QuoteVerifier.prototype.free;
|
|
587
|
+
exports.QuoteVerifier = QuoteVerifier;
|
|
588
|
+
|
|
589
|
+
class ResponseHeaders {
|
|
590
|
+
static __wrap(ptr) {
|
|
591
|
+
ptr = ptr >>> 0;
|
|
592
|
+
const obj = Object.create(ResponseHeaders.prototype);
|
|
593
|
+
obj.__wbg_ptr = ptr;
|
|
594
|
+
ResponseHeadersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
595
|
+
return obj;
|
|
596
|
+
}
|
|
597
|
+
__destroy_into_raw() {
|
|
598
|
+
const ptr = this.__wbg_ptr;
|
|
599
|
+
this.__wbg_ptr = 0;
|
|
600
|
+
ResponseHeadersFinalization.unregister(this);
|
|
601
|
+
return ptr;
|
|
602
|
+
}
|
|
603
|
+
free() {
|
|
604
|
+
const ptr = this.__destroy_into_raw();
|
|
605
|
+
wasm.__wbg_responseheaders_free(ptr, 0);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* @param {string} name
|
|
609
|
+
* @returns {string | undefined}
|
|
610
|
+
*/
|
|
611
|
+
get(name) {
|
|
612
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
613
|
+
const len0 = WASM_VECTOR_LEN;
|
|
614
|
+
const ret = wasm.responseheaders_get(this.__wbg_ptr, ptr0, len0);
|
|
615
|
+
let v2;
|
|
616
|
+
if (ret[0] !== 0) {
|
|
617
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
618
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
619
|
+
}
|
|
620
|
+
return v2;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* @returns {string[]}
|
|
624
|
+
*/
|
|
625
|
+
keys() {
|
|
626
|
+
const ret = wasm.responseheaders_keys(this.__wbg_ptr);
|
|
627
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
628
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
629
|
+
return v1;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (Symbol.dispose) ResponseHeaders.prototype[Symbol.dispose] = ResponseHeaders.prototype.free;
|
|
633
|
+
exports.ResponseHeaders = ResponseHeaders;
|
|
634
|
+
|
|
635
|
+
class TcbLevels {
|
|
636
|
+
__destroy_into_raw() {
|
|
637
|
+
const ptr = this.__wbg_ptr;
|
|
638
|
+
this.__wbg_ptr = 0;
|
|
639
|
+
TcbLevelsFinalization.unregister(this);
|
|
640
|
+
return ptr;
|
|
641
|
+
}
|
|
642
|
+
free() {
|
|
643
|
+
const ptr = this.__destroy_into_raw();
|
|
644
|
+
wasm.__wbg_tcblevels_free(ptr, 0);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (Symbol.dispose) TcbLevels.prototype[Symbol.dispose] = TcbLevels.prototype.free;
|
|
648
|
+
exports.TcbLevels = TcbLevels;
|
|
649
|
+
|
|
650
|
+
class TdxNonce {
|
|
651
|
+
__destroy_into_raw() {
|
|
652
|
+
const ptr = this.__wbg_ptr;
|
|
653
|
+
this.__wbg_ptr = 0;
|
|
654
|
+
TdxNonceFinalization.unregister(this);
|
|
655
|
+
return ptr;
|
|
656
|
+
}
|
|
657
|
+
free() {
|
|
658
|
+
const ptr = this.__destroy_into_raw();
|
|
659
|
+
wasm.__wbg_tdxnonce_free(ptr, 0);
|
|
660
|
+
}
|
|
661
|
+
constructor() {
|
|
662
|
+
const ret = wasm.tdxnonce_generate();
|
|
663
|
+
this.__wbg_ptr = ret >>> 0;
|
|
664
|
+
TdxNonceFinalization.register(this, this.__wbg_ptr, this);
|
|
665
|
+
return this;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* @returns {string}
|
|
669
|
+
*/
|
|
670
|
+
to_hex() {
|
|
671
|
+
let deferred1_0;
|
|
672
|
+
let deferred1_1;
|
|
673
|
+
try {
|
|
674
|
+
const ret = wasm.tdxnonce_to_hex(this.__wbg_ptr);
|
|
675
|
+
deferred1_0 = ret[0];
|
|
676
|
+
deferred1_1 = ret[1];
|
|
677
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
678
|
+
} finally {
|
|
679
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (Symbol.dispose) TdxNonce.prototype[Symbol.dispose] = TdxNonce.prototype.free;
|
|
684
|
+
exports.TdxNonce = TdxNonce;
|
|
685
|
+
|
|
686
|
+
class TdxQuote {
|
|
687
|
+
static __wrap(ptr) {
|
|
688
|
+
ptr = ptr >>> 0;
|
|
689
|
+
const obj = Object.create(TdxQuote.prototype);
|
|
690
|
+
obj.__wbg_ptr = ptr;
|
|
691
|
+
TdxQuoteFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
692
|
+
return obj;
|
|
693
|
+
}
|
|
694
|
+
__destroy_into_raw() {
|
|
695
|
+
const ptr = this.__wbg_ptr;
|
|
696
|
+
this.__wbg_ptr = 0;
|
|
697
|
+
TdxQuoteFinalization.unregister(this);
|
|
698
|
+
return ptr;
|
|
699
|
+
}
|
|
700
|
+
free() {
|
|
701
|
+
const ptr = this.__destroy_into_raw();
|
|
702
|
+
wasm.__wbg_tdxquote_free(ptr, 0);
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Attempts to parse a quote from DCAP bytes.
|
|
706
|
+
* @param {Uint8Array} quote
|
|
707
|
+
* @returns {TdxQuote}
|
|
708
|
+
*/
|
|
709
|
+
static from_bytes(quote) {
|
|
710
|
+
const ptr0 = passArray8ToWasm0(quote, wasm.__wbindgen_malloc);
|
|
711
|
+
const len0 = WASM_VECTOR_LEN;
|
|
712
|
+
const ret = wasm.tdxquote_from_bytes(ptr0, len0);
|
|
713
|
+
if (ret[2]) {
|
|
714
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
715
|
+
}
|
|
716
|
+
return TdxQuote.__wrap(ret[0]);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
if (Symbol.dispose) TdxQuote.prototype[Symbol.dispose] = TdxQuote.prototype.free;
|
|
720
|
+
exports.TdxQuote = TdxQuote;
|
|
721
|
+
|
|
722
|
+
class DecodedClaims {
|
|
723
|
+
static __wrap(ptr) {
|
|
724
|
+
ptr = ptr >>> 0;
|
|
725
|
+
const obj = Object.create(DecodedClaims.prototype);
|
|
726
|
+
obj.__wbg_ptr = ptr;
|
|
727
|
+
DecodedClaimsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
728
|
+
return obj;
|
|
729
|
+
}
|
|
730
|
+
__destroy_into_raw() {
|
|
731
|
+
const ptr = this.__wbg_ptr;
|
|
732
|
+
this.__wbg_ptr = 0;
|
|
733
|
+
DecodedClaimsFinalization.unregister(this);
|
|
734
|
+
return ptr;
|
|
735
|
+
}
|
|
736
|
+
free() {
|
|
737
|
+
const ptr = this.__destroy_into_raw();
|
|
738
|
+
wasm.__wbg_nvidia__decodedclaims_free(ptr, 0);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (Symbol.dispose) DecodedClaims.prototype[Symbol.dispose] = DecodedClaims.prototype.free;
|
|
742
|
+
|
|
743
|
+
class EATToken {
|
|
744
|
+
static __wrap(ptr) {
|
|
745
|
+
ptr = ptr >>> 0;
|
|
746
|
+
const obj = Object.create(EATToken.prototype);
|
|
747
|
+
obj.__wbg_ptr = ptr;
|
|
748
|
+
EATTokenFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
749
|
+
return obj;
|
|
750
|
+
}
|
|
751
|
+
__destroy_into_raw() {
|
|
752
|
+
const ptr = this.__wbg_ptr;
|
|
753
|
+
this.__wbg_ptr = 0;
|
|
754
|
+
EATTokenFinalization.unregister(this);
|
|
755
|
+
return ptr;
|
|
756
|
+
}
|
|
757
|
+
free() {
|
|
758
|
+
const ptr = this.__destroy_into_raw();
|
|
759
|
+
wasm.__wbg_nvidia__eattoken_free(ptr, 0);
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* @param {string} from
|
|
763
|
+
* @returns {EATToken}
|
|
764
|
+
*/
|
|
765
|
+
static parse(from) {
|
|
766
|
+
const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
767
|
+
const len0 = WASM_VECTOR_LEN;
|
|
768
|
+
const ret = wasm.eattoken_parse(ptr0, len0);
|
|
769
|
+
if (ret[2]) {
|
|
770
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
771
|
+
}
|
|
772
|
+
return EATToken.__wrap(ret[0]);
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* @param {KeyChain} keys
|
|
776
|
+
* @param {NvidiaNonce} nonce
|
|
777
|
+
* @returns {DecodedClaims}
|
|
778
|
+
*/
|
|
779
|
+
verify(keys, nonce) {
|
|
780
|
+
const ptr = this.__destroy_into_raw();
|
|
781
|
+
_assertClass(keys, KeyChain);
|
|
782
|
+
_assertClass(nonce, NvidiaNonce);
|
|
783
|
+
const ret = wasm.eattoken_verify(ptr, keys.__wbg_ptr, nonce.__wbg_ptr);
|
|
784
|
+
if (ret[2]) {
|
|
785
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
786
|
+
}
|
|
787
|
+
return DecodedClaims.__wrap(ret[0]);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (Symbol.dispose) EATToken.prototype[Symbol.dispose] = EATToken.prototype.free;
|
|
791
|
+
|
|
792
|
+
class KeyChain {
|
|
793
|
+
static __wrap(ptr) {
|
|
794
|
+
ptr = ptr >>> 0;
|
|
795
|
+
const obj = Object.create(KeyChain.prototype);
|
|
796
|
+
obj.__wbg_ptr = ptr;
|
|
797
|
+
KeyChainFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
798
|
+
return obj;
|
|
799
|
+
}
|
|
800
|
+
__destroy_into_raw() {
|
|
801
|
+
const ptr = this.__wbg_ptr;
|
|
802
|
+
this.__wbg_ptr = 0;
|
|
803
|
+
KeyChainFinalization.unregister(this);
|
|
804
|
+
return ptr;
|
|
805
|
+
}
|
|
806
|
+
free() {
|
|
807
|
+
const ptr = this.__destroy_into_raw();
|
|
808
|
+
wasm.__wbg_nvidia__keychain_free(ptr, 0);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (Symbol.dispose) KeyChain.prototype[Symbol.dispose] = KeyChain.prototype.free;
|
|
812
|
+
|
|
813
|
+
class NvidiaNonce {
|
|
814
|
+
static __wrap(ptr) {
|
|
815
|
+
ptr = ptr >>> 0;
|
|
816
|
+
const obj = Object.create(NvidiaNonce.prototype);
|
|
817
|
+
obj.__wbg_ptr = ptr;
|
|
818
|
+
NvidiaNonceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
819
|
+
return obj;
|
|
820
|
+
}
|
|
821
|
+
__destroy_into_raw() {
|
|
822
|
+
const ptr = this.__wbg_ptr;
|
|
823
|
+
this.__wbg_ptr = 0;
|
|
824
|
+
NvidiaNonceFinalization.unregister(this);
|
|
825
|
+
return ptr;
|
|
826
|
+
}
|
|
827
|
+
free() {
|
|
828
|
+
const ptr = this.__destroy_into_raw();
|
|
829
|
+
wasm.__wbg_nvidia__nvidianonce_free(ptr, 0);
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* @returns {NvidiaNonce}
|
|
833
|
+
*/
|
|
834
|
+
static generate() {
|
|
835
|
+
const ret = wasm.nvidianonce_generate();
|
|
836
|
+
return NvidiaNonce.__wrap(ret);
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* @returns {string}
|
|
840
|
+
*/
|
|
841
|
+
to_hex() {
|
|
842
|
+
let deferred1_0;
|
|
843
|
+
let deferred1_1;
|
|
844
|
+
try {
|
|
845
|
+
const ret = wasm.nvidianonce_to_hex(this.__wbg_ptr);
|
|
846
|
+
deferred1_0 = ret[0];
|
|
847
|
+
deferred1_1 = ret[1];
|
|
848
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
849
|
+
} finally {
|
|
850
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
if (Symbol.dispose) NvidiaNonce.prototype[Symbol.dispose] = NvidiaNonce.prototype.free;
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
|
|
858
|
+
* @returns {Promise<KeyChain>}
|
|
859
|
+
*/
|
|
860
|
+
function fetch_keychain() {
|
|
861
|
+
const ret = wasm.nvidia__fetch_keychain();
|
|
862
|
+
return ret;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
const nvidia = {};
|
|
866
|
+
nvidia.DecodedClaims = DecodedClaims;
|
|
867
|
+
nvidia.EATToken = EATToken;
|
|
868
|
+
nvidia.KeyChain = KeyChain;
|
|
869
|
+
nvidia.NvidiaNonce = NvidiaNonce;
|
|
870
|
+
nvidia.fetch_keychain = fetch_keychain;
|
|
871
|
+
exports.nvidia = nvidia;
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* A parsed certificate revocation list
|
|
875
|
+
*/
|
|
876
|
+
class CRL {
|
|
877
|
+
static __wrap(ptr) {
|
|
878
|
+
ptr = ptr >>> 0;
|
|
879
|
+
const obj = Object.create(CRL.prototype);
|
|
880
|
+
obj.__wbg_ptr = ptr;
|
|
881
|
+
CRLFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
882
|
+
return obj;
|
|
883
|
+
}
|
|
884
|
+
__destroy_into_raw() {
|
|
885
|
+
const ptr = this.__wbg_ptr;
|
|
886
|
+
this.__wbg_ptr = 0;
|
|
887
|
+
CRLFinalization.unregister(this);
|
|
888
|
+
return ptr;
|
|
889
|
+
}
|
|
890
|
+
free() {
|
|
891
|
+
const ptr = this.__destroy_into_raw();
|
|
892
|
+
wasm.__wbg_sev__crl_free(ptr, 0);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Passes if the certificates are not in the certificate revocation list
|
|
896
|
+
* Throws `AttestationError` on fail
|
|
897
|
+
* @param {VerifiedChain} chain
|
|
898
|
+
*/
|
|
899
|
+
check_chain(chain) {
|
|
900
|
+
_assertClass(chain, VerifiedChain);
|
|
901
|
+
const ret = wasm.crl_check_chain(this.__wbg_ptr, chain.__wbg_ptr);
|
|
902
|
+
if (ret[1]) {
|
|
903
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Parses a certificate revocation list from DER format binary data
|
|
908
|
+
* @param {Uint8Array} list
|
|
909
|
+
* @returns {CRL}
|
|
910
|
+
*/
|
|
911
|
+
static from_der(list) {
|
|
912
|
+
const ptr0 = passArray8ToWasm0(list, wasm.__wbindgen_malloc);
|
|
913
|
+
const len0 = WASM_VECTOR_LEN;
|
|
914
|
+
const ret = wasm.crl_from_der(ptr0, len0);
|
|
915
|
+
if (ret[2]) {
|
|
916
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
917
|
+
}
|
|
918
|
+
return CRL.__wrap(ret[0]);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
if (Symbol.dispose) CRL.prototype[Symbol.dispose] = CRL.prototype.free;
|
|
922
|
+
|
|
923
|
+
class ExportPem {
|
|
924
|
+
static __wrap(ptr) {
|
|
925
|
+
ptr = ptr >>> 0;
|
|
926
|
+
const obj = Object.create(ExportPem.prototype);
|
|
927
|
+
obj.__wbg_ptr = ptr;
|
|
928
|
+
ExportPemFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
929
|
+
return obj;
|
|
930
|
+
}
|
|
931
|
+
__destroy_into_raw() {
|
|
932
|
+
const ptr = this.__wbg_ptr;
|
|
933
|
+
this.__wbg_ptr = 0;
|
|
934
|
+
ExportPemFinalization.unregister(this);
|
|
935
|
+
return ptr;
|
|
936
|
+
}
|
|
937
|
+
free() {
|
|
938
|
+
const ptr = this.__destroy_into_raw();
|
|
939
|
+
wasm.__wbg_sev__exportpem_free(ptr, 0);
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* @returns {Uint8Array}
|
|
943
|
+
*/
|
|
944
|
+
get ark() {
|
|
945
|
+
const ret = wasm.__wbg_get_sev__exportpem_ark(this.__wbg_ptr);
|
|
946
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
947
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
948
|
+
return v1;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* @returns {Uint8Array}
|
|
952
|
+
*/
|
|
953
|
+
get ask() {
|
|
954
|
+
const ret = wasm.__wbg_get_sev__exportpem_ask(this.__wbg_ptr);
|
|
955
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
956
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
957
|
+
return v1;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* @returns {Uint8Array}
|
|
961
|
+
*/
|
|
962
|
+
get vek() {
|
|
963
|
+
const ret = wasm.__wbg_get_sev__exportpem_vek(this.__wbg_ptr);
|
|
964
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
965
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
966
|
+
return v1;
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* @param {Uint8Array} arg0
|
|
970
|
+
*/
|
|
971
|
+
set ark(arg0) {
|
|
972
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
973
|
+
const len0 = WASM_VECTOR_LEN;
|
|
974
|
+
wasm.__wbg_set_sev__exportpem_ark(this.__wbg_ptr, ptr0, len0);
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* @param {Uint8Array} arg0
|
|
978
|
+
*/
|
|
979
|
+
set ask(arg0) {
|
|
980
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
981
|
+
const len0 = WASM_VECTOR_LEN;
|
|
982
|
+
wasm.__wbg_set_sev__exportpem_ask(this.__wbg_ptr, ptr0, len0);
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* @param {Uint8Array} arg0
|
|
986
|
+
*/
|
|
987
|
+
set vek(arg0) {
|
|
988
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
989
|
+
const len0 = WASM_VECTOR_LEN;
|
|
990
|
+
wasm.__wbg_set_sev__exportpem_vek(this.__wbg_ptr, ptr0, len0);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if (Symbol.dispose) ExportPem.prototype[Symbol.dispose] = ExportPem.prototype.free;
|
|
994
|
+
|
|
995
|
+
class Kds {
|
|
996
|
+
__destroy_into_raw() {
|
|
997
|
+
const ptr = this.__wbg_ptr;
|
|
998
|
+
this.__wbg_ptr = 0;
|
|
999
|
+
KdsFinalization.unregister(this);
|
|
1000
|
+
return ptr;
|
|
1001
|
+
}
|
|
1002
|
+
free() {
|
|
1003
|
+
const ptr = this.__destroy_into_raw();
|
|
1004
|
+
wasm.__wbg_sev__kds_free(ptr, 0);
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* @param {ParsedAttestation} attestation
|
|
1008
|
+
* @returns {Promise<VerifiedChain>}
|
|
1009
|
+
*/
|
|
1010
|
+
fetch_certificates(attestation) {
|
|
1011
|
+
_assertClass(attestation, ParsedAttestation);
|
|
1012
|
+
const ret = wasm.kds_fetch_certificates(this.__wbg_ptr, attestation.__wbg_ptr);
|
|
1013
|
+
return ret;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Fetches the certificate revocation list from AMD's KDS
|
|
1017
|
+
* @param {ParsedAttestation} attestation
|
|
1018
|
+
* @returns {Promise<CRL>}
|
|
1019
|
+
*/
|
|
1020
|
+
fetch_crl(attestation) {
|
|
1021
|
+
_assertClass(attestation, ParsedAttestation);
|
|
1022
|
+
const ret = wasm.kds_fetch_crl(this.__wbg_ptr, attestation.__wbg_ptr);
|
|
1023
|
+
return ret;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* @param {string} cache_url
|
|
1027
|
+
*/
|
|
1028
|
+
constructor(cache_url) {
|
|
1029
|
+
const ptr0 = passStringToWasm0(cache_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1030
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1031
|
+
const ret = wasm.kds_new(ptr0, len0);
|
|
1032
|
+
if (ret[2]) {
|
|
1033
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1034
|
+
}
|
|
1035
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1036
|
+
KdsFinalization.register(this, this.__wbg_ptr, this);
|
|
1037
|
+
return this;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (Symbol.dispose) Kds.prototype[Symbol.dispose] = Kds.prototype.free;
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Represents a parsed attestation report with some already
|
|
1044
|
+
* parsed commonly accessed fields
|
|
1045
|
+
*/
|
|
1046
|
+
class ParsedAttestation {
|
|
1047
|
+
static __wrap(ptr) {
|
|
1048
|
+
ptr = ptr >>> 0;
|
|
1049
|
+
const obj = Object.create(ParsedAttestation.prototype);
|
|
1050
|
+
obj.__wbg_ptr = ptr;
|
|
1051
|
+
ParsedAttestationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1052
|
+
return obj;
|
|
1053
|
+
}
|
|
1054
|
+
__destroy_into_raw() {
|
|
1055
|
+
const ptr = this.__wbg_ptr;
|
|
1056
|
+
this.__wbg_ptr = 0;
|
|
1057
|
+
ParsedAttestationFinalization.unregister(this);
|
|
1058
|
+
return ptr;
|
|
1059
|
+
}
|
|
1060
|
+
free() {
|
|
1061
|
+
const ptr = this.__destroy_into_raw();
|
|
1062
|
+
wasm.__wbg_sev__parsedattestation_free(ptr, 0);
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* @returns {number}
|
|
1066
|
+
*/
|
|
1067
|
+
cpu_fam_id() {
|
|
1068
|
+
const ret = wasm.parsedattestation_cpu_fam_id(this.__wbg_ptr);
|
|
1069
|
+
return ret;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* @returns {number}
|
|
1073
|
+
*/
|
|
1074
|
+
cpu_mod_id() {
|
|
1075
|
+
const ret = wasm.parsedattestation_cpu_mod_id(this.__wbg_ptr);
|
|
1076
|
+
return ret;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Parses and constructs a new attestation report from a stream of binary data
|
|
1080
|
+
* @param {Uint8Array} bytes
|
|
1081
|
+
* @returns {ParsedAttestation}
|
|
1082
|
+
*/
|
|
1083
|
+
static new(bytes) {
|
|
1084
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1085
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1086
|
+
const ret = wasm.parsedattestation_new(ptr0, len0);
|
|
1087
|
+
if (ret[2]) {
|
|
1088
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1089
|
+
}
|
|
1090
|
+
return ParsedAttestation.__wrap(ret[0]);
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Verifies the attestation report against a certificate chain
|
|
1094
|
+
* @param {VerifiedChain} chain
|
|
1095
|
+
* @param {SevNonce} nonce
|
|
1096
|
+
*/
|
|
1097
|
+
verify(chain, nonce) {
|
|
1098
|
+
_assertClass(chain, VerifiedChain);
|
|
1099
|
+
_assertClass(nonce, SevNonce);
|
|
1100
|
+
const ret = wasm.parsedattestation_verify(this.__wbg_ptr, chain.__wbg_ptr, nonce.__wbg_ptr);
|
|
1101
|
+
if (ret[1]) {
|
|
1102
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
if (Symbol.dispose) ParsedAttestation.prototype[Symbol.dispose] = ParsedAttestation.prototype.free;
|
|
1107
|
+
|
|
1108
|
+
class SevNonce {
|
|
1109
|
+
static __wrap(ptr) {
|
|
1110
|
+
ptr = ptr >>> 0;
|
|
1111
|
+
const obj = Object.create(SevNonce.prototype);
|
|
1112
|
+
obj.__wbg_ptr = ptr;
|
|
1113
|
+
SevNonceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1114
|
+
return obj;
|
|
1115
|
+
}
|
|
1116
|
+
__destroy_into_raw() {
|
|
1117
|
+
const ptr = this.__wbg_ptr;
|
|
1118
|
+
this.__wbg_ptr = 0;
|
|
1119
|
+
SevNonceFinalization.unregister(this);
|
|
1120
|
+
return ptr;
|
|
1121
|
+
}
|
|
1122
|
+
free() {
|
|
1123
|
+
const ptr = this.__destroy_into_raw();
|
|
1124
|
+
wasm.__wbg_sev__sevnonce_free(ptr, 0);
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* @returns {SevNonce}
|
|
1128
|
+
*/
|
|
1129
|
+
static generate() {
|
|
1130
|
+
const ret = wasm.sevnonce_generate();
|
|
1131
|
+
return SevNonce.__wrap(ret);
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* @returns {string}
|
|
1135
|
+
*/
|
|
1136
|
+
to_hex() {
|
|
1137
|
+
let deferred1_0;
|
|
1138
|
+
let deferred1_1;
|
|
1139
|
+
try {
|
|
1140
|
+
const ret = wasm.sevnonce_to_hex(this.__wbg_ptr);
|
|
1141
|
+
deferred1_0 = ret[0];
|
|
1142
|
+
deferred1_1 = ret[1];
|
|
1143
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1144
|
+
} finally {
|
|
1145
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
if (Symbol.dispose) SevNonce.prototype[Symbol.dispose] = SevNonce.prototype.free;
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* A chain which has been cryptographically verified
|
|
1153
|
+
*/
|
|
1154
|
+
class VerifiedChain {
|
|
1155
|
+
static __wrap(ptr) {
|
|
1156
|
+
ptr = ptr >>> 0;
|
|
1157
|
+
const obj = Object.create(VerifiedChain.prototype);
|
|
1158
|
+
obj.__wbg_ptr = ptr;
|
|
1159
|
+
VerifiedChainFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1160
|
+
return obj;
|
|
1161
|
+
}
|
|
1162
|
+
__destroy_into_raw() {
|
|
1163
|
+
const ptr = this.__wbg_ptr;
|
|
1164
|
+
this.__wbg_ptr = 0;
|
|
1165
|
+
VerifiedChainFinalization.unregister(this);
|
|
1166
|
+
return ptr;
|
|
1167
|
+
}
|
|
1168
|
+
free() {
|
|
1169
|
+
const ptr = this.__destroy_into_raw();
|
|
1170
|
+
wasm.__wbg_sev__verifiedchain_free(ptr, 0);
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* parses a triad of ark, ask and vek certificates in the PEM format,
|
|
1174
|
+
* cryptographically verifies the chain is valid, returns a `VerifiedChain` object
|
|
1175
|
+
* @param {string} ark_pem
|
|
1176
|
+
* @param {string} ask_pem
|
|
1177
|
+
* @param {string} vek_pem
|
|
1178
|
+
* @returns {VerifiedChain}
|
|
1179
|
+
*/
|
|
1180
|
+
static parse_verify(ark_pem, ask_pem, vek_pem) {
|
|
1181
|
+
const ptr0 = passStringToWasm0(ark_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1182
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1183
|
+
const ptr1 = passStringToWasm0(ask_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1184
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1185
|
+
const ptr2 = passStringToWasm0(vek_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1186
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1187
|
+
const ret = wasm.verifiedchain_parse_verify(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1188
|
+
if (ret[2]) {
|
|
1189
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1190
|
+
}
|
|
1191
|
+
return VerifiedChain.__wrap(ret[0]);
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* @returns {ExportPem}
|
|
1195
|
+
*/
|
|
1196
|
+
to_pem() {
|
|
1197
|
+
const ret = wasm.verifiedchain_to_pem(this.__wbg_ptr);
|
|
1198
|
+
if (ret[2]) {
|
|
1199
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1200
|
+
}
|
|
1201
|
+
return ExportPem.__wrap(ret[0]);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
if (Symbol.dispose) VerifiedChain.prototype[Symbol.dispose] = VerifiedChain.prototype.free;
|
|
1205
|
+
|
|
1206
|
+
const sev = {};
|
|
1207
|
+
sev.CRL = CRL;
|
|
1208
|
+
sev.ExportPem = ExportPem;
|
|
1209
|
+
sev.Kds = Kds;
|
|
1210
|
+
sev.ParsedAttestation = ParsedAttestation;
|
|
1211
|
+
sev.SevNonce = SevNonce;
|
|
1212
|
+
sev.VerifiedChain = VerifiedChain;
|
|
1213
|
+
exports.sev = sev;
|
|
1214
|
+
|
|
1215
|
+
function __wbg_get_imports() {
|
|
1216
|
+
const import0 = {
|
|
1217
|
+
__proto__: null,
|
|
1218
|
+
__wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
|
|
1219
|
+
const ret = debugString(arg1);
|
|
1220
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1221
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1222
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1223
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1224
|
+
},
|
|
1225
|
+
__wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
|
|
1226
|
+
const ret = typeof(arg0) === 'function';
|
|
1227
|
+
return ret;
|
|
1228
|
+
},
|
|
1229
|
+
__wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
|
|
1230
|
+
const val = arg0;
|
|
1231
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1232
|
+
return ret;
|
|
1233
|
+
},
|
|
1234
|
+
__wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
|
|
1235
|
+
const ret = typeof(arg0) === 'string';
|
|
1236
|
+
return ret;
|
|
1237
|
+
},
|
|
1238
|
+
__wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
|
|
1239
|
+
const ret = arg0 === undefined;
|
|
1240
|
+
return ret;
|
|
1241
|
+
},
|
|
1242
|
+
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
1243
|
+
const obj = arg1;
|
|
1244
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1245
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1246
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1247
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1248
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1249
|
+
},
|
|
1250
|
+
__wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
|
|
1251
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1252
|
+
},
|
|
1253
|
+
__wbg__wbg_cb_unref_3c3b4f651835fbcb: function(arg0) {
|
|
1254
|
+
arg0._wbg_cb_unref();
|
|
1255
|
+
},
|
|
1256
|
+
__wbg_abort_5ee4083ce26e0b01: function(arg0) {
|
|
1257
|
+
arg0.abort();
|
|
1258
|
+
},
|
|
1259
|
+
__wbg_abort_7a67cb8f9383baa1: function(arg0, arg1) {
|
|
1260
|
+
arg0.abort(arg1);
|
|
1261
|
+
},
|
|
1262
|
+
__wbg_append_c015600138ae60bb: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1263
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1264
|
+
}, arguments); },
|
|
1265
|
+
__wbg_arrayBuffer_dae084a298aa5fe0: function() { return handleError(function (arg0) {
|
|
1266
|
+
const ret = arg0.arrayBuffer();
|
|
1267
|
+
return ret;
|
|
1268
|
+
}, arguments); },
|
|
1269
|
+
__wbg_attestresult_new: function(arg0) {
|
|
1270
|
+
const ret = AttestResult.__wrap(arg0);
|
|
1271
|
+
return ret;
|
|
1272
|
+
},
|
|
1273
|
+
__wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
|
|
1274
|
+
const ret = arg0.call(arg1);
|
|
1275
|
+
return ret;
|
|
1276
|
+
}, arguments); },
|
|
1277
|
+
__wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1278
|
+
const ret = arg0.call(arg1, arg2);
|
|
1279
|
+
return ret;
|
|
1280
|
+
}, arguments); },
|
|
1281
|
+
__wbg_clearTimeout_2256f1e7b94ef517: function(arg0) {
|
|
1282
|
+
const ret = clearTimeout(arg0);
|
|
1283
|
+
return ret;
|
|
1284
|
+
},
|
|
1285
|
+
__wbg_clearTimeout_6b8d9a38b9263d65: function(arg0) {
|
|
1286
|
+
const ret = clearTimeout(arg0);
|
|
1287
|
+
return ret;
|
|
1288
|
+
},
|
|
1289
|
+
__wbg_client_new: function(arg0) {
|
|
1290
|
+
const ret = Client.__wrap(arg0);
|
|
1291
|
+
return ret;
|
|
1292
|
+
},
|
|
1293
|
+
__wbg_collateral_new: function(arg0) {
|
|
1294
|
+
const ret = Collateral.__wrap(arg0);
|
|
1295
|
+
return ret;
|
|
1296
|
+
},
|
|
1297
|
+
__wbg_crypto_48300657fced39f9: function(arg0) {
|
|
1298
|
+
const ret = arg0.crypto;
|
|
1299
|
+
return ret;
|
|
1300
|
+
},
|
|
1301
|
+
__wbg_done_547d467e97529006: function(arg0) {
|
|
1302
|
+
const ret = arg0.done;
|
|
1303
|
+
return ret;
|
|
1304
|
+
},
|
|
1305
|
+
__wbg_entries_69f235654ec4ccc6: function(arg0) {
|
|
1306
|
+
const ret = arg0.entries();
|
|
1307
|
+
return ret;
|
|
1308
|
+
},
|
|
1309
|
+
__wbg_fetch_1a731e18c5e21884: function(arg0, arg1) {
|
|
1310
|
+
const ret = arg0.fetch(arg1);
|
|
1311
|
+
return ret;
|
|
1312
|
+
},
|
|
1313
|
+
__wbg_fetch_43b2f110608a59ff: function(arg0) {
|
|
1314
|
+
const ret = fetch(arg0);
|
|
1315
|
+
return ret;
|
|
1316
|
+
},
|
|
1317
|
+
__wbg_fetch_9dad4fe911207b37: function(arg0) {
|
|
1318
|
+
const ret = fetch(arg0);
|
|
1319
|
+
return ret;
|
|
1320
|
+
},
|
|
1321
|
+
__wbg_gatewayerror_new: function(arg0) {
|
|
1322
|
+
const ret = GatewayError.__wrap(arg0);
|
|
1323
|
+
return ret;
|
|
1324
|
+
},
|
|
1325
|
+
__wbg_getRandomValues_263d0aa5464054ee: function() { return handleError(function (arg0, arg1) {
|
|
1326
|
+
arg0.getRandomValues(arg1);
|
|
1327
|
+
}, arguments); },
|
|
1328
|
+
__wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
|
|
1329
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1330
|
+
}, arguments); },
|
|
1331
|
+
__wbg_getTime_f6ac312467f7cf09: function(arg0) {
|
|
1332
|
+
const ret = arg0.getTime();
|
|
1333
|
+
return ret;
|
|
1334
|
+
},
|
|
1335
|
+
__wbg_get_4848e350b40afc16: function(arg0, arg1) {
|
|
1336
|
+
const ret = arg0[arg1 >>> 0];
|
|
1337
|
+
return ret;
|
|
1338
|
+
},
|
|
1339
|
+
__wbg_get_ed0642c4b9d31ddf: function() { return handleError(function (arg0, arg1) {
|
|
1340
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1341
|
+
return ret;
|
|
1342
|
+
}, arguments); },
|
|
1343
|
+
__wbg_has_3ec5c22db2e5237a: function() { return handleError(function (arg0, arg1) {
|
|
1344
|
+
const ret = Reflect.has(arg0, arg1);
|
|
1345
|
+
return ret;
|
|
1346
|
+
}, arguments); },
|
|
1347
|
+
__wbg_headers_e08dcb5aa09b9a63: function(arg0) {
|
|
1348
|
+
const ret = arg0.headers;
|
|
1349
|
+
return ret;
|
|
1350
|
+
},
|
|
1351
|
+
__wbg_instanceof_Response_06795eab66cc4036: function(arg0) {
|
|
1352
|
+
let result;
|
|
1353
|
+
try {
|
|
1354
|
+
result = arg0 instanceof Response;
|
|
1355
|
+
} catch (_) {
|
|
1356
|
+
result = false;
|
|
1357
|
+
}
|
|
1358
|
+
const ret = result;
|
|
1359
|
+
return ret;
|
|
1360
|
+
},
|
|
1361
|
+
__wbg_isArray_db61795ad004c139: function(arg0) {
|
|
1362
|
+
const ret = Array.isArray(arg0);
|
|
1363
|
+
return ret;
|
|
1364
|
+
},
|
|
1365
|
+
__wbg_iterator_de403ef31815a3e6: function() {
|
|
1366
|
+
const ret = Symbol.iterator;
|
|
1367
|
+
return ret;
|
|
1368
|
+
},
|
|
1369
|
+
__wbg_length_0c32cb8543c8e4c8: function(arg0) {
|
|
1370
|
+
const ret = arg0.length;
|
|
1371
|
+
return ret;
|
|
1372
|
+
},
|
|
1373
|
+
__wbg_modules_new: function(arg0) {
|
|
1374
|
+
const ret = Modules.__wrap(arg0);
|
|
1375
|
+
return ret;
|
|
1376
|
+
},
|
|
1377
|
+
__wbg_msCrypto_8c6d45a75ef1d3da: function(arg0) {
|
|
1378
|
+
const ret = arg0.msCrypto;
|
|
1379
|
+
return ret;
|
|
1380
|
+
},
|
|
1381
|
+
__wbg_new_0_bfa2ef4bc447daa2: function() {
|
|
1382
|
+
const ret = new Date();
|
|
1383
|
+
return ret;
|
|
1384
|
+
},
|
|
1385
|
+
__wbg_new_3a112826a89cb962: function() { return handleError(function () {
|
|
1386
|
+
const ret = new Headers();
|
|
1387
|
+
return ret;
|
|
1388
|
+
}, arguments); },
|
|
1389
|
+
__wbg_new_4f9fafbb3909af72: function() {
|
|
1390
|
+
const ret = new Object();
|
|
1391
|
+
return ret;
|
|
1392
|
+
},
|
|
1393
|
+
__wbg_new_9abbf7148481485e: function() { return handleError(function () {
|
|
1394
|
+
const ret = new AbortController();
|
|
1395
|
+
return ret;
|
|
1396
|
+
}, arguments); },
|
|
1397
|
+
__wbg_new_a560378ea1240b14: function(arg0) {
|
|
1398
|
+
const ret = new Uint8Array(arg0);
|
|
1399
|
+
return ret;
|
|
1400
|
+
},
|
|
1401
|
+
__wbg_new_e3b04b4d53d1b593: function(arg0, arg1) {
|
|
1402
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1403
|
+
return ret;
|
|
1404
|
+
},
|
|
1405
|
+
__wbg_new_from_slice_2580ff33d0d10520: function(arg0, arg1) {
|
|
1406
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1407
|
+
return ret;
|
|
1408
|
+
},
|
|
1409
|
+
__wbg_new_typed_14d7cc391ce53d2c: function(arg0, arg1) {
|
|
1410
|
+
try {
|
|
1411
|
+
var state0 = {a: arg0, b: arg1};
|
|
1412
|
+
var cb0 = (arg0, arg1) => {
|
|
1413
|
+
const a = state0.a;
|
|
1414
|
+
state0.a = 0;
|
|
1415
|
+
try {
|
|
1416
|
+
return wasm_bindgen__convert__closures_____invoke__h4ce58f9281138292(a, state0.b, arg0, arg1);
|
|
1417
|
+
} finally {
|
|
1418
|
+
state0.a = a;
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1421
|
+
const ret = new Promise(cb0);
|
|
1422
|
+
return ret;
|
|
1423
|
+
} finally {
|
|
1424
|
+
state0.a = 0;
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1427
|
+
__wbg_new_with_length_9cedd08484b73942: function(arg0) {
|
|
1428
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1429
|
+
return ret;
|
|
1430
|
+
},
|
|
1431
|
+
__wbg_new_with_str_and_init_f663b6d334baa878: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1432
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
1433
|
+
return ret;
|
|
1434
|
+
}, arguments); },
|
|
1435
|
+
__wbg_next_01132ed6134b8ef5: function(arg0) {
|
|
1436
|
+
const ret = arg0.next;
|
|
1437
|
+
return ret;
|
|
1438
|
+
},
|
|
1439
|
+
__wbg_next_b3713ec761a9dbfd: function() { return handleError(function (arg0) {
|
|
1440
|
+
const ret = arg0.next();
|
|
1441
|
+
return ret;
|
|
1442
|
+
}, arguments); },
|
|
1443
|
+
__wbg_node_95beb7570492fd97: function(arg0) {
|
|
1444
|
+
const ret = arg0.node;
|
|
1445
|
+
return ret;
|
|
1446
|
+
},
|
|
1447
|
+
__wbg_nvidia__keychain_new: function(arg0) {
|
|
1448
|
+
const ret = KeyChain.__wrap(arg0);
|
|
1449
|
+
return ret;
|
|
1450
|
+
},
|
|
1451
|
+
__wbg_nvidiaattestresult_new: function(arg0) {
|
|
1452
|
+
const ret = NvidiaAttestResult.__wrap(arg0);
|
|
1453
|
+
return ret;
|
|
1454
|
+
},
|
|
1455
|
+
__wbg_process_b2fea42461d03994: function(arg0) {
|
|
1456
|
+
const ret = arg0.process;
|
|
1457
|
+
return ret;
|
|
1458
|
+
},
|
|
1459
|
+
__wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
|
|
1460
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1461
|
+
},
|
|
1462
|
+
__wbg_queueMicrotask_abaf92f0bd4e80a4: function(arg0) {
|
|
1463
|
+
const ret = arg0.queueMicrotask;
|
|
1464
|
+
return ret;
|
|
1465
|
+
},
|
|
1466
|
+
__wbg_queueMicrotask_df5a6dac26d818f3: function(arg0) {
|
|
1467
|
+
queueMicrotask(arg0);
|
|
1468
|
+
},
|
|
1469
|
+
__wbg_randomFillSync_ca9f178fb14c88cb: function() { return handleError(function (arg0, arg1) {
|
|
1470
|
+
arg0.randomFillSync(arg1);
|
|
1471
|
+
}, arguments); },
|
|
1472
|
+
__wbg_require_7a9419e39d796c95: function() { return handleError(function () {
|
|
1473
|
+
const ret = module.require;
|
|
1474
|
+
return ret;
|
|
1475
|
+
}, arguments); },
|
|
1476
|
+
__wbg_resolve_0a79de24e9d2267b: function(arg0) {
|
|
1477
|
+
const ret = Promise.resolve(arg0);
|
|
1478
|
+
return ret;
|
|
1479
|
+
},
|
|
1480
|
+
__wbg_responseheaders_new: function(arg0) {
|
|
1481
|
+
const ret = ResponseHeaders.__wrap(arg0);
|
|
1482
|
+
return ret;
|
|
1483
|
+
},
|
|
1484
|
+
__wbg_setTimeout_b188b3bcc8977c7d: function(arg0, arg1) {
|
|
1485
|
+
const ret = setTimeout(arg0, arg1);
|
|
1486
|
+
return ret;
|
|
1487
|
+
},
|
|
1488
|
+
__wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
|
|
1489
|
+
const ret = setTimeout(arg0, arg1);
|
|
1490
|
+
return ret;
|
|
1491
|
+
},
|
|
1492
|
+
__wbg_set_8ee2d34facb8466e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1493
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1494
|
+
return ret;
|
|
1495
|
+
}, arguments); },
|
|
1496
|
+
__wbg_set_body_a304d09cb50cefbe: function(arg0, arg1) {
|
|
1497
|
+
arg0.body = arg1;
|
|
1498
|
+
},
|
|
1499
|
+
__wbg_set_cache_cc687e2b96e9608c: function(arg0, arg1) {
|
|
1500
|
+
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
1501
|
+
},
|
|
1502
|
+
__wbg_set_cause_5a9e15c02aba2509: function(arg0, arg1) {
|
|
1503
|
+
arg0.cause = arg1;
|
|
1504
|
+
},
|
|
1505
|
+
__wbg_set_credentials_7693e63055f5e838: function(arg0, arg1) {
|
|
1506
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
1507
|
+
},
|
|
1508
|
+
__wbg_set_headers_6ab1105e542834e2: function(arg0, arg1) {
|
|
1509
|
+
arg0.headers = arg1;
|
|
1510
|
+
},
|
|
1511
|
+
__wbg_set_method_1971272fe557e972: function(arg0, arg1, arg2) {
|
|
1512
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
1513
|
+
},
|
|
1514
|
+
__wbg_set_mode_d1b643087602281a: function(arg0, arg1) {
|
|
1515
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
1516
|
+
},
|
|
1517
|
+
__wbg_set_name_ab9c98596fd7310a: function(arg0, arg1, arg2) {
|
|
1518
|
+
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
1519
|
+
},
|
|
1520
|
+
__wbg_set_signal_8564a226c5c6853c: function(arg0, arg1) {
|
|
1521
|
+
arg0.signal = arg1;
|
|
1522
|
+
},
|
|
1523
|
+
__wbg_sev__crl_new: function(arg0) {
|
|
1524
|
+
const ret = CRL.__wrap(arg0);
|
|
1525
|
+
return ret;
|
|
1526
|
+
},
|
|
1527
|
+
__wbg_sev__parsedattestation_new: function(arg0) {
|
|
1528
|
+
const ret = ParsedAttestation.__wrap(arg0);
|
|
1529
|
+
return ret;
|
|
1530
|
+
},
|
|
1531
|
+
__wbg_sev__verifiedchain_new: function(arg0) {
|
|
1532
|
+
const ret = VerifiedChain.__wrap(arg0);
|
|
1533
|
+
return ret;
|
|
1534
|
+
},
|
|
1535
|
+
__wbg_signal_9172c3282bfba2f5: function(arg0) {
|
|
1536
|
+
const ret = arg0.signal;
|
|
1537
|
+
return ret;
|
|
1538
|
+
},
|
|
1539
|
+
__wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
|
|
1540
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1541
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1542
|
+
},
|
|
1543
|
+
__wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
|
|
1544
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1545
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1546
|
+
},
|
|
1547
|
+
__wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
|
|
1548
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1549
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1550
|
+
},
|
|
1551
|
+
__wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
|
|
1552
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1553
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1554
|
+
},
|
|
1555
|
+
__wbg_status_44ecb0ac1da253f4: function(arg0) {
|
|
1556
|
+
const ret = arg0.status;
|
|
1557
|
+
return ret;
|
|
1558
|
+
},
|
|
1559
|
+
__wbg_stringify_a2c39d991e1bf91d: function() { return handleError(function (arg0) {
|
|
1560
|
+
const ret = JSON.stringify(arg0);
|
|
1561
|
+
return ret;
|
|
1562
|
+
}, arguments); },
|
|
1563
|
+
__wbg_subarray_0f98d3fb634508ad: function(arg0, arg1, arg2) {
|
|
1564
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1565
|
+
return ret;
|
|
1566
|
+
},
|
|
1567
|
+
__wbg_tdxquote_new: function(arg0) {
|
|
1568
|
+
const ret = TdxQuote.__wrap(arg0);
|
|
1569
|
+
return ret;
|
|
1570
|
+
},
|
|
1571
|
+
__wbg_text_43bdfba45e602cf9: function() { return handleError(function (arg0) {
|
|
1572
|
+
const ret = arg0.text();
|
|
1573
|
+
return ret;
|
|
1574
|
+
}, arguments); },
|
|
1575
|
+
__wbg_then_00eed3ac0b8e82cb: function(arg0, arg1, arg2) {
|
|
1576
|
+
const ret = arg0.then(arg1, arg2);
|
|
1577
|
+
return ret;
|
|
1578
|
+
},
|
|
1579
|
+
__wbg_then_a0c8db0381c8994c: function(arg0, arg1) {
|
|
1580
|
+
const ret = arg0.then(arg1);
|
|
1581
|
+
return ret;
|
|
1582
|
+
},
|
|
1583
|
+
__wbg_url_95d8a83d33709572: function(arg0, arg1) {
|
|
1584
|
+
const ret = arg1.url;
|
|
1585
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1586
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1587
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1588
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1589
|
+
},
|
|
1590
|
+
__wbg_value_7f6052747ccf940f: function(arg0) {
|
|
1591
|
+
const ret = arg0.value;
|
|
1592
|
+
return ret;
|
|
1593
|
+
},
|
|
1594
|
+
__wbg_versions_215a3ab1c9d5745a: function(arg0) {
|
|
1595
|
+
const ret = arg0.versions;
|
|
1596
|
+
return ret;
|
|
1597
|
+
},
|
|
1598
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1599
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1943, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1600
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7);
|
|
1601
|
+
return ret;
|
|
1602
|
+
},
|
|
1603
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1604
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1775, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1605
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c);
|
|
1606
|
+
return ret;
|
|
1607
|
+
},
|
|
1608
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1609
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 885, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1610
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3);
|
|
1611
|
+
return ret;
|
|
1612
|
+
},
|
|
1613
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1614
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1615
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1616
|
+
return ret;
|
|
1617
|
+
},
|
|
1618
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
1619
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1620
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1621
|
+
return ret;
|
|
1622
|
+
},
|
|
1623
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
1624
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
1625
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
1626
|
+
// Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
|
|
1627
|
+
const ret = v0;
|
|
1628
|
+
return ret;
|
|
1629
|
+
},
|
|
1630
|
+
__wbindgen_init_externref_table: function() {
|
|
1631
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1632
|
+
const offset = table.grow(4);
|
|
1633
|
+
table.set(0, undefined);
|
|
1634
|
+
table.set(offset + 0, undefined);
|
|
1635
|
+
table.set(offset + 1, null);
|
|
1636
|
+
table.set(offset + 2, true);
|
|
1637
|
+
table.set(offset + 3, false);
|
|
1638
|
+
},
|
|
1639
|
+
};
|
|
1640
|
+
return {
|
|
1641
|
+
__proto__: null,
|
|
1642
|
+
"./prem_rs_bg.js": import0,
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
function wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c(arg0, arg1) {
|
|
1647
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c(arg0, arg1);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
function wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3(arg0, arg1) {
|
|
1651
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3(arg0, arg1);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
function wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7(arg0, arg1, arg2) {
|
|
1655
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7(arg0, arg1, arg2);
|
|
1656
|
+
if (ret[1]) {
|
|
1657
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
function wasm_bindgen__convert__closures_____invoke__h4ce58f9281138292(arg0, arg1, arg2, arg3) {
|
|
1662
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h4ce58f9281138292(arg0, arg1, arg2, arg3);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
1673
|
+
const AttestHeadersFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1674
|
+
? { register: () => {}, unregister: () => {} }
|
|
1675
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_attestheaders_free(ptr >>> 0, 1));
|
|
1676
|
+
const AttestResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1677
|
+
? { register: () => {}, unregister: () => {} }
|
|
1678
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_attestresult_free(ptr >>> 0, 1));
|
|
1679
|
+
const CRLFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1680
|
+
? { register: () => {}, unregister: () => {} }
|
|
1681
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sev__crl_free(ptr >>> 0, 1));
|
|
1682
|
+
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1683
|
+
? { register: () => {}, unregister: () => {} }
|
|
1684
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
1685
|
+
const ClientBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1686
|
+
? { register: () => {}, unregister: () => {} }
|
|
1687
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_clientbuilder_free(ptr >>> 0, 1));
|
|
1688
|
+
const CollateralFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1689
|
+
? { register: () => {}, unregister: () => {} }
|
|
1690
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_collateral_free(ptr >>> 0, 1));
|
|
1691
|
+
const DecodedClaimsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1692
|
+
? { register: () => {}, unregister: () => {} }
|
|
1693
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nvidia__decodedclaims_free(ptr >>> 0, 1));
|
|
1694
|
+
const EATTokenFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1695
|
+
? { register: () => {}, unregister: () => {} }
|
|
1696
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nvidia__eattoken_free(ptr >>> 0, 1));
|
|
1697
|
+
const ExportPemFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1698
|
+
? { register: () => {}, unregister: () => {} }
|
|
1699
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sev__exportpem_free(ptr >>> 0, 1));
|
|
1700
|
+
const GatewayErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1701
|
+
? { register: () => {}, unregister: () => {} }
|
|
1702
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gatewayerror_free(ptr >>> 0, 1));
|
|
1703
|
+
const KdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1704
|
+
? { register: () => {}, unregister: () => {} }
|
|
1705
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sev__kds_free(ptr >>> 0, 1));
|
|
1706
|
+
const KeyChainFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1707
|
+
? { register: () => {}, unregister: () => {} }
|
|
1708
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nvidia__keychain_free(ptr >>> 0, 1));
|
|
1709
|
+
const ModulesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1710
|
+
? { register: () => {}, unregister: () => {} }
|
|
1711
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_modules_free(ptr >>> 0, 1));
|
|
1712
|
+
const NvidiaAttestResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1713
|
+
? { register: () => {}, unregister: () => {} }
|
|
1714
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nvidiaattestresult_free(ptr >>> 0, 1));
|
|
1715
|
+
const NvidiaNonceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1716
|
+
? { register: () => {}, unregister: () => {} }
|
|
1717
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nvidia__nvidianonce_free(ptr >>> 0, 1));
|
|
1718
|
+
const ParsedAttestationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1719
|
+
? { register: () => {}, unregister: () => {} }
|
|
1720
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sev__parsedattestation_free(ptr >>> 0, 1));
|
|
1721
|
+
const PcsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1722
|
+
? { register: () => {}, unregister: () => {} }
|
|
1723
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pcs_free(ptr >>> 0, 1));
|
|
1724
|
+
const QueryParamsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1725
|
+
? { register: () => {}, unregister: () => {} }
|
|
1726
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_queryparams_free(ptr >>> 0, 1));
|
|
1727
|
+
const QuoteVerifierFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1728
|
+
? { register: () => {}, unregister: () => {} }
|
|
1729
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_quoteverifier_free(ptr >>> 0, 1));
|
|
1730
|
+
const ResponseHeadersFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1731
|
+
? { register: () => {}, unregister: () => {} }
|
|
1732
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_responseheaders_free(ptr >>> 0, 1));
|
|
1733
|
+
const SevNonceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1734
|
+
? { register: () => {}, unregister: () => {} }
|
|
1735
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sev__sevnonce_free(ptr >>> 0, 1));
|
|
1736
|
+
const TcbLevelsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1737
|
+
? { register: () => {}, unregister: () => {} }
|
|
1738
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tcblevels_free(ptr >>> 0, 1));
|
|
1739
|
+
const TdxNonceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1740
|
+
? { register: () => {}, unregister: () => {} }
|
|
1741
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tdxnonce_free(ptr >>> 0, 1));
|
|
1742
|
+
const TdxQuoteFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1743
|
+
? { register: () => {}, unregister: () => {} }
|
|
1744
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tdxquote_free(ptr >>> 0, 1));
|
|
1745
|
+
const VerifiedChainFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1746
|
+
? { register: () => {}, unregister: () => {} }
|
|
1747
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sev__verifiedchain_free(ptr >>> 0, 1));
|
|
1748
|
+
|
|
1749
|
+
function addToExternrefTable0(obj) {
|
|
1750
|
+
const idx = wasm.__externref_table_alloc();
|
|
1751
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1752
|
+
return idx;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
function _assertClass(instance, klass) {
|
|
1756
|
+
if (!(instance instanceof klass)) {
|
|
1757
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1762
|
+
? { register: () => {}, unregister: () => {} }
|
|
1763
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
1764
|
+
|
|
1765
|
+
function debugString(val) {
|
|
1766
|
+
// primitive types
|
|
1767
|
+
const type = typeof val;
|
|
1768
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1769
|
+
return `${val}`;
|
|
1770
|
+
}
|
|
1771
|
+
if (type == 'string') {
|
|
1772
|
+
return `"${val}"`;
|
|
1773
|
+
}
|
|
1774
|
+
if (type == 'symbol') {
|
|
1775
|
+
const description = val.description;
|
|
1776
|
+
if (description == null) {
|
|
1777
|
+
return 'Symbol';
|
|
1778
|
+
} else {
|
|
1779
|
+
return `Symbol(${description})`;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
if (type == 'function') {
|
|
1783
|
+
const name = val.name;
|
|
1784
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1785
|
+
return `Function(${name})`;
|
|
1786
|
+
} else {
|
|
1787
|
+
return 'Function';
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
// objects
|
|
1791
|
+
if (Array.isArray(val)) {
|
|
1792
|
+
const length = val.length;
|
|
1793
|
+
let debug = '[';
|
|
1794
|
+
if (length > 0) {
|
|
1795
|
+
debug += debugString(val[0]);
|
|
1796
|
+
}
|
|
1797
|
+
for(let i = 1; i < length; i++) {
|
|
1798
|
+
debug += ', ' + debugString(val[i]);
|
|
1799
|
+
}
|
|
1800
|
+
debug += ']';
|
|
1801
|
+
return debug;
|
|
1802
|
+
}
|
|
1803
|
+
// Test for built-in
|
|
1804
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1805
|
+
let className;
|
|
1806
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1807
|
+
className = builtInMatches[1];
|
|
1808
|
+
} else {
|
|
1809
|
+
// Failed to match the standard '[object ClassName]'
|
|
1810
|
+
return toString.call(val);
|
|
1811
|
+
}
|
|
1812
|
+
if (className == 'Object') {
|
|
1813
|
+
// we're a user defined class or Object
|
|
1814
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1815
|
+
// easier than looping through ownProperties of `val`.
|
|
1816
|
+
try {
|
|
1817
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1818
|
+
} catch (_) {
|
|
1819
|
+
return 'Object';
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
// errors
|
|
1823
|
+
if (val instanceof Error) {
|
|
1824
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1825
|
+
}
|
|
1826
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1827
|
+
return className;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1831
|
+
ptr = ptr >>> 0;
|
|
1832
|
+
const mem = getDataViewMemory0();
|
|
1833
|
+
const result = [];
|
|
1834
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1835
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1836
|
+
}
|
|
1837
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
1838
|
+
return result;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1842
|
+
ptr = ptr >>> 0;
|
|
1843
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
let cachedDataViewMemory0 = null;
|
|
1847
|
+
function getDataViewMemory0() {
|
|
1848
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1849
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1850
|
+
}
|
|
1851
|
+
return cachedDataViewMemory0;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
function getStringFromWasm0(ptr, len) {
|
|
1855
|
+
ptr = ptr >>> 0;
|
|
1856
|
+
return decodeText(ptr, len);
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1860
|
+
function getUint8ArrayMemory0() {
|
|
1861
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1862
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1863
|
+
}
|
|
1864
|
+
return cachedUint8ArrayMemory0;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
function handleError(f, args) {
|
|
1868
|
+
try {
|
|
1869
|
+
return f.apply(this, args);
|
|
1870
|
+
} catch (e) {
|
|
1871
|
+
const idx = addToExternrefTable0(e);
|
|
1872
|
+
wasm.__wbindgen_exn_store(idx);
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
function isLikeNone(x) {
|
|
1877
|
+
return x === undefined || x === null;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1881
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1882
|
+
const real = (...args) => {
|
|
1883
|
+
|
|
1884
|
+
// First up with a closure we increment the internal reference
|
|
1885
|
+
// count. This ensures that the Rust closure environment won't
|
|
1886
|
+
// be deallocated while we're invoking it.
|
|
1887
|
+
state.cnt++;
|
|
1888
|
+
const a = state.a;
|
|
1889
|
+
state.a = 0;
|
|
1890
|
+
try {
|
|
1891
|
+
return f(a, state.b, ...args);
|
|
1892
|
+
} finally {
|
|
1893
|
+
state.a = a;
|
|
1894
|
+
real._wbg_cb_unref();
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
real._wbg_cb_unref = () => {
|
|
1898
|
+
if (--state.cnt === 0) {
|
|
1899
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
1900
|
+
state.a = 0;
|
|
1901
|
+
CLOSURE_DTORS.unregister(state);
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1905
|
+
return real;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1909
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1910
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1911
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1912
|
+
return ptr;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1916
|
+
if (realloc === undefined) {
|
|
1917
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1918
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1919
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1920
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1921
|
+
return ptr;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
let len = arg.length;
|
|
1925
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1926
|
+
|
|
1927
|
+
const mem = getUint8ArrayMemory0();
|
|
1928
|
+
|
|
1929
|
+
let offset = 0;
|
|
1930
|
+
|
|
1931
|
+
for (; offset < len; offset++) {
|
|
1932
|
+
const code = arg.charCodeAt(offset);
|
|
1933
|
+
if (code > 0x7F) break;
|
|
1934
|
+
mem[ptr + offset] = code;
|
|
1935
|
+
}
|
|
1936
|
+
if (offset !== len) {
|
|
1937
|
+
if (offset !== 0) {
|
|
1938
|
+
arg = arg.slice(offset);
|
|
1939
|
+
}
|
|
1940
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1941
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1942
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1943
|
+
|
|
1944
|
+
offset += ret.written;
|
|
1945
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
WASM_VECTOR_LEN = offset;
|
|
1949
|
+
return ptr;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
function takeFromExternrefTable0(idx) {
|
|
1953
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1954
|
+
wasm.__externref_table_dealloc(idx);
|
|
1955
|
+
return value;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1959
|
+
cachedTextDecoder.decode();
|
|
1960
|
+
function decodeText(ptr, len) {
|
|
1961
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1965
|
+
|
|
1966
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1967
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1968
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1969
|
+
view.set(buf);
|
|
1970
|
+
return {
|
|
1971
|
+
read: arg.length,
|
|
1972
|
+
written: buf.length
|
|
1973
|
+
};
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
let WASM_VECTOR_LEN = 0;
|
|
1978
|
+
|
|
1979
|
+
const wasmPath = `${__dirname}/prem_rs_bg.wasm`;
|
|
1980
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
1981
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
1982
|
+
let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
1983
|
+
wasm.__wbindgen_start();
|