@reclaimprotocol/attestor-core 5.0.1-beta.2 → 5.0.1-beta.22

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.
Files changed (145) hide show
  1. package/browser/resources/attestor-browser.min.mjs +4512 -0
  2. package/lib/avs/abis/avsDirectoryABI.js +338 -341
  3. package/lib/avs/abis/delegationABI.js +1 -4
  4. package/lib/avs/abis/registryABI.js +719 -722
  5. package/lib/avs/client/create-claim-on-avs.js +129 -157
  6. package/lib/avs/config.js +18 -24
  7. package/lib/avs/contracts/ReclaimServiceManager.js +1 -0
  8. package/lib/avs/contracts/common.js +1 -0
  9. package/lib/avs/contracts/factories/ReclaimServiceManager__factory.js +1139 -1156
  10. package/lib/avs/contracts/factories/index.js +4 -4
  11. package/lib/avs/contracts/index.js +2 -6
  12. package/lib/avs/types/index.js +1 -0
  13. package/lib/avs/utils/contracts.js +30 -50
  14. package/lib/avs/utils/register.js +75 -70
  15. package/lib/avs/utils/tasks.js +38 -45
  16. package/lib/client/create-claim.js +402 -431
  17. package/lib/client/tunnels/make-rpc-tcp-tunnel.js +46 -48
  18. package/lib/client/tunnels/make-rpc-tls-tunnel.js +125 -121
  19. package/lib/client/utils/attestor-pool.js +23 -22
  20. package/lib/client/utils/client-socket.js +86 -109
  21. package/lib/client/utils/message-handler.js +79 -89
  22. package/lib/config/index.js +40 -58
  23. package/lib/external-rpc/benchmark.js +61 -74
  24. package/lib/external-rpc/event-bus.js +12 -15
  25. package/lib/external-rpc/handle-incoming-msg.js +216 -225
  26. package/lib/external-rpc/jsc-polyfills/1.js +70 -68
  27. package/lib/external-rpc/jsc-polyfills/2.js +17 -12
  28. package/lib/external-rpc/jsc-polyfills/event.js +10 -15
  29. package/lib/external-rpc/jsc-polyfills/index.js +2 -2
  30. package/lib/external-rpc/jsc-polyfills/ws.js +77 -79
  31. package/lib/external-rpc/setup-browser.js +28 -28
  32. package/lib/external-rpc/setup-jsc.js +17 -17
  33. package/lib/external-rpc/types.js +1 -0
  34. package/lib/external-rpc/utils.js +89 -89
  35. package/lib/external-rpc/zk.js +55 -50
  36. package/lib/index.js +2 -6
  37. package/lib/mechain/abis/governanceABI.js +457 -460
  38. package/lib/mechain/abis/taskABI.js +502 -505
  39. package/lib/mechain/client/create-claim-on-mechain.js +24 -29
  40. package/lib/mechain/constants/index.js +3 -8
  41. package/lib/mechain/types/index.js +1 -0
  42. package/lib/proto/api.js +4200 -4087
  43. package/lib/proto/tee-bundle.js +1261 -1241
  44. package/lib/providers/http/index.js +616 -603
  45. package/lib/providers/http/patch-parse5-tree.js +27 -29
  46. package/lib/providers/http/utils.js +289 -248
  47. package/lib/providers/index.js +3 -6
  48. package/lib/server/create-server.js +89 -91
  49. package/lib/server/handlers/claimTeeBundle.js +231 -211
  50. package/lib/server/handlers/claimTunnel.js +66 -73
  51. package/lib/server/handlers/completeClaimOnChain.js +20 -25
  52. package/lib/server/handlers/createClaimOnChain.js +21 -27
  53. package/lib/server/handlers/createTaskOnMechain.js +40 -50
  54. package/lib/server/handlers/createTunnel.js +85 -90
  55. package/lib/server/handlers/disconnectTunnel.js +4 -7
  56. package/lib/server/handlers/fetchCertificateBytes.js +37 -53
  57. package/lib/server/handlers/index.js +21 -24
  58. package/lib/server/handlers/init.js +27 -28
  59. package/lib/server/handlers/toprf.js +13 -16
  60. package/lib/server/socket.js +97 -100
  61. package/lib/server/tunnels/make-tcp-tunnel.js +161 -186
  62. package/lib/server/utils/apm.js +32 -25
  63. package/lib/server/utils/assert-valid-claim-request.js +305 -334
  64. package/lib/server/utils/config-env.js +2 -2
  65. package/lib/server/utils/dns.js +12 -18
  66. package/lib/server/utils/gcp-attestation.js +233 -181
  67. package/lib/server/utils/generics.d.ts +1 -1
  68. package/lib/server/utils/generics.js +43 -37
  69. package/lib/server/utils/iso.js +253 -256
  70. package/lib/server/utils/keep-alive.js +36 -36
  71. package/lib/server/utils/nitro-attestation.js +295 -220
  72. package/lib/server/utils/oprf-raw.js +48 -55
  73. package/lib/server/utils/process-handshake.js +200 -218
  74. package/lib/server/utils/proxy-session.js +5 -5
  75. package/lib/server/utils/tee-oprf-mpc-verification.js +82 -78
  76. package/lib/server/utils/tee-oprf-verification.js +165 -142
  77. package/lib/server/utils/tee-transcript-reconstruction.js +176 -129
  78. package/lib/server/utils/tee-verification.js +397 -334
  79. package/lib/server/utils/validation.js +30 -37
  80. package/lib/types/bgp.js +1 -0
  81. package/lib/types/claims.js +1 -0
  82. package/lib/types/client.js +1 -0
  83. package/lib/types/general.js +1 -0
  84. package/lib/types/handlers.js +1 -0
  85. package/lib/types/providers.d.ts +3 -2
  86. package/lib/types/providers.gen.js +9 -15
  87. package/lib/types/providers.js +1 -0
  88. package/lib/types/rpc.js +1 -0
  89. package/lib/types/signatures.d.ts +1 -2
  90. package/lib/types/signatures.js +1 -0
  91. package/lib/types/tunnel.js +1 -0
  92. package/lib/types/zk.js +1 -0
  93. package/lib/utils/auth.js +54 -66
  94. package/lib/utils/b64-json.js +15 -15
  95. package/lib/utils/bgp-listener.js +107 -111
  96. package/lib/utils/claims.js +89 -80
  97. package/lib/utils/env.js +13 -17
  98. package/lib/utils/error.js +43 -47
  99. package/lib/utils/generics.js +284 -235
  100. package/lib/utils/http-parser.js +232 -187
  101. package/lib/utils/logger.js +80 -71
  102. package/lib/utils/prepare-packets.js +69 -67
  103. package/lib/utils/redactions.js +163 -121
  104. package/lib/utils/retries.js +22 -24
  105. package/lib/utils/signatures/eth.js +29 -28
  106. package/lib/utils/signatures/index.js +5 -10
  107. package/lib/utils/socket-base.js +84 -88
  108. package/lib/utils/tls.js +28 -28
  109. package/lib/utils/ws.js +19 -19
  110. package/lib/utils/zk.js +542 -582
  111. package/package.json +12 -5
  112. package/lib/external-rpc/global.d.js +0 -0
  113. package/lib/scripts/build-browser.d.ts +0 -1
  114. package/lib/scripts/build-jsc.d.ts +0 -1
  115. package/lib/scripts/build-lib.d.ts +0 -1
  116. package/lib/scripts/check-avs-registration.d.ts +0 -1
  117. package/lib/scripts/check-avs-registration.js +0 -28
  118. package/lib/scripts/fallbacks/crypto.d.ts +0 -1
  119. package/lib/scripts/fallbacks/crypto.js +0 -4
  120. package/lib/scripts/fallbacks/empty.d.ts +0 -3
  121. package/lib/scripts/fallbacks/empty.js +0 -4
  122. package/lib/scripts/fallbacks/re2.d.ts +0 -1
  123. package/lib/scripts/fallbacks/re2.js +0 -7
  124. package/lib/scripts/fallbacks/snarkjs.d.ts +0 -1
  125. package/lib/scripts/fallbacks/snarkjs.js +0 -10
  126. package/lib/scripts/fallbacks/stwo.d.ts +0 -6
  127. package/lib/scripts/fallbacks/stwo.js +0 -159
  128. package/lib/scripts/generate-provider-types.d.ts +0 -5
  129. package/lib/scripts/generate-provider-types.js +0 -101
  130. package/lib/scripts/generate-receipt.d.ts +0 -9
  131. package/lib/scripts/generate-receipt.js +0 -101
  132. package/lib/scripts/generate-toprf-keys.d.ts +0 -1
  133. package/lib/scripts/generate-toprf-keys.js +0 -24
  134. package/lib/scripts/jsc-cli-rpc.d.ts +0 -1
  135. package/lib/scripts/jsc-cli-rpc.js +0 -35
  136. package/lib/scripts/register-avs-operator.d.ts +0 -1
  137. package/lib/scripts/register-avs-operator.js +0 -3
  138. package/lib/scripts/start-server.d.ts +0 -1
  139. package/lib/scripts/start-server.js +0 -11
  140. package/lib/scripts/update-avs-metadata.d.ts +0 -1
  141. package/lib/scripts/update-avs-metadata.js +0 -20
  142. package/lib/scripts/utils.d.ts +0 -1
  143. package/lib/scripts/utils.js +0 -10
  144. package/lib/scripts/whitelist-operator.d.ts +0 -1
  145. package/lib/scripts/whitelist-operator.js +0 -16
