@baerae/zkap-zkp-react-native 0.1.5 → 0.1.7

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.
@@ -1,66 +1,117 @@
1
- // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
2
- // Trust me, you don't want to mess with it!
1
+ // This file was autogenerated by some hot garbage in the
2
+ // `uniffi-bindgen-react-native` crate. Trust me, you don't want to mess with
3
+ // it!
3
4
  #pragma once
4
- #include <jsi/jsi.h>
5
+ #include "UniffiCallInvoker.h"
6
+ #include <ReactCommon/CallInvoker.h>
5
7
  #include <iostream>
8
+ #include <jsi/jsi.h>
6
9
  #include <map>
7
10
  #include <memory>
8
- #include <ReactCommon/CallInvoker.h>
9
- #include "UniffiCallInvoker.h"
10
11
 
11
12
  namespace react = facebook::react;
12
13
  namespace jsi = facebook::jsi;
13
14
 
14
15
  class NativeZkapUniffiBindings : public jsi::HostObject {
15
- private:
16
- // For calling back into JS from Rust.
17
- std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker;
16
+ private:
17
+ // For calling back into JS from Rust.
18
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker;
18
19
 
19
- protected:
20
- std::map<std::string,jsi::Value> props;
21
- jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
22
- jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
23
- jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
24
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_anchor(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
25
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_aud_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
26
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
27
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_leaf_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
28
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prepare_witness_inputs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
29
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prove(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
30
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prove_from_witness_bundle_file(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
31
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prove_from_witness_bundles(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
32
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_anchor(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
33
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_aud_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
34
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
35
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_leaf_hash(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
36
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_prepare_witness_inputs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
37
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_prove(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
38
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_prove_from_witness_bundle_file(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
39
- jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_prove_from_witness_bundles(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
40
- jsi::Value cpp_ffi_zkap_uniffi_bindings_uniffi_contract_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
20
+ protected:
21
+ std::map<std::string, jsi::Value> props;
22
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
23
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
24
+ size_t count);
25
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
26
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
27
+ size_t count);
28
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
29
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
30
+ size_t count);
31
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_anchor(
32
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
33
+ size_t count);
34
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_aud_hash(
35
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
36
+ size_t count);
37
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_hash(
38
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
39
+ size_t count);
40
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_generate_leaf_hash(
41
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
42
+ size_t count);
43
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prepare_witness_inputs(
44
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
45
+ size_t count);
46
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prove(
47
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
48
+ size_t count);
49
+ jsi::Value
50
+ cpp_uniffi_zkap_uniffi_bindings_fn_func_prove_from_witness_bundle_file(
51
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
52
+ size_t count);
53
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_fn_func_prove_from_witness_bundles(
54
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
55
+ size_t count);
56
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_anchor(
57
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
58
+ size_t count);
59
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_aud_hash(
60
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
61
+ size_t count);
62
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_hash(
63
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
64
+ size_t count);
65
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_generate_leaf_hash(
66
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
67
+ size_t count);
68
+ jsi::Value
69
+ cpp_uniffi_zkap_uniffi_bindings_checksum_func_prepare_witness_inputs(
70
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
71
+ size_t count);
72
+ jsi::Value cpp_uniffi_zkap_uniffi_bindings_checksum_func_prove(
73
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
74
+ size_t count);
75
+ jsi::Value
76
+ cpp_uniffi_zkap_uniffi_bindings_checksum_func_prove_from_witness_bundle_file(
77
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
78
+ size_t count);
79
+ jsi::Value
80
+ cpp_uniffi_zkap_uniffi_bindings_checksum_func_prove_from_witness_bundles(
81
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
82
+ size_t count);
83
+ jsi::Value cpp_ffi_zkap_uniffi_bindings_uniffi_contract_version(
84
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
85
+ size_t count);
41
86
 
42
- public:
43
- NativeZkapUniffiBindings(jsi::Runtime &rt, std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker);
44
- virtual ~NativeZkapUniffiBindings();
87
+ public:
88
+ NativeZkapUniffiBindings(
89
+ jsi::Runtime &rt,
90
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker);
91
+ virtual ~NativeZkapUniffiBindings();
45
92
 
46
- /**
47
- * The entry point into the crate.
48
- *
49
- * React Native must call `NativeZkapUniffiBindings.registerModule(rt, callInvoker)` before using
50
- * the Javascript interface.
51
- */
52
- static void registerModule(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker);
93
+ /**
94
+ * The entry point into the crate.
95
+ *
96
+ * React Native must call `NativeZkapUniffiBindings.registerModule(rt,
97
+ * callInvoker)` before using the Javascript interface.
98
+ */
99
+ static void registerModule(jsi::Runtime &rt,
100
+ std::shared_ptr<react::CallInvoker> callInvoker);
53
101
 
54
- /**
55
- * Some cleanup into the crate goes here.
56
- *
57
- * Current implementation is empty, however, this is not guaranteed to always be the case.
58
- *
59
- * Clients should call `NativeZkapUniffiBindings.unregisterModule(rt)` after final use where possible.
60
- */
61
- static void unregisterModule(jsi::Runtime &rt);
102
+ /**
103
+ * Some cleanup into the crate goes here.
104
+ *
105
+ * Current implementation is empty, however, this is not guaranteed to always
106
+ * be the case.
107
+ *
108
+ * Clients should call `NativeZkapUniffiBindings.unregisterModule(rt)` after
109
+ * final use where possible.
110
+ */
111
+ static void unregisterModule(jsi::Runtime &rt);
62
112
 
63
- virtual jsi::Value get(jsi::Runtime& rt, const jsi::PropNameID& name);
64
- virtual void set(jsi::Runtime& rt,const jsi::PropNameID& name,const jsi::Value& value);
65
- virtual std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& rt);
113
+ virtual jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &name);
114
+ virtual void set(jsi::Runtime &rt, const jsi::PropNameID &name,
115
+ const jsi::Value &value);
116
+ virtual std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt);
66
117
  };
@@ -165,7 +165,7 @@ static NSMutableSet<ZkapWitnessRunner *> *ZkapActiveWitnessRunners() {
165
165
  [html appendString:@"const input = JSON.parse(inputJson);\n"];
166
166
  [html appendString:@"const runId = input.run_id;\n"];
167
167
  [html appendString:@"function post(message){ window.webkit.messageHandlers.zkapWitness.postMessage(message); }\n"];
168
- [html appendString:@"function fail(error){ const message = error && error.stack ? error.stack : String(error); post({type:'error', run_id:runId, message}); }\n"];
168
+ [html appendString:@"function fail(error){ const message = ((error && error.message) ? error.message : '') + ((error && error.stack) ? ('\\n' + error.stack) : '') || String(error); post({type:'error', run_id:runId, message}); }\n"];
169
169
  [html appendString:@"function b64ToBytes(b64){ const binary = atob(b64); const bytes = new Uint8Array(binary.length); for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i); return bytes; }\n"];
170
170
  [html appendString:@"function utf8(bytes){ if (typeof TextDecoder !== 'undefined') return new TextDecoder().decode(bytes); let out = ''; for (let i = 0; i < bytes.length; i++) out += String.fromCharCode(bytes[i]); return out; }\n"];
171
171
  [html appendString:@"function bytesToBase64(bytes){ let binary = ''; const step = 0x8000; for (let i = 0; i < bytes.length; i += step) { const slice = bytes.subarray(i, i + step); binary += String.fromCharCode.apply(null, slice); } return btoa(binary); }\n"];
@@ -10,18 +10,15 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64_x86_64-simulator</string>
13
+ <string>ios-arm64</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libzkap_uniffi_bindings.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
- <string>x86_64</string>
20
19
  </array>
21
20
  <key>SupportedPlatform</key>
22
21
  <string>ios</string>
23
- <key>SupportedPlatformVariant</key>
24
- <string>simulator</string>
25
22
  </dict>
26
23
  <dict>
27
24
  <key>BinaryPath</key>
@@ -29,15 +26,18 @@
29
26
  <key>HeadersPath</key>
30
27
  <string>Headers</string>
31
28
  <key>LibraryIdentifier</key>
32
- <string>ios-arm64</string>
29
+ <string>ios-arm64_x86_64-simulator</string>
33
30
  <key>LibraryPath</key>
34
31
  <string>libzkap_uniffi_bindings.a</string>
35
32
  <key>SupportedArchitectures</key>
36
33
  <array>
37
34
  <string>arm64</string>
35
+ <string>x86_64</string>
38
36
  </array>
39
37
  <key>SupportedPlatform</key>
40
38
  <string>ios</string>
39
+ <key>SupportedPlatformVariant</key>
40
+ <string>simulator</string>
41
41
  </dict>
42
42
  </array>
43
43
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baerae/zkap-zkp-react-native",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "React Native SDK for zkap-zkp — on-device ZK proving with Groth16 (BN254) and Poseidon hash.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -25,8 +25,8 @@
25
25
  "ubrn.config.yaml"
26
26
  ],
27
27
  "scripts": {
28
- "generate:ubrn": "uniffi-bindgen-react-native generate jsi bindings --library --crate zkap_uniffi_bindings --ts-dir src/generated --cpp-dir cpp/generated ../../target/debug/libzkap_uniffi_bindings.dylib",
29
- "prepack": "node ../../scripts/check-rn-native-artifacts.mjs",
28
+ "generate:ubrn": "node ../../scripts/generate-rn-bindings.mjs",
29
+ "prepack": "node ../../scripts/generate-rn-bindings.mjs && node ../../scripts/check-rn-native-artifacts.mjs",
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
32
  "engines": {
@@ -63,7 +63,7 @@
63
63
  }
64
64
  },
65
65
  "dependencies": {
66
- "uniffi-bindgen-react-native": "^0.31.0-2"
66
+ "uniffi-bindgen-react-native": "0.31.0-2"
67
67
  },
68
68
  "codegenConfig": {
69
69
  "name": "ZkapReactNativeSpec",
@@ -34,18 +34,18 @@ import nativeModule, {
34
34
  type UniffiForeignFutureCompleteVoid,
35
35
  } from "./zkap_uniffi_bindings-ffi";
36
36
  import {
37
- type UniffiByteArray,
38
- AbstractFfiConverterByteArray,
39
- FfiConverterArray,
40
- FfiConverterInt32,
41
- FfiConverterUInt64,
42
- RustBuffer,
43
- UniffiError,
44
- UniffiInternalError,
45
- UniffiRustCaller,
46
- uniffiCreateFfiConverterString,
47
- uniffiCreateRecord,
48
- uniffiTypeNameSymbol,
37
+ type UniffiByteArray,
38
+ AbstractFfiConverterByteArray,
39
+ FfiConverterArray,
40
+ FfiConverterInt32,
41
+ FfiConverterUInt64,
42
+ RustBuffer,
43
+ UniffiError,
44
+ UniffiInternalError,
45
+ UniffiRustCaller,
46
+ uniffiCreateFfiConverterString,
47
+ uniffiCreateRecord,
48
+ uniffiTypeNameSymbol,
49
49
  variantOrdinalSymbol } from "uniffi-bindgen-react-native";
50
50
 
51
51
  // Get converters from the other files, if any.
@@ -149,8 +149,9 @@ export function prepareWitnessInputs(config: ZkapCircuitConfig, request: ZkapPro
149
149
  *
150
150
  * Loads the manifest-validated CRS bundle from `request.manifest_dir`,
151
151
  * runs witness synthesis inside the release-provided `witness_gen.wasm`,
152
- * then runs the circuit-agnostic
153
- * `ark_ar1cs::prove_with_mode(..., VerifyAfter)` against the bundled proving key.
152
+ * then routes the synthesized bundles through the
153
+ * `zkap_service::prove_bundles(..., PreflightMode::VerifyAfter)` façade
154
+ * against the bundled proving key.
154
155
  */
155
156
  export function prove(config: ZkapCircuitConfig, request: ZkapProofRequest): ZkapProofOutput /*throws*/ {
156
157
  return FfiConverterTypeZkapProofOutput.lift(
@@ -239,7 +240,7 @@ const FfiConverterTypeZkapAnchorResult = (() => {
239
240
  }
240
241
  allocationSize(value: TypeName): number {
241
242
  return FfiConverterArrayString.allocationSize(value.evaluations);
242
-
243
+
243
244
  }
244
245
  };
245
246
  return new FFIConverter();
@@ -273,7 +274,7 @@ const FfiConverterTypeZkapAudHashResult = (() => {
273
274
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
274
275
  read(from: RustBuffer): TypeName {
275
276
  return {
276
- audHashes: FfiConverterArrayString.read(from),
277
+ audHashes: FfiConverterArrayString.read(from),
277
278
  hAudList: FfiConverterString.read(from)
278
279
  };
279
280
  }
@@ -282,9 +283,9 @@ const FfiConverterTypeZkapAudHashResult = (() => {
282
283
  FfiConverterString.write(value.hAudList, into);
283
284
  }
284
285
  allocationSize(value: TypeName): number {
285
- return FfiConverterArrayString.allocationSize(value.audHashes) +
286
+ return FfiConverterArrayString.allocationSize(value.audHashes) +
286
287
  FfiConverterString.allocationSize(value.hAudList);
287
-
288
+
288
289
  }
289
290
  };
290
291
  return new FFIConverter();
@@ -329,18 +330,18 @@ const FfiConverterTypeZkapCircuitConfig = (() => {
329
330
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
330
331
  read(from: RustBuffer): TypeName {
331
332
  return {
332
- maxJwtB64Len: FfiConverterUInt64.read(from),
333
- maxPayloadB64Len: FfiConverterUInt64.read(from),
334
- maxAudLen: FfiConverterUInt64.read(from),
335
- maxExpLen: FfiConverterUInt64.read(from),
336
- maxIssLen: FfiConverterUInt64.read(from),
337
- maxNonceLen: FfiConverterUInt64.read(from),
338
- maxSubLen: FfiConverterUInt64.read(from),
339
- n: FfiConverterUInt64.read(from),
340
- k: FfiConverterUInt64.read(from),
341
- treeHeight: FfiConverterUInt64.read(from),
342
- numAudienceLimit: FfiConverterUInt64.read(from),
343
- claims: FfiConverterArrayString.read(from),
333
+ maxJwtB64Len: FfiConverterUInt64.read(from),
334
+ maxPayloadB64Len: FfiConverterUInt64.read(from),
335
+ maxAudLen: FfiConverterUInt64.read(from),
336
+ maxExpLen: FfiConverterUInt64.read(from),
337
+ maxIssLen: FfiConverterUInt64.read(from),
338
+ maxNonceLen: FfiConverterUInt64.read(from),
339
+ maxSubLen: FfiConverterUInt64.read(from),
340
+ n: FfiConverterUInt64.read(from),
341
+ k: FfiConverterUInt64.read(from),
342
+ treeHeight: FfiConverterUInt64.read(from),
343
+ numAudienceLimit: FfiConverterUInt64.read(from),
344
+ claims: FfiConverterArrayString.read(from),
344
345
  forbiddenString: FfiConverterString.read(from)
345
346
  };
346
347
  }
@@ -360,20 +361,20 @@ const FfiConverterTypeZkapCircuitConfig = (() => {
360
361
  FfiConverterString.write(value.forbiddenString, into);
361
362
  }
362
363
  allocationSize(value: TypeName): number {
363
- return FfiConverterUInt64.allocationSize(value.maxJwtB64Len) +
364
- FfiConverterUInt64.allocationSize(value.maxPayloadB64Len) +
365
- FfiConverterUInt64.allocationSize(value.maxAudLen) +
366
- FfiConverterUInt64.allocationSize(value.maxExpLen) +
367
- FfiConverterUInt64.allocationSize(value.maxIssLen) +
368
- FfiConverterUInt64.allocationSize(value.maxNonceLen) +
369
- FfiConverterUInt64.allocationSize(value.maxSubLen) +
370
- FfiConverterUInt64.allocationSize(value.n) +
371
- FfiConverterUInt64.allocationSize(value.k) +
372
- FfiConverterUInt64.allocationSize(value.treeHeight) +
373
- FfiConverterUInt64.allocationSize(value.numAudienceLimit) +
374
- FfiConverterArrayString.allocationSize(value.claims) +
364
+ return FfiConverterUInt64.allocationSize(value.maxJwtB64Len) +
365
+ FfiConverterUInt64.allocationSize(value.maxPayloadB64Len) +
366
+ FfiConverterUInt64.allocationSize(value.maxAudLen) +
367
+ FfiConverterUInt64.allocationSize(value.maxExpLen) +
368
+ FfiConverterUInt64.allocationSize(value.maxIssLen) +
369
+ FfiConverterUInt64.allocationSize(value.maxNonceLen) +
370
+ FfiConverterUInt64.allocationSize(value.maxSubLen) +
371
+ FfiConverterUInt64.allocationSize(value.n) +
372
+ FfiConverterUInt64.allocationSize(value.k) +
373
+ FfiConverterUInt64.allocationSize(value.treeHeight) +
374
+ FfiConverterUInt64.allocationSize(value.numAudienceLimit) +
375
+ FfiConverterArrayString.allocationSize(value.claims) +
375
376
  FfiConverterString.allocationSize(value.forbiddenString);
376
-
377
+
377
378
  }
378
379
  };
379
380
  return new FFIConverter();
@@ -415,15 +416,15 @@ const FfiConverterTypeZkapPreparedWitnessInputs = (() => {
415
416
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
416
417
  read(from: RustBuffer): TypeName {
417
418
  return {
418
- manifestDir: FfiConverterString.read(from),
419
- wasmBase64: FfiConverterString.read(from),
420
- requestJsonBase64: FfiConverterString.read(from),
421
- configJsonBase64: FfiConverterString.read(from),
422
- witnessGenSha256: FfiConverterString.read(from),
423
- requestJsonSha256: FfiConverterString.read(from),
424
- configJsonSha256: FfiConverterString.read(from),
425
- wasmByteLength: FfiConverterUInt64.read(from),
426
- requestJsonByteLength: FfiConverterUInt64.read(from),
419
+ manifestDir: FfiConverterString.read(from),
420
+ wasmBase64: FfiConverterString.read(from),
421
+ requestJsonBase64: FfiConverterString.read(from),
422
+ configJsonBase64: FfiConverterString.read(from),
423
+ witnessGenSha256: FfiConverterString.read(from),
424
+ requestJsonSha256: FfiConverterString.read(from),
425
+ configJsonSha256: FfiConverterString.read(from),
426
+ wasmByteLength: FfiConverterUInt64.read(from),
427
+ requestJsonByteLength: FfiConverterUInt64.read(from),
427
428
  configJsonByteLength: FfiConverterUInt64.read(from)
428
429
  };
429
430
  }
@@ -440,17 +441,17 @@ const FfiConverterTypeZkapPreparedWitnessInputs = (() => {
440
441
  FfiConverterUInt64.write(value.configJsonByteLength, into);
441
442
  }
442
443
  allocationSize(value: TypeName): number {
443
- return FfiConverterString.allocationSize(value.manifestDir) +
444
- FfiConverterString.allocationSize(value.wasmBase64) +
445
- FfiConverterString.allocationSize(value.requestJsonBase64) +
446
- FfiConverterString.allocationSize(value.configJsonBase64) +
447
- FfiConverterString.allocationSize(value.witnessGenSha256) +
448
- FfiConverterString.allocationSize(value.requestJsonSha256) +
449
- FfiConverterString.allocationSize(value.configJsonSha256) +
450
- FfiConverterUInt64.allocationSize(value.wasmByteLength) +
451
- FfiConverterUInt64.allocationSize(value.requestJsonByteLength) +
444
+ return FfiConverterString.allocationSize(value.manifestDir) +
445
+ FfiConverterString.allocationSize(value.wasmBase64) +
446
+ FfiConverterString.allocationSize(value.requestJsonBase64) +
447
+ FfiConverterString.allocationSize(value.configJsonBase64) +
448
+ FfiConverterString.allocationSize(value.witnessGenSha256) +
449
+ FfiConverterString.allocationSize(value.requestJsonSha256) +
450
+ FfiConverterString.allocationSize(value.configJsonSha256) +
451
+ FfiConverterUInt64.allocationSize(value.wasmByteLength) +
452
+ FfiConverterUInt64.allocationSize(value.requestJsonByteLength) +
452
453
  FfiConverterUInt64.allocationSize(value.configJsonByteLength);
453
-
454
+
454
455
  }
455
456
  };
456
457
  return new FFIConverter();
@@ -489,9 +490,9 @@ const FfiConverterTypeZkapProofOutput = (() => {
489
490
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
490
491
  read(from: RustBuffer): TypeName {
491
492
  return {
492
- proofs: FfiConverterArrayArrayString.read(from),
493
- sharedInputs: FfiConverterArrayString.read(from),
494
- partialRhsList: FfiConverterArrayString.read(from),
493
+ proofs: FfiConverterArrayArrayString.read(from),
494
+ sharedInputs: FfiConverterArrayString.read(from),
495
+ partialRhsList: FfiConverterArrayString.read(from),
495
496
  jwtExpList: FfiConverterArrayString.read(from)
496
497
  };
497
498
  }
@@ -502,11 +503,11 @@ const FfiConverterTypeZkapProofOutput = (() => {
502
503
  FfiConverterArrayString.write(value.jwtExpList, into);
503
504
  }
504
505
  allocationSize(value: TypeName): number {
505
- return FfiConverterArrayArrayString.allocationSize(value.proofs) +
506
- FfiConverterArrayString.allocationSize(value.sharedInputs) +
507
- FfiConverterArrayString.allocationSize(value.partialRhsList) +
506
+ return FfiConverterArrayArrayString.allocationSize(value.proofs) +
507
+ FfiConverterArrayString.allocationSize(value.sharedInputs) +
508
+ FfiConverterArrayString.allocationSize(value.partialRhsList) +
508
509
  FfiConverterArrayString.allocationSize(value.jwtExpList);
509
-
510
+
510
511
  }
511
512
  };
512
513
  return new FFIConverter();
@@ -574,11 +575,11 @@ const FfiConverterTypeZkapProofRequest = (() => {
574
575
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
575
576
  read(from: RustBuffer): TypeName {
576
577
  return {
577
- manifestDir: FfiConverterString.read(from),
578
- random: FfiConverterString.read(from),
579
- hSignUserOp: FfiConverterString.read(from),
580
- anchor: FfiConverterArrayString.read(from),
581
- merkleRoot: FfiConverterString.read(from),
578
+ manifestDir: FfiConverterString.read(from),
579
+ random: FfiConverterString.read(from),
580
+ hSignUserOp: FfiConverterString.read(from),
581
+ anchor: FfiConverterArrayString.read(from),
582
+ merkleRoot: FfiConverterString.read(from),
582
583
  credentials: FfiConverterArrayTypeZkapProveCredential.read(from)
583
584
  };
584
585
  }
@@ -591,13 +592,13 @@ const FfiConverterTypeZkapProofRequest = (() => {
591
592
  FfiConverterArrayTypeZkapProveCredential.write(value.credentials, into);
592
593
  }
593
594
  allocationSize(value: TypeName): number {
594
- return FfiConverterString.allocationSize(value.manifestDir) +
595
- FfiConverterString.allocationSize(value.random) +
596
- FfiConverterString.allocationSize(value.hSignUserOp) +
597
- FfiConverterArrayString.allocationSize(value.anchor) +
598
- FfiConverterString.allocationSize(value.merkleRoot) +
595
+ return FfiConverterString.allocationSize(value.manifestDir) +
596
+ FfiConverterString.allocationSize(value.random) +
597
+ FfiConverterString.allocationSize(value.hSignUserOp) +
598
+ FfiConverterArrayString.allocationSize(value.anchor) +
599
+ FfiConverterString.allocationSize(value.merkleRoot) +
599
600
  FfiConverterArrayTypeZkapProveCredential.allocationSize(value.credentials);
600
-
601
+
601
602
  }
602
603
  };
603
604
  return new FFIConverter();
@@ -648,9 +649,9 @@ const FfiConverterTypeZkapProveCredential = (() => {
648
649
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
649
650
  read(from: RustBuffer): TypeName {
650
651
  return {
651
- jwt: FfiConverterString.read(from),
652
- rsaModulusB64: FfiConverterString.read(from),
653
- merklePath: FfiConverterArrayString.read(from),
652
+ jwt: FfiConverterString.read(from),
653
+ rsaModulusB64: FfiConverterString.read(from),
654
+ merklePath: FfiConverterArrayString.read(from),
654
655
  merkleLeafIdx: FfiConverterUInt64.read(from)
655
656
  };
656
657
  }
@@ -661,11 +662,11 @@ const FfiConverterTypeZkapProveCredential = (() => {
661
662
  FfiConverterUInt64.write(value.merkleLeafIdx, into);
662
663
  }
663
664
  allocationSize(value: TypeName): number {
664
- return FfiConverterString.allocationSize(value.jwt) +
665
- FfiConverterString.allocationSize(value.rsaModulusB64) +
666
- FfiConverterArrayString.allocationSize(value.merklePath) +
665
+ return FfiConverterString.allocationSize(value.jwt) +
666
+ FfiConverterString.allocationSize(value.rsaModulusB64) +
667
+ FfiConverterArrayString.allocationSize(value.merklePath) +
667
668
  FfiConverterUInt64.allocationSize(value.merkleLeafIdx);
668
-
669
+
669
670
  }
670
671
  };
671
672
  return new FFIConverter();
@@ -700,8 +701,8 @@ const FfiConverterTypeZkapSecret = (() => {
700
701
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
701
702
  read(from: RustBuffer): TypeName {
702
703
  return {
703
- sub: FfiConverterString.read(from),
704
- iss: FfiConverterString.read(from),
704
+ sub: FfiConverterString.read(from),
705
+ iss: FfiConverterString.read(from),
705
706
  aud: FfiConverterString.read(from)
706
707
  };
707
708
  }
@@ -711,10 +712,10 @@ const FfiConverterTypeZkapSecret = (() => {
711
712
  FfiConverterString.write(value.aud, into);
712
713
  }
713
714
  allocationSize(value: TypeName): number {
714
- return FfiConverterString.allocationSize(value.sub) +
715
- FfiConverterString.allocationSize(value.iss) +
715
+ return FfiConverterString.allocationSize(value.sub) +
716
+ FfiConverterString.allocationSize(value.iss) +
716
717
  FfiConverterString.allocationSize(value.aud);
717
-
718
+
718
719
  }
719
720
  };
720
721
  return new FFIConverter();
@@ -749,8 +750,8 @@ const FfiConverterTypeZkapWitnessBundleBytes = (() => {
749
750
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
750
751
  read(from: RustBuffer): TypeName {
751
752
  return {
752
- witnessBundlesBase64: FfiConverterString.read(from),
753
- sha256: FfiConverterString.read(from),
753
+ witnessBundlesBase64: FfiConverterString.read(from),
754
+ sha256: FfiConverterString.read(from),
754
755
  byteLength: FfiConverterUInt64.read(from)
755
756
  };
756
757
  }
@@ -760,10 +761,10 @@ const FfiConverterTypeZkapWitnessBundleBytes = (() => {
760
761
  FfiConverterUInt64.write(value.byteLength, into);
761
762
  }
762
763
  allocationSize(value: TypeName): number {
763
- return FfiConverterString.allocationSize(value.witnessBundlesBase64) +
764
- FfiConverterString.allocationSize(value.sha256) +
764
+ return FfiConverterString.allocationSize(value.witnessBundlesBase64) +
765
+ FfiConverterString.allocationSize(value.sha256) +
765
766
  FfiConverterUInt64.allocationSize(value.byteLength);
766
-
767
+
767
768
  }
768
769
  };
769
770
  return new FFIConverter();
@@ -798,8 +799,8 @@ const FfiConverterTypeZkapWitnessBundleFile = (() => {
798
799
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
799
800
  read(from: RustBuffer): TypeName {
800
801
  return {
801
- witnessBundlePath: FfiConverterString.read(from),
802
- sha256: FfiConverterString.read(from),
802
+ witnessBundlePath: FfiConverterString.read(from),
803
+ sha256: FfiConverterString.read(from),
803
804
  byteLength: FfiConverterUInt64.read(from)
804
805
  };
805
806
  }
@@ -809,10 +810,10 @@ const FfiConverterTypeZkapWitnessBundleFile = (() => {
809
810
  FfiConverterUInt64.write(value.byteLength, into);
810
811
  }
811
812
  allocationSize(value: TypeName): number {
812
- return FfiConverterString.allocationSize(value.witnessBundlePath) +
813
- FfiConverterString.allocationSize(value.sha256) +
813
+ return FfiConverterString.allocationSize(value.witnessBundlePath) +
814
+ FfiConverterString.allocationSize(value.sha256) +
814
815
  FfiConverterUInt64.allocationSize(value.byteLength);
815
-
816
+
816
817
  }
817
818
  };
818
819
  return new FFIConverter();
@@ -839,14 +840,14 @@ export enum ZkapError_Tags {
839
840
  ApplicationError = "ApplicationError"
840
841
  }
841
842
  export const ZkapError = (() => {
842
-
843
+
843
844
 
844
845
  type ApplicationError__interface = {
845
846
  tag: ZkapError_Tags.ApplicationError;
846
847
  inner: Readonly<{message: string}>
847
848
  };
848
849
 
849
-
850
+
850
851
  class ApplicationError_ extends UniffiError implements ApplicationError__interface {
851
852
  /**
852
853
  * @private
@@ -867,9 +868,9 @@ export const ZkapError = (() => {
867
868
  static instanceOf(obj: any): obj is ApplicationError_ {
868
869
  return obj.tag === ZkapError_Tags.ApplicationError;
869
870
  }
871
+
870
872
 
871
-
872
-
873
+
873
874
  static hasInner(obj: any): obj is ApplicationError_ {
874
875
  return ApplicationError_.instanceOf(obj);
875
876
  }
@@ -985,7 +986,7 @@ function uniffiEnsureInitialized() {
985
986
  if (nativeModule().ubrn_uniffi_zkap_uniffi_bindings_checksum_func_prepare_witness_inputs() !== 50971) {
986
987
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zkap_uniffi_bindings_checksum_func_prepare_witness_inputs");
987
988
  }
988
- if (nativeModule().ubrn_uniffi_zkap_uniffi_bindings_checksum_func_prove() !== 35511) {
989
+ if (nativeModule().ubrn_uniffi_zkap_uniffi_bindings_checksum_func_prove() !== 59563) {
989
990
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_zkap_uniffi_bindings_checksum_func_prove");
990
991
  }
991
992
  if (nativeModule().ubrn_uniffi_zkap_uniffi_bindings_checksum_func_prove_from_witness_bundle_file() !== 12913) {