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