@@ -1,1296 +1,1316 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.5.0
4
+ // protoc v6.31.1
5
+ // source: tee-bundle.proto
6
+ /* eslint-disable */
1
7
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- const protobufPackage = "teeproto";
3
- const BodyType = {
4
- BODY_TYPE_UNSPECIFIED: 0,
5
- BODY_TYPE_K_OUTPUT: 1,
6
- BODY_TYPE_T_OUTPUT: 2,
7
- UNRECOGNIZED: -1
8
+ export const protobufPackage = "teeproto";
9
+ /** Signature wrapper used everywhere */
10
+ export const BodyType = {
11
+ BODY_TYPE_UNSPECIFIED: 0,
12
+ BODY_TYPE_K_OUTPUT: 1,
13
+ BODY_TYPE_T_OUTPUT: 2,
14
+ UNRECOGNIZED: -1,
8
15
  };
9
- function bodyTypeFromJSON(object) {
10
- switch (object) {
11
- case 0:
12
- case "BODY_TYPE_UNSPECIFIED":
13
- return BodyType.BODY_TYPE_UNSPECIFIED;
14
- case 1:
15
- case "BODY_TYPE_K_OUTPUT":
16
- return BodyType.BODY_TYPE_K_OUTPUT;
17
- case 2:
18
- case "BODY_TYPE_T_OUTPUT":
19
- return BodyType.BODY_TYPE_T_OUTPUT;
20
- case -1:
21
- case "UNRECOGNIZED":
22
- default:
23
- return BodyType.UNRECOGNIZED;
24
- }
16
+ export function bodyTypeFromJSON(object) {
17
+ switch (object) {
18
+ case 0:
19
+ case "BODY_TYPE_UNSPECIFIED":
20
+ return BodyType.BODY_TYPE_UNSPECIFIED;
21
+ case 1:
22
+ case "BODY_TYPE_K_OUTPUT":
23
+ return BodyType.BODY_TYPE_K_OUTPUT;
24
+ case 2:
25
+ case "BODY_TYPE_T_OUTPUT":
26
+ return BodyType.BODY_TYPE_T_OUTPUT;
27
+ case -1:
28
+ case "UNRECOGNIZED":
29
+ default:
30
+ return BodyType.UNRECOGNIZED;
31
+ }
25
32
  }
26
- function bodyTypeToJSON(object) {
27
- switch (object) {
28
- case BodyType.BODY_TYPE_UNSPECIFIED:
29
- return "BODY_TYPE_UNSPECIFIED";
30
- case BodyType.BODY_TYPE_K_OUTPUT:
31
- return "BODY_TYPE_K_OUTPUT";
32
- case BodyType.BODY_TYPE_T_OUTPUT:
33
- return "BODY_TYPE_T_OUTPUT";
34
- case BodyType.UNRECOGNIZED:
35
- default:
36
- return "UNRECOGNIZED";
37
- }
33
+ export function bodyTypeToJSON(object) {
34
+ switch (object) {
35
+ case BodyType.BODY_TYPE_UNSPECIFIED:
36
+ return "BODY_TYPE_UNSPECIFIED";
37
+ case BodyType.BODY_TYPE_K_OUTPUT:
38
+ return "BODY_TYPE_K_OUTPUT";
39
+ case BodyType.BODY_TYPE_T_OUTPUT:
40
+ return "BODY_TYPE_T_OUTPUT";
41
+ case BodyType.UNRECOGNIZED:
42
+ default:
43
+ return "UNRECOGNIZED";
44
+ }
38
45
  }
39
46
  function createBaseRequestRedactionRange() {
40
- return { start: 0, length: 0, type: "" };
47
+ return { start: 0, length: 0, type: "" };
41
48
  }
42
- const RequestRedactionRange = {
43
- encode(message, writer = new BinaryWriter()) {
44
- if (message.start !== 0) {
45
- writer.uint32(8).int32(message.start);
46
- }
47
- if (message.length !== 0) {
48
- writer.uint32(16).int32(message.length);
49
- }
50
- if (message.type !== "") {
51
- writer.uint32(26).string(message.type);
52
- }
53
- return writer;
54
- },
55
- decode(input, length) {
56
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
57
- let end = length === void 0 ? reader.len : reader.pos + length;
58
- const message = createBaseRequestRedactionRange();
59
- while (reader.pos < end) {
60
- const tag = reader.uint32();
61
- switch (tag >>> 3) {
62
- case 1: {
63
- if (tag !== 8) {
64
- break;
65
- }
66
- message.start = reader.int32();
67
- continue;
68
- }
69
- case 2: {
70
- if (tag !== 16) {
71
- break;
72
- }
73
- message.length = reader.int32();
74
- continue;
75
- }
76
- case 3: {
77
- if (tag !== 26) {
78
- break;
79
- }
80
- message.type = reader.string();
81
- continue;
82
- }
83
- }
84
- if ((tag & 7) === 4 || tag === 0) {
85
- break;
86
- }
87
- reader.skip(tag & 7);
88
- }
89
- return message;
90
- },
91
- fromJSON(object) {
92
- return {
93
- start: isSet(object.start) ? globalThis.Number(object.start) : 0,
94
- length: isSet(object.length) ? globalThis.Number(object.length) : 0,
95
- type: isSet(object.type) ? globalThis.String(object.type) : ""
96
- };
97
- },
98
- toJSON(message) {
99
- const obj = {};
100
- if (message.start !== 0) {
101
- obj.start = Math.round(message.start);
102
- }
103
- if (message.length !== 0) {
104
- obj.length = Math.round(message.length);
105
- }
106
- if (message.type !== "") {
107
- obj.type = message.type;
108
- }
109
- return obj;
110
- },
111
- create(base) {
112
- return RequestRedactionRange.fromPartial(base ?? {});
113
- },
114
- fromPartial(object) {
115
- const message = createBaseRequestRedactionRange();
116
- message.start = object.start ?? 0;
117
- message.length = object.length ?? 0;
118
- message.type = object.type ?? "";
119
- return message;
120
- }
49
+ export const RequestRedactionRange = {
50
+ encode(message, writer = new BinaryWriter()) {
51
+ if (message.start !== 0) {
52
+ writer.uint32(8).int32(message.start);
53
+ }
54
+ if (message.length !== 0) {
55
+ writer.uint32(16).int32(message.length);
56
+ }
57
+ if (message.type !== "") {
58
+ writer.uint32(26).string(message.type);
59
+ }
60
+ return writer;
61
+ },
62
+ decode(input, length) {
63
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
64
+ let end = length === undefined ? reader.len : reader.pos + length;
65
+ const message = createBaseRequestRedactionRange();
66
+ while (reader.pos < end) {
67
+ const tag = reader.uint32();
68
+ switch (tag >>> 3) {
69
+ case 1: {
70
+ if (tag !== 8) {
71
+ break;
72
+ }
73
+ message.start = reader.int32();
74
+ continue;
75
+ }
76
+ case 2: {
77
+ if (tag !== 16) {
78
+ break;
79
+ }
80
+ message.length = reader.int32();
81
+ continue;
82
+ }
83
+ case 3: {
84
+ if (tag !== 26) {
85
+ break;
86
+ }
87
+ message.type = reader.string();
88
+ continue;
89
+ }
90
+ }
91
+ if ((tag & 7) === 4 || tag === 0) {
92
+ break;
93
+ }
94
+ reader.skip(tag & 7);
95
+ }
96
+ return message;
97
+ },
98
+ fromJSON(object) {
99
+ return {
100
+ start: isSet(object.start) ? globalThis.Number(object.start) : 0,
101
+ length: isSet(object.length) ? globalThis.Number(object.length) : 0,
102
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
103
+ };
104
+ },
105
+ toJSON(message) {
106
+ const obj = {};
107
+ if (message.start !== 0) {
108
+ obj.start = Math.round(message.start);
109
+ }
110
+ if (message.length !== 0) {
111
+ obj.length = Math.round(message.length);
112
+ }
113
+ if (message.type !== "") {
114
+ obj.type = message.type;
115
+ }
116
+ return obj;
117
+ },
118
+ create(base) {
119
+ return RequestRedactionRange.fromPartial(base ?? {});
120
+ },
121
+ fromPartial(object) {
122
+ const message = createBaseRequestRedactionRange();
123
+ message.start = object.start ?? 0;
124
+ message.length = object.length ?? 0;
125
+ message.type = object.type ?? "";
126
+ return message;
127
+ },
121
128
  };
122
129
  function createBaseResponseRedactionRange() {
123
- return { start: 0, length: 0 };
130
+ return { start: 0, length: 0 };
124
131
  }
125
- const ResponseRedactionRange = {
126
- encode(message, writer = new BinaryWriter()) {
127
- if (message.start !== 0) {
128
- writer.uint32(8).int32(message.start);
129
- }
130
- if (message.length !== 0) {
131
- writer.uint32(16).int32(message.length);
132
- }
133
- return writer;
134
- },
135
- decode(input, length) {
136
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
137
- let end = length === void 0 ? reader.len : reader.pos + length;
138
- const message = createBaseResponseRedactionRange();
139
- while (reader.pos < end) {
140
- const tag = reader.uint32();
141
- switch (tag >>> 3) {
142
- case 1: {
143
- if (tag !== 8) {
144
- break;
145
- }
146
- message.start = reader.int32();
147
- continue;
148
- }
149
- case 2: {
150
- if (tag !== 16) {
151
- break;
152
- }
153
- message.length = reader.int32();
154
- continue;
155
- }
156
- }
157
- if ((tag & 7) === 4 || tag === 0) {
158
- break;
159
- }
160
- reader.skip(tag & 7);
161
- }
162
- return message;
163
- },
164
- fromJSON(object) {
165
- return {
166
- start: isSet(object.start) ? globalThis.Number(object.start) : 0,
167
- length: isSet(object.length) ? globalThis.Number(object.length) : 0
168
- };
169
- },
170
- toJSON(message) {
171
- const obj = {};
172
- if (message.start !== 0) {
173
- obj.start = Math.round(message.start);
174
- }
175
- if (message.length !== 0) {
176
- obj.length = Math.round(message.length);
177
- }
178
- return obj;
179
- },
180
- create(base) {
181
- return ResponseRedactionRange.fromPartial(base ?? {});
182
- },
183
- fromPartial(object) {
184
- const message = createBaseResponseRedactionRange();
185
- message.start = object.start ?? 0;
186
- message.length = object.length ?? 0;
187
- return message;
188
- }
132
+ export const ResponseRedactionRange = {
133
+ encode(message, writer = new BinaryWriter()) {
134
+ if (message.start !== 0) {
135
+ writer.uint32(8).int32(message.start);
136
+ }
137
+ if (message.length !== 0) {
138
+ writer.uint32(16).int32(message.length);
139
+ }
140
+ return writer;
141
+ },
142
+ decode(input, length) {
143
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
144
+ let end = length === undefined ? reader.len : reader.pos + length;
145
+ const message = createBaseResponseRedactionRange();
146
+ while (reader.pos < end) {
147
+ const tag = reader.uint32();
148
+ switch (tag >>> 3) {
149
+ case 1: {
150
+ if (tag !== 8) {
151
+ break;
152
+ }
153
+ message.start = reader.int32();
154
+ continue;
155
+ }
156
+ case 2: {
157
+ if (tag !== 16) {
158
+ break;
159
+ }
160
+ message.length = reader.int32();
161
+ continue;
162
+ }
163
+ }
164
+ if ((tag & 7) === 4 || tag === 0) {
165
+ break;
166
+ }
167
+ reader.skip(tag & 7);
168
+ }
169
+ return message;
170
+ },
171
+ fromJSON(object) {
172
+ return {
173
+ start: isSet(object.start) ? globalThis.Number(object.start) : 0,
174
+ length: isSet(object.length) ? globalThis.Number(object.length) : 0,
175
+ };
176
+ },
177
+ toJSON(message) {
178
+ const obj = {};
179
+ if (message.start !== 0) {
180
+ obj.start = Math.round(message.start);
181
+ }
182
+ if (message.length !== 0) {
183
+ obj.length = Math.round(message.length);
184
+ }
185
+ return obj;
186
+ },
187
+ create(base) {
188
+ return ResponseRedactionRange.fromPartial(base ?? {});
189
+ },
190
+ fromPartial(object) {
191
+ const message = createBaseResponseRedactionRange();
192
+ message.start = object.start ?? 0;
193
+ message.length = object.length ?? 0;
194
+ return message;
195
+ },
189
196
  };
190
197
  function createBaseSignedRedactedDecryptionStream() {
191
- return { redactedStream: new Uint8Array(0), seqNum: 0 };
198
+ return { redactedStream: new Uint8Array(0), seqNum: 0 };
192
199
  }
193
- const SignedRedactedDecryptionStream = {
194
- encode(message, writer = new BinaryWriter()) {
195
- if (message.redactedStream.length !== 0) {
196
- writer.uint32(10).bytes(message.redactedStream);
197
- }
198
- if (message.seqNum !== 0) {
199
- writer.uint32(16).uint64(message.seqNum);
200
- }
201
- return writer;
202
- },
203
- decode(input, length) {
204
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
205
- let end = length === void 0 ? reader.len : reader.pos + length;
206
- const message = createBaseSignedRedactedDecryptionStream();
207
- while (reader.pos < end) {
208
- const tag = reader.uint32();
209
- switch (tag >>> 3) {
210
- case 1: {
211
- if (tag !== 10) {
212
- break;
213
- }
214
- message.redactedStream = reader.bytes();
215
- continue;
216
- }
217
- case 2: {
218
- if (tag !== 16) {
219
- break;
220
- }
221
- message.seqNum = longToNumber(reader.uint64());
222
- continue;
223
- }
224
- }
225
- if ((tag & 7) === 4 || tag === 0) {
226
- break;
227
- }
228
- reader.skip(tag & 7);
229
- }
230
- return message;
231
- },
232
- fromJSON(object) {
233
- return {
234
- redactedStream: isSet(object.redactedStream) ? bytesFromBase64(object.redactedStream) : new Uint8Array(0),
235
- seqNum: isSet(object.seqNum) ? globalThis.Number(object.seqNum) : 0
236
- };
237
- },
238
- toJSON(message) {
239
- const obj = {};
240
- if (message.redactedStream.length !== 0) {
241
- obj.redactedStream = base64FromBytes(message.redactedStream);
242
- }
243
- if (message.seqNum !== 0) {
244
- obj.seqNum = Math.round(message.seqNum);
245
- }
246
- return obj;
247
- },
248
- create(base) {
249
- return SignedRedactedDecryptionStream.fromPartial(base ?? {});
250
- },
251
- fromPartial(object) {
252
- const message = createBaseSignedRedactedDecryptionStream();
253
- message.redactedStream = object.redactedStream ?? new Uint8Array(0);
254
- message.seqNum = object.seqNum ?? 0;
255
- return message;
256
- }
200
+ export const SignedRedactedDecryptionStream = {
201
+ encode(message, writer = new BinaryWriter()) {
202
+ if (message.redactedStream.length !== 0) {
203
+ writer.uint32(10).bytes(message.redactedStream);
204
+ }
205
+ if (message.seqNum !== 0) {
206
+ writer.uint32(16).uint64(message.seqNum);
207
+ }
208
+ return writer;
209
+ },
210
+ decode(input, length) {
211
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
212
+ let end = length === undefined ? reader.len : reader.pos + length;
213
+ const message = createBaseSignedRedactedDecryptionStream();
214
+ while (reader.pos < end) {
215
+ const tag = reader.uint32();
216
+ switch (tag >>> 3) {
217
+ case 1: {
218
+ if (tag !== 10) {
219
+ break;
220
+ }
221
+ message.redactedStream = reader.bytes();
222
+ continue;
223
+ }
224
+ case 2: {
225
+ if (tag !== 16) {
226
+ break;
227
+ }
228
+ message.seqNum = longToNumber(reader.uint64());
229
+ continue;
230
+ }
231
+ }
232
+ if ((tag & 7) === 4 || tag === 0) {
233
+ break;
234
+ }
235
+ reader.skip(tag & 7);
236
+ }
237
+ return message;
238
+ },
239
+ fromJSON(object) {
240
+ return {
241
+ redactedStream: isSet(object.redactedStream) ? bytesFromBase64(object.redactedStream) : new Uint8Array(0),
242
+ seqNum: isSet(object.seqNum) ? globalThis.Number(object.seqNum) : 0,
243
+ };
244
+ },
245
+ toJSON(message) {
246
+ const obj = {};
247
+ if (message.redactedStream.length !== 0) {
248
+ obj.redactedStream = base64FromBytes(message.redactedStream);
249
+ }
250
+ if (message.seqNum !== 0) {
251
+ obj.seqNum = Math.round(message.seqNum);
252
+ }
253
+ return obj;
254
+ },
255
+ create(base) {
256
+ return SignedRedactedDecryptionStream.fromPartial(base ?? {});
257
+ },
258
+ fromPartial(object) {
259
+ const message = createBaseSignedRedactedDecryptionStream();
260
+ message.redactedStream = object.redactedStream ?? new Uint8Array(0);
261
+ message.seqNum = object.seqNum ?? 0;
262
+ return message;
263
+ },
257
264
  };
258
265
  function createBaseCertificateInfo() {
259
- return { commonName: "", issuerCommonName: "", notBeforeUnix: 0, notAfterUnix: 0, dnsNames: [] };
266
+ return { commonName: "", issuerCommonName: "", notBeforeUnix: 0, notAfterUnix: 0, dnsNames: [] };
260
267
  }
261
- const CertificateInfo = {
262
- encode(message, writer = new BinaryWriter()) {
263
- if (message.commonName !== "") {
264
- writer.uint32(10).string(message.commonName);
265
- }
266
- if (message.issuerCommonName !== "") {
267
- writer.uint32(18).string(message.issuerCommonName);
268
- }
269
- if (message.notBeforeUnix !== 0) {
270
- writer.uint32(24).uint64(message.notBeforeUnix);
271
- }
272
- if (message.notAfterUnix !== 0) {
273
- writer.uint32(32).uint64(message.notAfterUnix);
274
- }
275
- for (const v of message.dnsNames) {
276
- writer.uint32(42).string(v);
277
- }
278
- return writer;
279
- },
280
- decode(input, length) {
281
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
282
- let end = length === void 0 ? reader.len : reader.pos + length;
283
- const message = createBaseCertificateInfo();
284
- while (reader.pos < end) {
285
- const tag = reader.uint32();
286
- switch (tag >>> 3) {
287
- case 1: {
288
- if (tag !== 10) {
289
- break;
290
- }
291
- message.commonName = reader.string();
292
- continue;
293
- }
294
- case 2: {
295
- if (tag !== 18) {
296
- break;
297
- }
298
- message.issuerCommonName = reader.string();
299
- continue;
300
- }
301
- case 3: {
302
- if (tag !== 24) {
303
- break;
304
- }
305
- message.notBeforeUnix = longToNumber(reader.uint64());
306
- continue;
307
- }
308
- case 4: {
309
- if (tag !== 32) {
310
- break;
311
- }
312
- message.notAfterUnix = longToNumber(reader.uint64());
313
- continue;
314
- }
315
- case 5: {
316
- if (tag !== 42) {
317
- break;
318
- }
319
- message.dnsNames.push(reader.string());
320
- continue;
321
- }
322
- }
323
- if ((tag & 7) === 4 || tag === 0) {
324
- break;
325
- }
326
- reader.skip(tag & 7);
327
- }
328
- return message;
329
- },
330
- fromJSON(object) {
331
- return {
332
- commonName: isSet(object.commonName) ? globalThis.String(object.commonName) : "",
333
- issuerCommonName: isSet(object.issuerCommonName) ? globalThis.String(object.issuerCommonName) : "",
334
- notBeforeUnix: isSet(object.notBeforeUnix) ? globalThis.Number(object.notBeforeUnix) : 0,
335
- notAfterUnix: isSet(object.notAfterUnix) ? globalThis.Number(object.notAfterUnix) : 0,
336
- dnsNames: globalThis.Array.isArray(object?.dnsNames) ? object.dnsNames.map((e) => globalThis.String(e)) : []
337
- };
338
- },
339
- toJSON(message) {
340
- const obj = {};
341
- if (message.commonName !== "") {
342
- obj.commonName = message.commonName;
343
- }
344
- if (message.issuerCommonName !== "") {
345
- obj.issuerCommonName = message.issuerCommonName;
346
- }
347
- if (message.notBeforeUnix !== 0) {
348
- obj.notBeforeUnix = Math.round(message.notBeforeUnix);
349
- }
350
- if (message.notAfterUnix !== 0) {
351
- obj.notAfterUnix = Math.round(message.notAfterUnix);
352
- }
353
- if (message.dnsNames?.length) {
354
- obj.dnsNames = message.dnsNames;
355
- }
356
- return obj;
357
- },
358
- create(base) {
359
- return CertificateInfo.fromPartial(base ?? {});
360
- },
361
- fromPartial(object) {
362
- const message = createBaseCertificateInfo();
363
- message.commonName = object.commonName ?? "";
364
- message.issuerCommonName = object.issuerCommonName ?? "";
365
- message.notBeforeUnix = object.notBeforeUnix ?? 0;
366
- message.notAfterUnix = object.notAfterUnix ?? 0;
367
- message.dnsNames = object.dnsNames?.map((e) => e) || [];
368
- return message;
369
- }
268
+ export const CertificateInfo = {
269
+ encode(message, writer = new BinaryWriter()) {
270
+ if (message.commonName !== "") {
271
+ writer.uint32(10).string(message.commonName);
272
+ }
273
+ if (message.issuerCommonName !== "") {
274
+ writer.uint32(18).string(message.issuerCommonName);
275
+ }
276
+ if (message.notBeforeUnix !== 0) {
277
+ writer.uint32(24).uint64(message.notBeforeUnix);
278
+ }
279
+ if (message.notAfterUnix !== 0) {
280
+ writer.uint32(32).uint64(message.notAfterUnix);
281
+ }
282
+ for (const v of message.dnsNames) {
283
+ writer.uint32(42).string(v);
284
+ }
285
+ return writer;
286
+ },
287
+ decode(input, length) {
288
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
289
+ let end = length === undefined ? reader.len : reader.pos + length;
290
+ const message = createBaseCertificateInfo();
291
+ while (reader.pos < end) {
292
+ const tag = reader.uint32();
293
+ switch (tag >>> 3) {
294
+ case 1: {
295
+ if (tag !== 10) {
296
+ break;
297
+ }
298
+ message.commonName = reader.string();
299
+ continue;
300
+ }
301
+ case 2: {
302
+ if (tag !== 18) {
303
+ break;
304
+ }
305
+ message.issuerCommonName = reader.string();
306
+ continue;
307
+ }
308
+ case 3: {
309
+ if (tag !== 24) {
310
+ break;
311
+ }
312
+ message.notBeforeUnix = longToNumber(reader.uint64());
313
+ continue;
314
+ }
315
+ case 4: {
316
+ if (tag !== 32) {
317
+ break;
318
+ }
319
+ message.notAfterUnix = longToNumber(reader.uint64());
320
+ continue;
321
+ }
322
+ case 5: {
323
+ if (tag !== 42) {
324
+ break;
325
+ }
326
+ message.dnsNames.push(reader.string());
327
+ continue;
328
+ }
329
+ }
330
+ if ((tag & 7) === 4 || tag === 0) {
331
+ break;
332
+ }
333
+ reader.skip(tag & 7);
334
+ }
335
+ return message;
336
+ },
337
+ fromJSON(object) {
338
+ return {
339
+ commonName: isSet(object.commonName) ? globalThis.String(object.commonName) : "",
340
+ issuerCommonName: isSet(object.issuerCommonName) ? globalThis.String(object.issuerCommonName) : "",
341
+ notBeforeUnix: isSet(object.notBeforeUnix) ? globalThis.Number(object.notBeforeUnix) : 0,
342
+ notAfterUnix: isSet(object.notAfterUnix) ? globalThis.Number(object.notAfterUnix) : 0,
343
+ dnsNames: globalThis.Array.isArray(object?.dnsNames) ? object.dnsNames.map((e) => globalThis.String(e)) : [],
344
+ };
345
+ },
346
+ toJSON(message) {
347
+ const obj = {};
348
+ if (message.commonName !== "") {
349
+ obj.commonName = message.commonName;
350
+ }
351
+ if (message.issuerCommonName !== "") {
352
+ obj.issuerCommonName = message.issuerCommonName;
353
+ }
354
+ if (message.notBeforeUnix !== 0) {
355
+ obj.notBeforeUnix = Math.round(message.notBeforeUnix);
356
+ }
357
+ if (message.notAfterUnix !== 0) {
358
+ obj.notAfterUnix = Math.round(message.notAfterUnix);
359
+ }
360
+ if (message.dnsNames?.length) {
361
+ obj.dnsNames = message.dnsNames;
362
+ }
363
+ return obj;
364
+ },
365
+ create(base) {
366
+ return CertificateInfo.fromPartial(base ?? {});
367
+ },
368
+ fromPartial(object) {
369
+ const message = createBaseCertificateInfo();
370
+ message.commonName = object.commonName ?? "";
371
+ message.issuerCommonName = object.issuerCommonName ?? "";
372
+ message.notBeforeUnix = object.notBeforeUnix ?? 0;
373
+ message.notAfterUnix = object.notAfterUnix ?? 0;
374
+ message.dnsNames = object.dnsNames?.map((e) => e) || [];
375
+ return message;
376
+ },
370
377
  };
371
378
  function createBaseHandshakeSecrets() {
372
- return { handshakeKey: new Uint8Array(0), handshakeIv: new Uint8Array(0), cipherSuite: 0, algorithm: "" };
379
+ return { handshakeKey: new Uint8Array(0), handshakeIv: new Uint8Array(0), cipherSuite: 0, algorithm: "" };
373
380
  }
374
- const HandshakeSecrets = {
375
- encode(message, writer = new BinaryWriter()) {
376
- if (message.handshakeKey.length !== 0) {
377
- writer.uint32(10).bytes(message.handshakeKey);
378
- }
379
- if (message.handshakeIv.length !== 0) {
380
- writer.uint32(18).bytes(message.handshakeIv);
381
- }
382
- if (message.cipherSuite !== 0) {
383
- writer.uint32(24).uint32(message.cipherSuite);
384
- }
385
- if (message.algorithm !== "") {
386
- writer.uint32(34).string(message.algorithm);
387
- }
388
- return writer;
389
- },
390
- decode(input, length) {
391
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
392
- let end = length === void 0 ? reader.len : reader.pos + length;
393
- const message = createBaseHandshakeSecrets();
394
- while (reader.pos < end) {
395
- const tag = reader.uint32();
396
- switch (tag >>> 3) {
397
- case 1: {
398
- if (tag !== 10) {
399
- break;
400
- }
401
- message.handshakeKey = reader.bytes();
402
- continue;
403
- }
404
- case 2: {
405
- if (tag !== 18) {
406
- break;
407
- }
408
- message.handshakeIv = reader.bytes();
409
- continue;
410
- }
411
- case 3: {
412
- if (tag !== 24) {
413
- break;
414
- }
415
- message.cipherSuite = reader.uint32();
416
- continue;
417
- }
418
- case 4: {
419
- if (tag !== 34) {
420
- break;
421
- }
422
- message.algorithm = reader.string();
423
- continue;
424
- }
425
- }
426
- if ((tag & 7) === 4 || tag === 0) {
427
- break;
428
- }
429
- reader.skip(tag & 7);
430
- }
431
- return message;
432
- },
433
- fromJSON(object) {
434
- return {
435
- handshakeKey: isSet(object.handshakeKey) ? bytesFromBase64(object.handshakeKey) : new Uint8Array(0),
436
- handshakeIv: isSet(object.handshakeIv) ? bytesFromBase64(object.handshakeIv) : new Uint8Array(0),
437
- cipherSuite: isSet(object.cipherSuite) ? globalThis.Number(object.cipherSuite) : 0,
438
- algorithm: isSet(object.algorithm) ? globalThis.String(object.algorithm) : ""
439
- };
440
- },
441
- toJSON(message) {
442
- const obj = {};
443
- if (message.handshakeKey.length !== 0) {
444
- obj.handshakeKey = base64FromBytes(message.handshakeKey);
445
- }
446
- if (message.handshakeIv.length !== 0) {
447
- obj.handshakeIv = base64FromBytes(message.handshakeIv);
448
- }
449
- if (message.cipherSuite !== 0) {
450
- obj.cipherSuite = Math.round(message.cipherSuite);
451
- }
452
- if (message.algorithm !== "") {
453
- obj.algorithm = message.algorithm;
454
- }
455
- return obj;
456
- },
457
- create(base) {
458
- return HandshakeSecrets.fromPartial(base ?? {});
459
- },
460
- fromPartial(object) {
461
- const message = createBaseHandshakeSecrets();
462
- message.handshakeKey = object.handshakeKey ?? new Uint8Array(0);
463
- message.handshakeIv = object.handshakeIv ?? new Uint8Array(0);
464
- message.cipherSuite = object.cipherSuite ?? 0;
465
- message.algorithm = object.algorithm ?? "";
466
- return message;
467
- }
381
+ export const HandshakeSecrets = {
382
+ encode(message, writer = new BinaryWriter()) {
383
+ if (message.handshakeKey.length !== 0) {
384
+ writer.uint32(10).bytes(message.handshakeKey);
385
+ }
386
+ if (message.handshakeIv.length !== 0) {
387
+ writer.uint32(18).bytes(message.handshakeIv);
388
+ }
389
+ if (message.cipherSuite !== 0) {
390
+ writer.uint32(24).uint32(message.cipherSuite);
391
+ }
392
+ if (message.algorithm !== "") {
393
+ writer.uint32(34).string(message.algorithm);
394
+ }
395
+ return writer;
396
+ },
397
+ decode(input, length) {
398
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
399
+ let end = length === undefined ? reader.len : reader.pos + length;
400
+ const message = createBaseHandshakeSecrets();
401
+ while (reader.pos < end) {
402
+ const tag = reader.uint32();
403
+ switch (tag >>> 3) {
404
+ case 1: {
405
+ if (tag !== 10) {
406
+ break;
407
+ }
408
+ message.handshakeKey = reader.bytes();
409
+ continue;
410
+ }
411
+ case 2: {
412
+ if (tag !== 18) {
413
+ break;
414
+ }
415
+ message.handshakeIv = reader.bytes();
416
+ continue;
417
+ }
418
+ case 3: {
419
+ if (tag !== 24) {
420
+ break;
421
+ }
422
+ message.cipherSuite = reader.uint32();
423
+ continue;
424
+ }
425
+ case 4: {
426
+ if (tag !== 34) {
427
+ break;
428
+ }
429
+ message.algorithm = reader.string();
430
+ continue;
431
+ }
432
+ }
433
+ if ((tag & 7) === 4 || tag === 0) {
434
+ break;
435
+ }
436
+ reader.skip(tag & 7);
437
+ }
438
+ return message;
439
+ },
440
+ fromJSON(object) {
441
+ return {
442
+ handshakeKey: isSet(object.handshakeKey) ? bytesFromBase64(object.handshakeKey) : new Uint8Array(0),
443
+ handshakeIv: isSet(object.handshakeIv) ? bytesFromBase64(object.handshakeIv) : new Uint8Array(0),
444
+ cipherSuite: isSet(object.cipherSuite) ? globalThis.Number(object.cipherSuite) : 0,
445
+ algorithm: isSet(object.algorithm) ? globalThis.String(object.algorithm) : "",
446
+ };
447
+ },
448
+ toJSON(message) {
449
+ const obj = {};
450
+ if (message.handshakeKey.length !== 0) {
451
+ obj.handshakeKey = base64FromBytes(message.handshakeKey);
452
+ }
453
+ if (message.handshakeIv.length !== 0) {
454
+ obj.handshakeIv = base64FromBytes(message.handshakeIv);
455
+ }
456
+ if (message.cipherSuite !== 0) {
457
+ obj.cipherSuite = Math.round(message.cipherSuite);
458
+ }
459
+ if (message.algorithm !== "") {
460
+ obj.algorithm = message.algorithm;
461
+ }
462
+ return obj;
463
+ },
464
+ create(base) {
465
+ return HandshakeSecrets.fromPartial(base ?? {});
466
+ },
467
+ fromPartial(object) {
468
+ const message = createBaseHandshakeSecrets();
469
+ message.handshakeKey = object.handshakeKey ?? new Uint8Array(0);
470
+ message.handshakeIv = object.handshakeIv ?? new Uint8Array(0);
471
+ message.cipherSuite = object.cipherSuite ?? 0;
472
+ message.algorithm = object.algorithm ?? "";
473
+ return message;
474
+ },
468
475
  };
469
476
  function createBaseOpening() {
470
- return { proofStream: new Uint8Array(0) };
477
+ return { proofStream: new Uint8Array(0) };
471
478
  }
472
- const Opening = {
473
- encode(message, writer = new BinaryWriter()) {
474
- if (message.proofStream.length !== 0) {
475
- writer.uint32(10).bytes(message.proofStream);
476
- }
477
- return writer;
478
- },
479
- decode(input, length) {
480
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
481
- let end = length === void 0 ? reader.len : reader.pos + length;
482
- const message = createBaseOpening();
483
- while (reader.pos < end) {
484
- const tag = reader.uint32();
485
- switch (tag >>> 3) {
486
- case 1: {
487
- if (tag !== 10) {
488
- break;
489
- }
490
- message.proofStream = reader.bytes();
491
- continue;
492
- }
493
- }
494
- if ((tag & 7) === 4 || tag === 0) {
495
- break;
496
- }
497
- reader.skip(tag & 7);
498
- }
499
- return message;
500
- },
501
- fromJSON(object) {
502
- return { proofStream: isSet(object.proofStream) ? bytesFromBase64(object.proofStream) : new Uint8Array(0) };
503
- },
504
- toJSON(message) {
505
- const obj = {};
506
- if (message.proofStream.length !== 0) {
507
- obj.proofStream = base64FromBytes(message.proofStream);
508
- }
509
- return obj;
510
- },
511
- create(base) {
512
- return Opening.fromPartial(base ?? {});
513
- },
514
- fromPartial(object) {
515
- const message = createBaseOpening();
516
- message.proofStream = object.proofStream ?? new Uint8Array(0);
517
- return message;
518
- }
479
+ export const Opening = {
480
+ encode(message, writer = new BinaryWriter()) {
481
+ if (message.proofStream.length !== 0) {
482
+ writer.uint32(10).bytes(message.proofStream);
483
+ }
484
+ return writer;
485
+ },
486
+ decode(input, length) {
487
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
488
+ let end = length === undefined ? reader.len : reader.pos + length;
489
+ const message = createBaseOpening();
490
+ while (reader.pos < end) {
491
+ const tag = reader.uint32();
492
+ switch (tag >>> 3) {
493
+ case 1: {
494
+ if (tag !== 10) {
495
+ break;
496
+ }
497
+ message.proofStream = reader.bytes();
498
+ continue;
499
+ }
500
+ }
501
+ if ((tag & 7) === 4 || tag === 0) {
502
+ break;
503
+ }
504
+ reader.skip(tag & 7);
505
+ }
506
+ return message;
507
+ },
508
+ fromJSON(object) {
509
+ return { proofStream: isSet(object.proofStream) ? bytesFromBase64(object.proofStream) : new Uint8Array(0) };
510
+ },
511
+ toJSON(message) {
512
+ const obj = {};
513
+ if (message.proofStream.length !== 0) {
514
+ obj.proofStream = base64FromBytes(message.proofStream);
515
+ }
516
+ return obj;
517
+ },
518
+ create(base) {
519
+ return Opening.fromPartial(base ?? {});
520
+ },
521
+ fromPartial(object) {
522
+ const message = createBaseOpening();
523
+ message.proofStream = object.proofStream ?? new Uint8Array(0);
524
+ return message;
525
+ },
519
526
  };
520
527
  function createBaseOPRFOutput() {
521
- return { tlsStart: 0, tlsLength: 0, hashOutput: new Uint8Array(0) };
528
+ return { tlsStart: 0, tlsLength: 0, hashOutput: new Uint8Array(0) };
522
529
  }
523
- const OPRFOutput = {
524
- encode(message, writer = new BinaryWriter()) {
525
- if (message.tlsStart !== 0) {
526
- writer.uint32(8).int32(message.tlsStart);
527
- }
528
- if (message.tlsLength !== 0) {
529
- writer.uint32(16).int32(message.tlsLength);
530
- }
531
- if (message.hashOutput.length !== 0) {
532
- writer.uint32(26).bytes(message.hashOutput);
533
- }
534
- return writer;
535
- },
536
- decode(input, length) {
537
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
538
- let end = length === void 0 ? reader.len : reader.pos + length;
539
- const message = createBaseOPRFOutput();
540
- while (reader.pos < end) {
541
- const tag = reader.uint32();
542
- switch (tag >>> 3) {
543
- case 1: {
544
- if (tag !== 8) {
545
- break;
546
- }
547
- message.tlsStart = reader.int32();
548
- continue;
549
- }
550
- case 2: {
551
- if (tag !== 16) {
552
- break;
553
- }
554
- message.tlsLength = reader.int32();
555
- continue;
556
- }
557
- case 3: {
558
- if (tag !== 26) {
559
- break;
560
- }
561
- message.hashOutput = reader.bytes();
562
- continue;
563
- }
564
- }
565
- if ((tag & 7) === 4 || tag === 0) {
566
- break;
567
- }
568
- reader.skip(tag & 7);
569
- }
570
- return message;
571
- },
572
- fromJSON(object) {
573
- return {
574
- tlsStart: isSet(object.tlsStart) ? globalThis.Number(object.tlsStart) : 0,
575
- tlsLength: isSet(object.tlsLength) ? globalThis.Number(object.tlsLength) : 0,
576
- hashOutput: isSet(object.hashOutput) ? bytesFromBase64(object.hashOutput) : new Uint8Array(0)
577
- };
578
- },
579
- toJSON(message) {
580
- const obj = {};
581
- if (message.tlsStart !== 0) {
582
- obj.tlsStart = Math.round(message.tlsStart);
583
- }
584
- if (message.tlsLength !== 0) {
585
- obj.tlsLength = Math.round(message.tlsLength);
586
- }
587
- if (message.hashOutput.length !== 0) {
588
- obj.hashOutput = base64FromBytes(message.hashOutput);
589
- }
590
- return obj;
591
- },
592
- create(base) {
593
- return OPRFOutput.fromPartial(base ?? {});
594
- },
595
- fromPartial(object) {
596
- const message = createBaseOPRFOutput();
597
- message.tlsStart = object.tlsStart ?? 0;
598
- message.tlsLength = object.tlsLength ?? 0;
599
- message.hashOutput = object.hashOutput ?? new Uint8Array(0);
600
- return message;
601
- }
530
+ export const OPRFOutput = {
531
+ encode(message, writer = new BinaryWriter()) {
532
+ if (message.tlsStart !== 0) {
533
+ writer.uint32(8).int32(message.tlsStart);
534
+ }
535
+ if (message.tlsLength !== 0) {
536
+ writer.uint32(16).int32(message.tlsLength);
537
+ }
538
+ if (message.hashOutput.length !== 0) {
539
+ writer.uint32(26).bytes(message.hashOutput);
540
+ }
541
+ return writer;
542
+ },
543
+ decode(input, length) {
544
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
545
+ let end = length === undefined ? reader.len : reader.pos + length;
546
+ const message = createBaseOPRFOutput();
547
+ while (reader.pos < end) {
548
+ const tag = reader.uint32();
549
+ switch (tag >>> 3) {
550
+ case 1: {
551
+ if (tag !== 8) {
552
+ break;
553
+ }
554
+ message.tlsStart = reader.int32();
555
+ continue;
556
+ }
557
+ case 2: {
558
+ if (tag !== 16) {
559
+ break;
560
+ }
561
+ message.tlsLength = reader.int32();
562
+ continue;
563
+ }
564
+ case 3: {
565
+ if (tag !== 26) {
566
+ break;
567
+ }
568
+ message.hashOutput = reader.bytes();
569
+ continue;
570
+ }
571
+ }
572
+ if ((tag & 7) === 4 || tag === 0) {
573
+ break;
574
+ }
575
+ reader.skip(tag & 7);
576
+ }
577
+ return message;
578
+ },
579
+ fromJSON(object) {
580
+ return {
581
+ tlsStart: isSet(object.tlsStart) ? globalThis.Number(object.tlsStart) : 0,
582
+ tlsLength: isSet(object.tlsLength) ? globalThis.Number(object.tlsLength) : 0,
583
+ hashOutput: isSet(object.hashOutput) ? bytesFromBase64(object.hashOutput) : new Uint8Array(0),
584
+ };
585
+ },
586
+ toJSON(message) {
587
+ const obj = {};
588
+ if (message.tlsStart !== 0) {
589
+ obj.tlsStart = Math.round(message.tlsStart);
590
+ }
591
+ if (message.tlsLength !== 0) {
592
+ obj.tlsLength = Math.round(message.tlsLength);
593
+ }
594
+ if (message.hashOutput.length !== 0) {
595
+ obj.hashOutput = base64FromBytes(message.hashOutput);
596
+ }
597
+ return obj;
598
+ },
599
+ create(base) {
600
+ return OPRFOutput.fromPartial(base ?? {});
601
+ },
602
+ fromPartial(object) {
603
+ const message = createBaseOPRFOutput();
604
+ message.tlsStart = object.tlsStart ?? 0;
605
+ message.tlsLength = object.tlsLength ?? 0;
606
+ message.hashOutput = object.hashOutput ?? new Uint8Array(0);
607
+ return message;
608
+ },
602
609
  };
603
610
  function createBaseKOutputPayload() {
604
- return {
605
- redactedRequest: new Uint8Array(0),
606
- requestRedactionRanges: [],
607
- consolidatedResponseKeystream: new Uint8Array(0),
608
- certificateInfo: void 0,
609
- responseRedactionRanges: [],
610
- timestampMs: 0,
611
- sessionId: "",
612
- oprfOutputs: []
613
- };
614
- }
615
- const KOutputPayload = {
616
- encode(message, writer = new BinaryWriter()) {
617
- if (message.redactedRequest.length !== 0) {
618
- writer.uint32(10).bytes(message.redactedRequest);
619
- }
620
- for (const v of message.requestRedactionRanges) {
621
- RequestRedactionRange.encode(v, writer.uint32(18).fork()).join();
622
- }
623
- if (message.consolidatedResponseKeystream.length !== 0) {
624
- writer.uint32(26).bytes(message.consolidatedResponseKeystream);
625
- }
626
- if (message.certificateInfo !== void 0) {
627
- CertificateInfo.encode(message.certificateInfo, writer.uint32(34).fork()).join();
628
- }
629
- for (const v of message.responseRedactionRanges) {
630
- ResponseRedactionRange.encode(v, writer.uint32(42).fork()).join();
631
- }
632
- if (message.timestampMs !== 0) {
633
- writer.uint32(48).uint64(message.timestampMs);
634
- }
635
- if (message.sessionId !== "") {
636
- writer.uint32(58).string(message.sessionId);
637
- }
638
- for (const v of message.oprfOutputs) {
639
- OPRFOutput.encode(v, writer.uint32(82).fork()).join();
640
- }
641
- return writer;
642
- },
643
- decode(input, length) {
644
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
645
- let end = length === void 0 ? reader.len : reader.pos + length;
646
- const message = createBaseKOutputPayload();
647
- while (reader.pos < end) {
648
- const tag = reader.uint32();
649
- switch (tag >>> 3) {
650
- case 1: {
651
- if (tag !== 10) {
652
- break;
653
- }
654
- message.redactedRequest = reader.bytes();
655
- continue;
656
- }
657
- case 2: {
658
- if (tag !== 18) {
659
- break;
660
- }
661
- message.requestRedactionRanges.push(RequestRedactionRange.decode(reader, reader.uint32()));
662
- continue;
663
- }
664
- case 3: {
665
- if (tag !== 26) {
666
- break;
667
- }
668
- message.consolidatedResponseKeystream = reader.bytes();
669
- continue;
670
- }
671
- case 4: {
672
- if (tag !== 34) {
673
- break;
674
- }
675
- message.certificateInfo = CertificateInfo.decode(reader, reader.uint32());
676
- continue;
677
- }
678
- case 5: {
679
- if (tag !== 42) {
680
- break;
681
- }
682
- message.responseRedactionRanges.push(ResponseRedactionRange.decode(reader, reader.uint32()));
683
- continue;
684
- }
685
- case 6: {
686
- if (tag !== 48) {
687
- break;
688
- }
689
- message.timestampMs = longToNumber(reader.uint64());
690
- continue;
691
- }
692
- case 7: {
693
- if (tag !== 58) {
694
- break;
695
- }
696
- message.sessionId = reader.string();
697
- continue;
698
- }
699
- case 10: {
700
- if (tag !== 82) {
701
- break;
702
- }
703
- message.oprfOutputs.push(OPRFOutput.decode(reader, reader.uint32()));
704
- continue;
705
- }
706
- }
707
- if ((tag & 7) === 4 || tag === 0) {
708
- break;
709
- }
710
- reader.skip(tag & 7);
711
- }
712
- return message;
713
- },
714
- fromJSON(object) {
715
611
  return {
716
- redactedRequest: isSet(object.redactedRequest) ? bytesFromBase64(object.redactedRequest) : new Uint8Array(0),
717
- requestRedactionRanges: globalThis.Array.isArray(object?.requestRedactionRanges) ? object.requestRedactionRanges.map((e) => RequestRedactionRange.fromJSON(e)) : [],
718
- consolidatedResponseKeystream: isSet(object.consolidatedResponseKeystream) ? bytesFromBase64(object.consolidatedResponseKeystream) : new Uint8Array(0),
719
- certificateInfo: isSet(object.certificateInfo) ? CertificateInfo.fromJSON(object.certificateInfo) : void 0,
720
- responseRedactionRanges: globalThis.Array.isArray(object?.responseRedactionRanges) ? object.responseRedactionRanges.map((e) => ResponseRedactionRange.fromJSON(e)) : [],
721
- timestampMs: isSet(object.timestampMs) ? globalThis.Number(object.timestampMs) : 0,
722
- sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : "",
723
- oprfOutputs: globalThis.Array.isArray(object?.oprfOutputs) ? object.oprfOutputs.map((e) => OPRFOutput.fromJSON(e)) : []
612
+ redactedRequest: new Uint8Array(0),
613
+ requestRedactionRanges: [],
614
+ consolidatedResponseKeystream: new Uint8Array(0),
615
+ certificateInfo: undefined,
616
+ responseRedactionRanges: [],
617
+ timestampMs: 0,
618
+ sessionId: "",
619
+ oprfOutputs: [],
724
620
  };
725
- },
726
- toJSON(message) {
727
- const obj = {};
728
- if (message.redactedRequest.length !== 0) {
729
- obj.redactedRequest = base64FromBytes(message.redactedRequest);
730
- }
731
- if (message.requestRedactionRanges?.length) {
732
- obj.requestRedactionRanges = message.requestRedactionRanges.map((e) => RequestRedactionRange.toJSON(e));
733
- }
734
- if (message.consolidatedResponseKeystream.length !== 0) {
735
- obj.consolidatedResponseKeystream = base64FromBytes(message.consolidatedResponseKeystream);
736
- }
737
- if (message.certificateInfo !== void 0) {
738
- obj.certificateInfo = CertificateInfo.toJSON(message.certificateInfo);
739
- }
740
- if (message.responseRedactionRanges?.length) {
741
- obj.responseRedactionRanges = message.responseRedactionRanges.map((e) => ResponseRedactionRange.toJSON(e));
742
- }
743
- if (message.timestampMs !== 0) {
744
- obj.timestampMs = Math.round(message.timestampMs);
745
- }
746
- if (message.sessionId !== "") {
747
- obj.sessionId = message.sessionId;
748
- }
749
- if (message.oprfOutputs?.length) {
750
- obj.oprfOutputs = message.oprfOutputs.map((e) => OPRFOutput.toJSON(e));
751
- }
752
- return obj;
753
- },
754
- create(base) {
755
- return KOutputPayload.fromPartial(base ?? {});
756
- },
757
- fromPartial(object) {
758
- const message = createBaseKOutputPayload();
759
- message.redactedRequest = object.redactedRequest ?? new Uint8Array(0);
760
- message.requestRedactionRanges = object.requestRedactionRanges?.map((e) => RequestRedactionRange.fromPartial(e)) || [];
761
- message.consolidatedResponseKeystream = object.consolidatedResponseKeystream ?? new Uint8Array(0);
762
- message.certificateInfo = object.certificateInfo !== void 0 && object.certificateInfo !== null ? CertificateInfo.fromPartial(object.certificateInfo) : void 0;
763
- message.responseRedactionRanges = object.responseRedactionRanges?.map((e) => ResponseRedactionRange.fromPartial(e)) || [];
764
- message.timestampMs = object.timestampMs ?? 0;
765
- message.sessionId = object.sessionId ?? "";
766
- message.oprfOutputs = object.oprfOutputs?.map((e) => OPRFOutput.fromPartial(e)) || [];
767
- return message;
768
- }
621
+ }
622
+ export const KOutputPayload = {
623
+ encode(message, writer = new BinaryWriter()) {
624
+ if (message.redactedRequest.length !== 0) {
625
+ writer.uint32(10).bytes(message.redactedRequest);
626
+ }
627
+ for (const v of message.requestRedactionRanges) {
628
+ RequestRedactionRange.encode(v, writer.uint32(18).fork()).join();
629
+ }
630
+ if (message.consolidatedResponseKeystream.length !== 0) {
631
+ writer.uint32(26).bytes(message.consolidatedResponseKeystream);
632
+ }
633
+ if (message.certificateInfo !== undefined) {
634
+ CertificateInfo.encode(message.certificateInfo, writer.uint32(34).fork()).join();
635
+ }
636
+ for (const v of message.responseRedactionRanges) {
637
+ ResponseRedactionRange.encode(v, writer.uint32(42).fork()).join();
638
+ }
639
+ if (message.timestampMs !== 0) {
640
+ writer.uint32(48).uint64(message.timestampMs);
641
+ }
642
+ if (message.sessionId !== "") {
643
+ writer.uint32(58).string(message.sessionId);
644
+ }
645
+ for (const v of message.oprfOutputs) {
646
+ OPRFOutput.encode(v, writer.uint32(82).fork()).join();
647
+ }
648
+ return writer;
649
+ },
650
+ decode(input, length) {
651
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
652
+ let end = length === undefined ? reader.len : reader.pos + length;
653
+ const message = createBaseKOutputPayload();
654
+ while (reader.pos < end) {
655
+ const tag = reader.uint32();
656
+ switch (tag >>> 3) {
657
+ case 1: {
658
+ if (tag !== 10) {
659
+ break;
660
+ }
661
+ message.redactedRequest = reader.bytes();
662
+ continue;
663
+ }
664
+ case 2: {
665
+ if (tag !== 18) {
666
+ break;
667
+ }
668
+ message.requestRedactionRanges.push(RequestRedactionRange.decode(reader, reader.uint32()));
669
+ continue;
670
+ }
671
+ case 3: {
672
+ if (tag !== 26) {
673
+ break;
674
+ }
675
+ message.consolidatedResponseKeystream = reader.bytes();
676
+ continue;
677
+ }
678
+ case 4: {
679
+ if (tag !== 34) {
680
+ break;
681
+ }
682
+ message.certificateInfo = CertificateInfo.decode(reader, reader.uint32());
683
+ continue;
684
+ }
685
+ case 5: {
686
+ if (tag !== 42) {
687
+ break;
688
+ }
689
+ message.responseRedactionRanges.push(ResponseRedactionRange.decode(reader, reader.uint32()));
690
+ continue;
691
+ }
692
+ case 6: {
693
+ if (tag !== 48) {
694
+ break;
695
+ }
696
+ message.timestampMs = longToNumber(reader.uint64());
697
+ continue;
698
+ }
699
+ case 7: {
700
+ if (tag !== 58) {
701
+ break;
702
+ }
703
+ message.sessionId = reader.string();
704
+ continue;
705
+ }
706
+ case 10: {
707
+ if (tag !== 82) {
708
+ break;
709
+ }
710
+ message.oprfOutputs.push(OPRFOutput.decode(reader, reader.uint32()));
711
+ continue;
712
+ }
713
+ }
714
+ if ((tag & 7) === 4 || tag === 0) {
715
+ break;
716
+ }
717
+ reader.skip(tag & 7);
718
+ }
719
+ return message;
720
+ },
721
+ fromJSON(object) {
722
+ return {
723
+ redactedRequest: isSet(object.redactedRequest) ? bytesFromBase64(object.redactedRequest) : new Uint8Array(0),
724
+ requestRedactionRanges: globalThis.Array.isArray(object?.requestRedactionRanges)
725
+ ? object.requestRedactionRanges.map((e) => RequestRedactionRange.fromJSON(e))
726
+ : [],
727
+ consolidatedResponseKeystream: isSet(object.consolidatedResponseKeystream)
728
+ ? bytesFromBase64(object.consolidatedResponseKeystream)
729
+ : new Uint8Array(0),
730
+ certificateInfo: isSet(object.certificateInfo) ? CertificateInfo.fromJSON(object.certificateInfo) : undefined,
731
+ responseRedactionRanges: globalThis.Array.isArray(object?.responseRedactionRanges)
732
+ ? object.responseRedactionRanges.map((e) => ResponseRedactionRange.fromJSON(e))
733
+ : [],
734
+ timestampMs: isSet(object.timestampMs) ? globalThis.Number(object.timestampMs) : 0,
735
+ sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : "",
736
+ oprfOutputs: globalThis.Array.isArray(object?.oprfOutputs)
737
+ ? object.oprfOutputs.map((e) => OPRFOutput.fromJSON(e))
738
+ : [],
739
+ };
740
+ },
741
+ toJSON(message) {
742
+ const obj = {};
743
+ if (message.redactedRequest.length !== 0) {
744
+ obj.redactedRequest = base64FromBytes(message.redactedRequest);
745
+ }
746
+ if (message.requestRedactionRanges?.length) {
747
+ obj.requestRedactionRanges = message.requestRedactionRanges.map((e) => RequestRedactionRange.toJSON(e));
748
+ }
749
+ if (message.consolidatedResponseKeystream.length !== 0) {
750
+ obj.consolidatedResponseKeystream = base64FromBytes(message.consolidatedResponseKeystream);
751
+ }
752
+ if (message.certificateInfo !== undefined) {
753
+ obj.certificateInfo = CertificateInfo.toJSON(message.certificateInfo);
754
+ }
755
+ if (message.responseRedactionRanges?.length) {
756
+ obj.responseRedactionRanges = message.responseRedactionRanges.map((e) => ResponseRedactionRange.toJSON(e));
757
+ }
758
+ if (message.timestampMs !== 0) {
759
+ obj.timestampMs = Math.round(message.timestampMs);
760
+ }
761
+ if (message.sessionId !== "") {
762
+ obj.sessionId = message.sessionId;
763
+ }
764
+ if (message.oprfOutputs?.length) {
765
+ obj.oprfOutputs = message.oprfOutputs.map((e) => OPRFOutput.toJSON(e));
766
+ }
767
+ return obj;
768
+ },
769
+ create(base) {
770
+ return KOutputPayload.fromPartial(base ?? {});
771
+ },
772
+ fromPartial(object) {
773
+ const message = createBaseKOutputPayload();
774
+ message.redactedRequest = object.redactedRequest ?? new Uint8Array(0);
775
+ message.requestRedactionRanges = object.requestRedactionRanges?.map((e) => RequestRedactionRange.fromPartial(e)) ||
776
+ [];
777
+ message.consolidatedResponseKeystream = object.consolidatedResponseKeystream ?? new Uint8Array(0);
778
+ message.certificateInfo = (object.certificateInfo !== undefined && object.certificateInfo !== null)
779
+ ? CertificateInfo.fromPartial(object.certificateInfo)
780
+ : undefined;
781
+ message.responseRedactionRanges =
782
+ object.responseRedactionRanges?.map((e) => ResponseRedactionRange.fromPartial(e)) || [];
783
+ message.timestampMs = object.timestampMs ?? 0;
784
+ message.sessionId = object.sessionId ?? "";
785
+ message.oprfOutputs = object.oprfOutputs?.map((e) => OPRFOutput.fromPartial(e)) || [];
786
+ return message;
787
+ },
769
788
  };
770
789
  function createBaseTOutputPayload() {
771
- return {
772
- consolidatedResponseCiphertext: new Uint8Array(0),
773
- requestProofStreams: [],
774
- timestampMs: 0,
775
- sessionId: "",
776
- oprfOutputs: []
777
- };
778
- }
779
- const TOutputPayload = {
780
- encode(message, writer = new BinaryWriter()) {
781
- if (message.consolidatedResponseCiphertext.length !== 0) {
782
- writer.uint32(10).bytes(message.consolidatedResponseCiphertext);
783
- }
784
- for (const v of message.requestProofStreams) {
785
- writer.uint32(18).bytes(v);
786
- }
787
- if (message.timestampMs !== 0) {
788
- writer.uint32(24).uint64(message.timestampMs);
789
- }
790
- if (message.sessionId !== "") {
791
- writer.uint32(34).string(message.sessionId);
792
- }
793
- for (const v of message.oprfOutputs) {
794
- OPRFOutput.encode(v, writer.uint32(82).fork()).join();
795
- }
796
- return writer;
797
- },
798
- decode(input, length) {
799
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
800
- let end = length === void 0 ? reader.len : reader.pos + length;
801
- const message = createBaseTOutputPayload();
802
- while (reader.pos < end) {
803
- const tag = reader.uint32();
804
- switch (tag >>> 3) {
805
- case 1: {
806
- if (tag !== 10) {
807
- break;
808
- }
809
- message.consolidatedResponseCiphertext = reader.bytes();
810
- continue;
811
- }
812
- case 2: {
813
- if (tag !== 18) {
814
- break;
815
- }
816
- message.requestProofStreams.push(reader.bytes());
817
- continue;
818
- }
819
- case 3: {
820
- if (tag !== 24) {
821
- break;
822
- }
823
- message.timestampMs = longToNumber(reader.uint64());
824
- continue;
825
- }
826
- case 4: {
827
- if (tag !== 34) {
828
- break;
829
- }
830
- message.sessionId = reader.string();
831
- continue;
832
- }
833
- case 10: {
834
- if (tag !== 82) {
835
- break;
836
- }
837
- message.oprfOutputs.push(OPRFOutput.decode(reader, reader.uint32()));
838
- continue;
839
- }
840
- }
841
- if ((tag & 7) === 4 || tag === 0) {
842
- break;
843
- }
844
- reader.skip(tag & 7);
845
- }
846
- return message;
847
- },
848
- fromJSON(object) {
849
790
  return {
850
- consolidatedResponseCiphertext: isSet(object.consolidatedResponseCiphertext) ? bytesFromBase64(object.consolidatedResponseCiphertext) : new Uint8Array(0),
851
- requestProofStreams: globalThis.Array.isArray(object?.requestProofStreams) ? object.requestProofStreams.map((e) => bytesFromBase64(e)) : [],
852
- timestampMs: isSet(object.timestampMs) ? globalThis.Number(object.timestampMs) : 0,
853
- sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : "",
854
- oprfOutputs: globalThis.Array.isArray(object?.oprfOutputs) ? object.oprfOutputs.map((e) => OPRFOutput.fromJSON(e)) : []
791
+ consolidatedResponseCiphertext: new Uint8Array(0),
792
+ requestProofStreams: [],
793
+ timestampMs: 0,
794
+ sessionId: "",
795
+ oprfOutputs: [],
855
796
  };
856
- },
857
- toJSON(message) {
858
- const obj = {};
859
- if (message.consolidatedResponseCiphertext.length !== 0) {
860
- obj.consolidatedResponseCiphertext = base64FromBytes(message.consolidatedResponseCiphertext);
861
- }
862
- if (message.requestProofStreams?.length) {
863
- obj.requestProofStreams = message.requestProofStreams.map((e) => base64FromBytes(e));
864
- }
865
- if (message.timestampMs !== 0) {
866
- obj.timestampMs = Math.round(message.timestampMs);
867
- }
868
- if (message.sessionId !== "") {
869
- obj.sessionId = message.sessionId;
870
- }
871
- if (message.oprfOutputs?.length) {
872
- obj.oprfOutputs = message.oprfOutputs.map((e) => OPRFOutput.toJSON(e));
873
- }
874
- return obj;
875
- },
876
- create(base) {
877
- return TOutputPayload.fromPartial(base ?? {});
878
- },
879
- fromPartial(object) {
880
- const message = createBaseTOutputPayload();
881
- message.consolidatedResponseCiphertext = object.consolidatedResponseCiphertext ?? new Uint8Array(0);
882
- message.requestProofStreams = object.requestProofStreams?.map((e) => e) || [];
883
- message.timestampMs = object.timestampMs ?? 0;
884
- message.sessionId = object.sessionId ?? "";
885
- message.oprfOutputs = object.oprfOutputs?.map((e) => OPRFOutput.fromPartial(e)) || [];
886
- return message;
887
- }
797
+ }
798
+ export const TOutputPayload = {
799
+ encode(message, writer = new BinaryWriter()) {
800
+ if (message.consolidatedResponseCiphertext.length !== 0) {
801
+ writer.uint32(10).bytes(message.consolidatedResponseCiphertext);
802
+ }
803
+ for (const v of message.requestProofStreams) {
804
+ writer.uint32(18).bytes(v);
805
+ }
806
+ if (message.timestampMs !== 0) {
807
+ writer.uint32(24).uint64(message.timestampMs);
808
+ }
809
+ if (message.sessionId !== "") {
810
+ writer.uint32(34).string(message.sessionId);
811
+ }
812
+ for (const v of message.oprfOutputs) {
813
+ OPRFOutput.encode(v, writer.uint32(82).fork()).join();
814
+ }
815
+ return writer;
816
+ },
817
+ decode(input, length) {
818
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
819
+ let end = length === undefined ? reader.len : reader.pos + length;
820
+ const message = createBaseTOutputPayload();
821
+ while (reader.pos < end) {
822
+ const tag = reader.uint32();
823
+ switch (tag >>> 3) {
824
+ case 1: {
825
+ if (tag !== 10) {
826
+ break;
827
+ }
828
+ message.consolidatedResponseCiphertext = reader.bytes();
829
+ continue;
830
+ }
831
+ case 2: {
832
+ if (tag !== 18) {
833
+ break;
834
+ }
835
+ message.requestProofStreams.push(reader.bytes());
836
+ continue;
837
+ }
838
+ case 3: {
839
+ if (tag !== 24) {
840
+ break;
841
+ }
842
+ message.timestampMs = longToNumber(reader.uint64());
843
+ continue;
844
+ }
845
+ case 4: {
846
+ if (tag !== 34) {
847
+ break;
848
+ }
849
+ message.sessionId = reader.string();
850
+ continue;
851
+ }
852
+ case 10: {
853
+ if (tag !== 82) {
854
+ break;
855
+ }
856
+ message.oprfOutputs.push(OPRFOutput.decode(reader, reader.uint32()));
857
+ continue;
858
+ }
859
+ }
860
+ if ((tag & 7) === 4 || tag === 0) {
861
+ break;
862
+ }
863
+ reader.skip(tag & 7);
864
+ }
865
+ return message;
866
+ },
867
+ fromJSON(object) {
868
+ return {
869
+ consolidatedResponseCiphertext: isSet(object.consolidatedResponseCiphertext)
870
+ ? bytesFromBase64(object.consolidatedResponseCiphertext)
871
+ : new Uint8Array(0),
872
+ requestProofStreams: globalThis.Array.isArray(object?.requestProofStreams)
873
+ ? object.requestProofStreams.map((e) => bytesFromBase64(e))
874
+ : [],
875
+ timestampMs: isSet(object.timestampMs) ? globalThis.Number(object.timestampMs) : 0,
876
+ sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : "",
877
+ oprfOutputs: globalThis.Array.isArray(object?.oprfOutputs)
878
+ ? object.oprfOutputs.map((e) => OPRFOutput.fromJSON(e))
879
+ : [],
880
+ };
881
+ },
882
+ toJSON(message) {
883
+ const obj = {};
884
+ if (message.consolidatedResponseCiphertext.length !== 0) {
885
+ obj.consolidatedResponseCiphertext = base64FromBytes(message.consolidatedResponseCiphertext);
886
+ }
887
+ if (message.requestProofStreams?.length) {
888
+ obj.requestProofStreams = message.requestProofStreams.map((e) => base64FromBytes(e));
889
+ }
890
+ if (message.timestampMs !== 0) {
891
+ obj.timestampMs = Math.round(message.timestampMs);
892
+ }
893
+ if (message.sessionId !== "") {
894
+ obj.sessionId = message.sessionId;
895
+ }
896
+ if (message.oprfOutputs?.length) {
897
+ obj.oprfOutputs = message.oprfOutputs.map((e) => OPRFOutput.toJSON(e));
898
+ }
899
+ return obj;
900
+ },
901
+ create(base) {
902
+ return TOutputPayload.fromPartial(base ?? {});
903
+ },
904
+ fromPartial(object) {
905
+ const message = createBaseTOutputPayload();
906
+ message.consolidatedResponseCiphertext = object.consolidatedResponseCiphertext ?? new Uint8Array(0);
907
+ message.requestProofStreams = object.requestProofStreams?.map((e) => e) || [];
908
+ message.timestampMs = object.timestampMs ?? 0;
909
+ message.sessionId = object.sessionId ?? "";
910
+ message.oprfOutputs = object.oprfOutputs?.map((e) => OPRFOutput.fromPartial(e)) || [];
911
+ return message;
912
+ },
888
913
  };
889
914
  function createBaseAttestationReport() {
890
- return { type: "", report: new Uint8Array(0) };
915
+ return { type: "", report: new Uint8Array(0) };
891
916
  }
892
- const AttestationReport = {
893
- encode(message, writer = new BinaryWriter()) {
894
- if (message.type !== "") {
895
- writer.uint32(10).string(message.type);
896
- }
897
- if (message.report.length !== 0) {
898
- writer.uint32(18).bytes(message.report);
899
- }
900
- return writer;
901
- },
902
- decode(input, length) {
903
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
904
- let end = length === void 0 ? reader.len : reader.pos + length;
905
- const message = createBaseAttestationReport();
906
- while (reader.pos < end) {
907
- const tag = reader.uint32();
908
- switch (tag >>> 3) {
909
- case 1: {
910
- if (tag !== 10) {
911
- break;
912
- }
913
- message.type = reader.string();
914
- continue;
915
- }
916
- case 2: {
917
- if (tag !== 18) {
918
- break;
919
- }
920
- message.report = reader.bytes();
921
- continue;
922
- }
923
- }
924
- if ((tag & 7) === 4 || tag === 0) {
925
- break;
926
- }
927
- reader.skip(tag & 7);
928
- }
929
- return message;
930
- },
931
- fromJSON(object) {
932
- return {
933
- type: isSet(object.type) ? globalThis.String(object.type) : "",
934
- report: isSet(object.report) ? bytesFromBase64(object.report) : new Uint8Array(0)
935
- };
936
- },
937
- toJSON(message) {
938
- const obj = {};
939
- if (message.type !== "") {
940
- obj.type = message.type;
941
- }
942
- if (message.report.length !== 0) {
943
- obj.report = base64FromBytes(message.report);
944
- }
945
- return obj;
946
- },
947
- create(base) {
948
- return AttestationReport.fromPartial(base ?? {});
949
- },
950
- fromPartial(object) {
951
- const message = createBaseAttestationReport();
952
- message.type = object.type ?? "";
953
- message.report = object.report ?? new Uint8Array(0);
954
- return message;
955
- }
917
+ export const AttestationReport = {
918
+ encode(message, writer = new BinaryWriter()) {
919
+ if (message.type !== "") {
920
+ writer.uint32(10).string(message.type);
921
+ }
922
+ if (message.report.length !== 0) {
923
+ writer.uint32(18).bytes(message.report);
924
+ }
925
+ return writer;
926
+ },
927
+ decode(input, length) {
928
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
929
+ let end = length === undefined ? reader.len : reader.pos + length;
930
+ const message = createBaseAttestationReport();
931
+ while (reader.pos < end) {
932
+ const tag = reader.uint32();
933
+ switch (tag >>> 3) {
934
+ case 1: {
935
+ if (tag !== 10) {
936
+ break;
937
+ }
938
+ message.type = reader.string();
939
+ continue;
940
+ }
941
+ case 2: {
942
+ if (tag !== 18) {
943
+ break;
944
+ }
945
+ message.report = reader.bytes();
946
+ continue;
947
+ }
948
+ }
949
+ if ((tag & 7) === 4 || tag === 0) {
950
+ break;
951
+ }
952
+ reader.skip(tag & 7);
953
+ }
954
+ return message;
955
+ },
956
+ fromJSON(object) {
957
+ return {
958
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
959
+ report: isSet(object.report) ? bytesFromBase64(object.report) : new Uint8Array(0),
960
+ };
961
+ },
962
+ toJSON(message) {
963
+ const obj = {};
964
+ if (message.type !== "") {
965
+ obj.type = message.type;
966
+ }
967
+ if (message.report.length !== 0) {
968
+ obj.report = base64FromBytes(message.report);
969
+ }
970
+ return obj;
971
+ },
972
+ create(base) {
973
+ return AttestationReport.fromPartial(base ?? {});
974
+ },
975
+ fromPartial(object) {
976
+ const message = createBaseAttestationReport();
977
+ message.type = object.type ?? "";
978
+ message.report = object.report ?? new Uint8Array(0);
979
+ return message;
980
+ },
956
981
  };
957
982
  function createBaseSignedMessage() {
958
- return {
959
- bodyType: 0,
960
- body: new Uint8Array(0),
961
- ethAddress: new Uint8Array(0),
962
- signature: new Uint8Array(0),
963
- attestationReport: void 0
964
- };
965
- }
966
- const SignedMessage = {
967
- encode(message, writer = new BinaryWriter()) {
968
- if (message.bodyType !== 0) {
969
- writer.uint32(8).int32(message.bodyType);
970
- }
971
- if (message.body.length !== 0) {
972
- writer.uint32(18).bytes(message.body);
973
- }
974
- if (message.ethAddress.length !== 0) {
975
- writer.uint32(26).bytes(message.ethAddress);
976
- }
977
- if (message.signature.length !== 0) {
978
- writer.uint32(34).bytes(message.signature);
979
- }
980
- if (message.attestationReport !== void 0) {
981
- AttestationReport.encode(message.attestationReport, writer.uint32(42).fork()).join();
982
- }
983
- return writer;
984
- },
985
- decode(input, length) {
986
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
987
- let end = length === void 0 ? reader.len : reader.pos + length;
988
- const message = createBaseSignedMessage();
989
- while (reader.pos < end) {
990
- const tag = reader.uint32();
991
- switch (tag >>> 3) {
992
- case 1: {
993
- if (tag !== 8) {
994
- break;
995
- }
996
- message.bodyType = reader.int32();
997
- continue;
998
- }
999
- case 2: {
1000
- if (tag !== 18) {
1001
- break;
1002
- }
1003
- message.body = reader.bytes();
1004
- continue;
1005
- }
1006
- case 3: {
1007
- if (tag !== 26) {
1008
- break;
1009
- }
1010
- message.ethAddress = reader.bytes();
1011
- continue;
1012
- }
1013
- case 4: {
1014
- if (tag !== 34) {
1015
- break;
1016
- }
1017
- message.signature = reader.bytes();
1018
- continue;
1019
- }
1020
- case 5: {
1021
- if (tag !== 42) {
1022
- break;
1023
- }
1024
- message.attestationReport = AttestationReport.decode(reader, reader.uint32());
1025
- continue;
1026
- }
1027
- }
1028
- if ((tag & 7) === 4 || tag === 0) {
1029
- break;
1030
- }
1031
- reader.skip(tag & 7);
1032
- }
1033
- return message;
1034
- },
1035
- fromJSON(object) {
1036
983
  return {
1037
- bodyType: isSet(object.bodyType) ? bodyTypeFromJSON(object.bodyType) : 0,
1038
- body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0),
1039
- ethAddress: isSet(object.ethAddress) ? bytesFromBase64(object.ethAddress) : new Uint8Array(0),
1040
- signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0),
1041
- attestationReport: isSet(object.attestationReport) ? AttestationReport.fromJSON(object.attestationReport) : void 0
984
+ bodyType: 0,
985
+ body: new Uint8Array(0),
986
+ ethAddress: new Uint8Array(0),
987
+ signature: new Uint8Array(0),
988
+ attestationReport: undefined,
1042
989
  };
1043
- },
1044
- toJSON(message) {
1045
- const obj = {};
1046
- if (message.bodyType !== 0) {
1047
- obj.bodyType = bodyTypeToJSON(message.bodyType);
1048
- }
1049
- if (message.body.length !== 0) {
1050
- obj.body = base64FromBytes(message.body);
1051
- }
1052
- if (message.ethAddress.length !== 0) {
1053
- obj.ethAddress = base64FromBytes(message.ethAddress);
1054
- }
1055
- if (message.signature.length !== 0) {
1056
- obj.signature = base64FromBytes(message.signature);
1057
- }
1058
- if (message.attestationReport !== void 0) {
1059
- obj.attestationReport = AttestationReport.toJSON(message.attestationReport);
1060
- }
1061
- return obj;
1062
- },
1063
- create(base) {
1064
- return SignedMessage.fromPartial(base ?? {});
1065
- },
1066
- fromPartial(object) {
1067
- const message = createBaseSignedMessage();
1068
- message.bodyType = object.bodyType ?? 0;
1069
- message.body = object.body ?? new Uint8Array(0);
1070
- message.ethAddress = object.ethAddress ?? new Uint8Array(0);
1071
- message.signature = object.signature ?? new Uint8Array(0);
1072
- message.attestationReport = object.attestationReport !== void 0 && object.attestationReport !== null ? AttestationReport.fromPartial(object.attestationReport) : void 0;
1073
- return message;
1074
- }
990
+ }
991
+ export const SignedMessage = {
992
+ encode(message, writer = new BinaryWriter()) {
993
+ if (message.bodyType !== 0) {
994
+ writer.uint32(8).int32(message.bodyType);
995
+ }
996
+ if (message.body.length !== 0) {
997
+ writer.uint32(18).bytes(message.body);
998
+ }
999
+ if (message.ethAddress.length !== 0) {
1000
+ writer.uint32(26).bytes(message.ethAddress);
1001
+ }
1002
+ if (message.signature.length !== 0) {
1003
+ writer.uint32(34).bytes(message.signature);
1004
+ }
1005
+ if (message.attestationReport !== undefined) {
1006
+ AttestationReport.encode(message.attestationReport, writer.uint32(42).fork()).join();
1007
+ }
1008
+ return writer;
1009
+ },
1010
+ decode(input, length) {
1011
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1012
+ let end = length === undefined ? reader.len : reader.pos + length;
1013
+ const message = createBaseSignedMessage();
1014
+ while (reader.pos < end) {
1015
+ const tag = reader.uint32();
1016
+ switch (tag >>> 3) {
1017
+ case 1: {
1018
+ if (tag !== 8) {
1019
+ break;
1020
+ }
1021
+ message.bodyType = reader.int32();
1022
+ continue;
1023
+ }
1024
+ case 2: {
1025
+ if (tag !== 18) {
1026
+ break;
1027
+ }
1028
+ message.body = reader.bytes();
1029
+ continue;
1030
+ }
1031
+ case 3: {
1032
+ if (tag !== 26) {
1033
+ break;
1034
+ }
1035
+ message.ethAddress = reader.bytes();
1036
+ continue;
1037
+ }
1038
+ case 4: {
1039
+ if (tag !== 34) {
1040
+ break;
1041
+ }
1042
+ message.signature = reader.bytes();
1043
+ continue;
1044
+ }
1045
+ case 5: {
1046
+ if (tag !== 42) {
1047
+ break;
1048
+ }
1049
+ message.attestationReport = AttestationReport.decode(reader, reader.uint32());
1050
+ continue;
1051
+ }
1052
+ }
1053
+ if ((tag & 7) === 4 || tag === 0) {
1054
+ break;
1055
+ }
1056
+ reader.skip(tag & 7);
1057
+ }
1058
+ return message;
1059
+ },
1060
+ fromJSON(object) {
1061
+ return {
1062
+ bodyType: isSet(object.bodyType) ? bodyTypeFromJSON(object.bodyType) : 0,
1063
+ body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0),
1064
+ ethAddress: isSet(object.ethAddress) ? bytesFromBase64(object.ethAddress) : new Uint8Array(0),
1065
+ signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0),
1066
+ attestationReport: isSet(object.attestationReport)
1067
+ ? AttestationReport.fromJSON(object.attestationReport)
1068
+ : undefined,
1069
+ };
1070
+ },
1071
+ toJSON(message) {
1072
+ const obj = {};
1073
+ if (message.bodyType !== 0) {
1074
+ obj.bodyType = bodyTypeToJSON(message.bodyType);
1075
+ }
1076
+ if (message.body.length !== 0) {
1077
+ obj.body = base64FromBytes(message.body);
1078
+ }
1079
+ if (message.ethAddress.length !== 0) {
1080
+ obj.ethAddress = base64FromBytes(message.ethAddress);
1081
+ }
1082
+ if (message.signature.length !== 0) {
1083
+ obj.signature = base64FromBytes(message.signature);
1084
+ }
1085
+ if (message.attestationReport !== undefined) {
1086
+ obj.attestationReport = AttestationReport.toJSON(message.attestationReport);
1087
+ }
1088
+ return obj;
1089
+ },
1090
+ create(base) {
1091
+ return SignedMessage.fromPartial(base ?? {});
1092
+ },
1093
+ fromPartial(object) {
1094
+ const message = createBaseSignedMessage();
1095
+ message.bodyType = object.bodyType ?? 0;
1096
+ message.body = object.body ?? new Uint8Array(0);
1097
+ message.ethAddress = object.ethAddress ?? new Uint8Array(0);
1098
+ message.signature = object.signature ?? new Uint8Array(0);
1099
+ message.attestationReport = (object.attestationReport !== undefined && object.attestationReport !== null)
1100
+ ? AttestationReport.fromPartial(object.attestationReport)
1101
+ : undefined;
1102
+ return message;
1103
+ },
1075
1104
  };
1076
1105
  function createBaseOPRFVerificationData() {
1077
- return { streamPos: 0, streamLength: 0, publicSignalsJson: new Uint8Array(0) };
1106
+ return { streamPos: 0, streamLength: 0, publicSignalsJson: new Uint8Array(0) };
1078
1107
  }
1079
- const OPRFVerificationData = {
1080
- encode(message, writer = new BinaryWriter()) {
1081
- if (message.streamPos !== 0) {
1082
- writer.uint32(8).uint32(message.streamPos);
1083
- }
1084
- if (message.streamLength !== 0) {
1085
- writer.uint32(16).uint32(message.streamLength);
1086
- }
1087
- if (message.publicSignalsJson.length !== 0) {
1088
- writer.uint32(26).bytes(message.publicSignalsJson);
1089
- }
1090
- return writer;
1091
- },
1092
- decode(input, length) {
1093
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1094
- let end = length === void 0 ? reader.len : reader.pos + length;
1095
- const message = createBaseOPRFVerificationData();
1096
- while (reader.pos < end) {
1097
- const tag = reader.uint32();
1098
- switch (tag >>> 3) {
1099
- case 1: {
1100
- if (tag !== 8) {
1101
- break;
1102
- }
1103
- message.streamPos = reader.uint32();
1104
- continue;
1105
- }
1106
- case 2: {
1107
- if (tag !== 16) {
1108
- break;
1109
- }
1110
- message.streamLength = reader.uint32();
1111
- continue;
1112
- }
1113
- case 3: {
1114
- if (tag !== 26) {
1115
- break;
1116
- }
1117
- message.publicSignalsJson = reader.bytes();
1118
- continue;
1119
- }
1120
- }
1121
- if ((tag & 7) === 4 || tag === 0) {
1122
- break;
1123
- }
1124
- reader.skip(tag & 7);
1125
- }
1126
- return message;
1127
- },
1128
- fromJSON(object) {
1129
- return {
1130
- streamPos: isSet(object.streamPos) ? globalThis.Number(object.streamPos) : 0,
1131
- streamLength: isSet(object.streamLength) ? globalThis.Number(object.streamLength) : 0,
1132
- publicSignalsJson: isSet(object.publicSignalsJson) ? bytesFromBase64(object.publicSignalsJson) : new Uint8Array(0)
1133
- };
1134
- },
1135
- toJSON(message) {
1136
- const obj = {};
1137
- if (message.streamPos !== 0) {
1138
- obj.streamPos = Math.round(message.streamPos);
1139
- }
1140
- if (message.streamLength !== 0) {
1141
- obj.streamLength = Math.round(message.streamLength);
1142
- }
1143
- if (message.publicSignalsJson.length !== 0) {
1144
- obj.publicSignalsJson = base64FromBytes(message.publicSignalsJson);
1145
- }
1146
- return obj;
1147
- },
1148
- create(base) {
1149
- return OPRFVerificationData.fromPartial(base ?? {});
1150
- },
1151
- fromPartial(object) {
1152
- const message = createBaseOPRFVerificationData();
1153
- message.streamPos = object.streamPos ?? 0;
1154
- message.streamLength = object.streamLength ?? 0;
1155
- message.publicSignalsJson = object.publicSignalsJson ?? new Uint8Array(0);
1156
- return message;
1157
- }
1108
+ export const OPRFVerificationData = {
1109
+ encode(message, writer = new BinaryWriter()) {
1110
+ if (message.streamPos !== 0) {
1111
+ writer.uint32(8).uint32(message.streamPos);
1112
+ }
1113
+ if (message.streamLength !== 0) {
1114
+ writer.uint32(16).uint32(message.streamLength);
1115
+ }
1116
+ if (message.publicSignalsJson.length !== 0) {
1117
+ writer.uint32(26).bytes(message.publicSignalsJson);
1118
+ }
1119
+ return writer;
1120
+ },
1121
+ decode(input, length) {
1122
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1123
+ let end = length === undefined ? reader.len : reader.pos + length;
1124
+ const message = createBaseOPRFVerificationData();
1125
+ while (reader.pos < end) {
1126
+ const tag = reader.uint32();
1127
+ switch (tag >>> 3) {
1128
+ case 1: {
1129
+ if (tag !== 8) {
1130
+ break;
1131
+ }
1132
+ message.streamPos = reader.uint32();
1133
+ continue;
1134
+ }
1135
+ case 2: {
1136
+ if (tag !== 16) {
1137
+ break;
1138
+ }
1139
+ message.streamLength = reader.uint32();
1140
+ continue;
1141
+ }
1142
+ case 3: {
1143
+ if (tag !== 26) {
1144
+ break;
1145
+ }
1146
+ message.publicSignalsJson = reader.bytes();
1147
+ continue;
1148
+ }
1149
+ }
1150
+ if ((tag & 7) === 4 || tag === 0) {
1151
+ break;
1152
+ }
1153
+ reader.skip(tag & 7);
1154
+ }
1155
+ return message;
1156
+ },
1157
+ fromJSON(object) {
1158
+ return {
1159
+ streamPos: isSet(object.streamPos) ? globalThis.Number(object.streamPos) : 0,
1160
+ streamLength: isSet(object.streamLength) ? globalThis.Number(object.streamLength) : 0,
1161
+ publicSignalsJson: isSet(object.publicSignalsJson)
1162
+ ? bytesFromBase64(object.publicSignalsJson)
1163
+ : new Uint8Array(0),
1164
+ };
1165
+ },
1166
+ toJSON(message) {
1167
+ const obj = {};
1168
+ if (message.streamPos !== 0) {
1169
+ obj.streamPos = Math.round(message.streamPos);
1170
+ }
1171
+ if (message.streamLength !== 0) {
1172
+ obj.streamLength = Math.round(message.streamLength);
1173
+ }
1174
+ if (message.publicSignalsJson.length !== 0) {
1175
+ obj.publicSignalsJson = base64FromBytes(message.publicSignalsJson);
1176
+ }
1177
+ return obj;
1178
+ },
1179
+ create(base) {
1180
+ return OPRFVerificationData.fromPartial(base ?? {});
1181
+ },
1182
+ fromPartial(object) {
1183
+ const message = createBaseOPRFVerificationData();
1184
+ message.streamPos = object.streamPos ?? 0;
1185
+ message.streamLength = object.streamLength ?? 0;
1186
+ message.publicSignalsJson = object.publicSignalsJson ?? new Uint8Array(0);
1187
+ return message;
1188
+ },
1158
1189
  };
1159
1190
  function createBaseVerificationBundle() {
1160
- return { teekSigned: void 0, teetSigned: void 0, oprfVerifications: [] };
1191
+ return { teekSigned: undefined, teetSigned: undefined, oprfVerifications: [] };
1161
1192
  }
1162
- const VerificationBundle = {
1163
- encode(message, writer = new BinaryWriter()) {
1164
- if (message.teekSigned !== void 0) {
1165
- SignedMessage.encode(message.teekSigned, writer.uint32(10).fork()).join();
1166
- }
1167
- if (message.teetSigned !== void 0) {
1168
- SignedMessage.encode(message.teetSigned, writer.uint32(18).fork()).join();
1169
- }
1170
- for (const v of message.oprfVerifications) {
1171
- OPRFVerificationData.encode(v, writer.uint32(26).fork()).join();
1172
- }
1173
- return writer;
1174
- },
1175
- decode(input, length) {
1176
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1177
- let end = length === void 0 ? reader.len : reader.pos + length;
1178
- const message = createBaseVerificationBundle();
1179
- while (reader.pos < end) {
1180
- const tag = reader.uint32();
1181
- switch (tag >>> 3) {
1182
- case 1: {
1183
- if (tag !== 10) {
1184
- break;
1185
- }
1186
- message.teekSigned = SignedMessage.decode(reader, reader.uint32());
1187
- continue;
1188
- }
1189
- case 2: {
1190
- if (tag !== 18) {
1191
- break;
1192
- }
1193
- message.teetSigned = SignedMessage.decode(reader, reader.uint32());
1194
- continue;
1195
- }
1196
- case 3: {
1197
- if (tag !== 26) {
1198
- break;
1199
- }
1200
- message.oprfVerifications.push(OPRFVerificationData.decode(reader, reader.uint32()));
1201
- continue;
1202
- }
1203
- }
1204
- if ((tag & 7) === 4 || tag === 0) {
1205
- break;
1206
- }
1207
- reader.skip(tag & 7);
1208
- }
1209
- return message;
1210
- },
1211
- fromJSON(object) {
1212
- return {
1213
- teekSigned: isSet(object.teekSigned) ? SignedMessage.fromJSON(object.teekSigned) : void 0,
1214
- teetSigned: isSet(object.teetSigned) ? SignedMessage.fromJSON(object.teetSigned) : void 0,
1215
- oprfVerifications: globalThis.Array.isArray(object?.oprfVerifications) ? object.oprfVerifications.map((e) => OPRFVerificationData.fromJSON(e)) : []
1216
- };
1217
- },
1218
- toJSON(message) {
1219
- const obj = {};
1220
- if (message.teekSigned !== void 0) {
1221
- obj.teekSigned = SignedMessage.toJSON(message.teekSigned);
1222
- }
1223
- if (message.teetSigned !== void 0) {
1224
- obj.teetSigned = SignedMessage.toJSON(message.teetSigned);
1225
- }
1226
- if (message.oprfVerifications?.length) {
1227
- obj.oprfVerifications = message.oprfVerifications.map((e) => OPRFVerificationData.toJSON(e));
1228
- }
1229
- return obj;
1230
- },
1231
- create(base) {
1232
- return VerificationBundle.fromPartial(base ?? {});
1233
- },
1234
- fromPartial(object) {
1235
- const message = createBaseVerificationBundle();
1236
- message.teekSigned = object.teekSigned !== void 0 && object.teekSigned !== null ? SignedMessage.fromPartial(object.teekSigned) : void 0;
1237
- message.teetSigned = object.teetSigned !== void 0 && object.teetSigned !== null ? SignedMessage.fromPartial(object.teetSigned) : void 0;
1238
- message.oprfVerifications = object.oprfVerifications?.map((e) => OPRFVerificationData.fromPartial(e)) || [];
1239
- return message;
1240
- }
1193
+ export const VerificationBundle = {
1194
+ encode(message, writer = new BinaryWriter()) {
1195
+ if (message.teekSigned !== undefined) {
1196
+ SignedMessage.encode(message.teekSigned, writer.uint32(10).fork()).join();
1197
+ }
1198
+ if (message.teetSigned !== undefined) {
1199
+ SignedMessage.encode(message.teetSigned, writer.uint32(18).fork()).join();
1200
+ }
1201
+ for (const v of message.oprfVerifications) {
1202
+ OPRFVerificationData.encode(v, writer.uint32(26).fork()).join();
1203
+ }
1204
+ return writer;
1205
+ },
1206
+ decode(input, length) {
1207
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1208
+ let end = length === undefined ? reader.len : reader.pos + length;
1209
+ const message = createBaseVerificationBundle();
1210
+ while (reader.pos < end) {
1211
+ const tag = reader.uint32();
1212
+ switch (tag >>> 3) {
1213
+ case 1: {
1214
+ if (tag !== 10) {
1215
+ break;
1216
+ }
1217
+ message.teekSigned = SignedMessage.decode(reader, reader.uint32());
1218
+ continue;
1219
+ }
1220
+ case 2: {
1221
+ if (tag !== 18) {
1222
+ break;
1223
+ }
1224
+ message.teetSigned = SignedMessage.decode(reader, reader.uint32());
1225
+ continue;
1226
+ }
1227
+ case 3: {
1228
+ if (tag !== 26) {
1229
+ break;
1230
+ }
1231
+ message.oprfVerifications.push(OPRFVerificationData.decode(reader, reader.uint32()));
1232
+ continue;
1233
+ }
1234
+ }
1235
+ if ((tag & 7) === 4 || tag === 0) {
1236
+ break;
1237
+ }
1238
+ reader.skip(tag & 7);
1239
+ }
1240
+ return message;
1241
+ },
1242
+ fromJSON(object) {
1243
+ return {
1244
+ teekSigned: isSet(object.teekSigned) ? SignedMessage.fromJSON(object.teekSigned) : undefined,
1245
+ teetSigned: isSet(object.teetSigned) ? SignedMessage.fromJSON(object.teetSigned) : undefined,
1246
+ oprfVerifications: globalThis.Array.isArray(object?.oprfVerifications)
1247
+ ? object.oprfVerifications.map((e) => OPRFVerificationData.fromJSON(e))
1248
+ : [],
1249
+ };
1250
+ },
1251
+ toJSON(message) {
1252
+ const obj = {};
1253
+ if (message.teekSigned !== undefined) {
1254
+ obj.teekSigned = SignedMessage.toJSON(message.teekSigned);
1255
+ }
1256
+ if (message.teetSigned !== undefined) {
1257
+ obj.teetSigned = SignedMessage.toJSON(message.teetSigned);
1258
+ }
1259
+ if (message.oprfVerifications?.length) {
1260
+ obj.oprfVerifications = message.oprfVerifications.map((e) => OPRFVerificationData.toJSON(e));
1261
+ }
1262
+ return obj;
1263
+ },
1264
+ create(base) {
1265
+ return VerificationBundle.fromPartial(base ?? {});
1266
+ },
1267
+ fromPartial(object) {
1268
+ const message = createBaseVerificationBundle();
1269
+ message.teekSigned = (object.teekSigned !== undefined && object.teekSigned !== null)
1270
+ ? SignedMessage.fromPartial(object.teekSigned)
1271
+ : undefined;
1272
+ message.teetSigned = (object.teetSigned !== undefined && object.teetSigned !== null)
1273
+ ? SignedMessage.fromPartial(object.teetSigned)
1274
+ : undefined;
1275
+ message.oprfVerifications = object.oprfVerifications?.map((e) => OPRFVerificationData.fromPartial(e)) || [];
1276
+ return message;
1277
+ },
1241
1278
  };
1242
1279
  function bytesFromBase64(b64) {
1243
- if (globalThis.Buffer) {
1244
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1245
- } else {
1246
- const bin = globalThis.atob(b64);
1247
- const arr = new Uint8Array(bin.length);
1248
- for (let i = 0; i < bin.length; ++i) {
1249
- arr[i] = bin.charCodeAt(i);
1280
+ if (globalThis.Buffer) {
1281
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1282
+ }
1283
+ else {
1284
+ const bin = globalThis.atob(b64);
1285
+ const arr = new Uint8Array(bin.length);
1286
+ for (let i = 0; i < bin.length; ++i) {
1287
+ arr[i] = bin.charCodeAt(i);
1288
+ }
1289
+ return arr;
1250
1290
  }
1251
- return arr;
1252
- }
1253
1291
  }
1254
1292
  function base64FromBytes(arr) {
1255
- if (globalThis.Buffer) {
1256
- return globalThis.Buffer.from(arr).toString("base64");
1257
- } else {
1258
- const bin = [];
1259
- arr.forEach((byte) => {
1260
- bin.push(globalThis.String.fromCharCode(byte));
1261
- });
1262
- return globalThis.btoa(bin.join(""));
1263
- }
1293
+ if (globalThis.Buffer) {
1294
+ return globalThis.Buffer.from(arr).toString("base64");
1295
+ }
1296
+ else {
1297
+ const bin = [];
1298
+ arr.forEach((byte) => {
1299
+ bin.push(globalThis.String.fromCharCode(byte));
1300
+ });
1301
+ return globalThis.btoa(bin.join(""));
1302
+ }
1264
1303
  }
1265
1304
  function longToNumber(int64) {
1266
- const num = globalThis.Number(int64.toString());
1267
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1268
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1269
- }
1270
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1271
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1272
- }
1273
- return num;
1305
+ const num = globalThis.Number(int64.toString());
1306
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1307
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1308
+ }
1309
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1310
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1311
+ }
1312
+ return num;
1274
1313
  }
1275
1314
  function isSet(value) {
1276
- return value !== null && value !== void 0;
1315
+ return value !== null && value !== undefined;
1277
1316
  }
1278
- export {
1279
- AttestationReport,
1280
- BodyType,
1281
- CertificateInfo,
1282
- HandshakeSecrets,
1283
- KOutputPayload,
1284
- OPRFOutput,
1285
- OPRFVerificationData,
1286
- Opening,
1287
- RequestRedactionRange,
1288
- ResponseRedactionRange,
1289
- SignedMessage,
1290
- SignedRedactedDecryptionStream,
1291
- TOutputPayload,
1292
- VerificationBundle,
1293
- bodyTypeFromJSON,
1294
- bodyTypeToJSON,
1295
- protobufPackage
1296
- };