tkms 0.11.0-rc7 → 0.11.0-rc9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/kms_lib.d.ts CHANGED
@@ -16,8 +16,8 @@ export function u8vec_to_private_sig_key(v: Uint8Array): PrivateSigKey;
16
16
  * * `fhe_parameter` - the parameter choice, which can be either `"test"` or `"default"`.
17
17
  * The "default" parameter choice is selected if no matching string is found.
18
18
  */
19
- export function new_client(server_addrs: (string)[], client_address_hex: string, fhe_parameter: string): Client;
20
- export function get_server_addrs(client: Client): (string)[];
19
+ export function new_client(server_addrs: string[], client_address_hex: string, fhe_parameter: string): Client;
20
+ export function get_server_addrs(client: Client): string[];
21
21
  export function get_client_secret_key(client: Client): PrivateSigKey | undefined;
22
22
  export function get_client_address(client: Client): string;
23
23
  export function cryptobox_keygen(): PrivateEncKey;
@@ -88,7 +88,7 @@ export function cryptobox_decrypt(ct: CryptoBoxCt, my_sk: PrivateEncKey, their_p
88
88
  * * `verify` - Whether to perform signature verification for the response.
89
89
  * It is insecure if `verify = false`!
90
90
  */
91
- export function process_reencryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): (TypedPlaintext)[];
91
+ export function process_reencryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): TypedPlaintext[];
92
92
  /**
93
93
  * Process the reencryption response from Rust objects.
94
94
  * Consider using [process_reencryption_resp_from_js]
@@ -112,24 +112,7 @@ export function process_reencryption_resp_from_js(client: Client, request: any,
112
112
  * * `verify` - Whether to perform signature verification for the response.
113
113
  * It is insecure if `verify = false`!
114
114
  */
115
- export function process_reencryption_resp(client: Client, request: ParsedReencryptionRequest | undefined, eip712_domain: Eip712DomainMsg | undefined, agg_resp: (ReencryptionResponse)[], enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): (TypedPlaintext)[];
116
- /**
117
- * The plaintext types that can be encrypted in a HTTPZ ciphertext.
118
- */
119
- export enum FheType {
120
- Ebool = 0,
121
- Euint4 = 1,
122
- Euint8 = 2,
123
- Euint16 = 3,
124
- Euint32 = 4,
125
- Euint64 = 5,
126
- Euint128 = 6,
127
- Euint160 = 7,
128
- Euint256 = 8,
129
- Euint512 = 9,
130
- Euint1024 = 10,
131
- Euint2048 = 11,
132
- }
115
+ export function process_reencryption_resp(client: Client, request: ParsedReencryptionRequest | null | undefined, eip712_domain: Eip712DomainMsg | null | undefined, agg_resp: ReencryptionResponse[], enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): TypedPlaintext[];
133
116
  export class CiphertextHandle {
134
117
  private constructor();
135
118
  free(): void;
@@ -161,7 +144,8 @@ export class Eip712DomainMsg {
161
144
  version: string;
162
145
  chain_id: Uint8Array;
163
146
  verifying_contract: string;
164
- salt?: Uint8Array;
147
+ get salt(): Uint8Array | undefined;
148
+ set salt(value: Uint8Array | null | undefined);
165
149
  }
166
150
  /**
167
151
  * Validity of this struct is not checked.
@@ -193,16 +177,26 @@ export class ReencryptionRequest {
193
177
  * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
194
178
  * prefix. Future queries for the result must use this request ID.
195
179
  */
196
- request_id?: RequestId;
180
+ get request_id(): RequestId | undefined;
181
+ /**
182
+ * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
183
+ * prefix. Future queries for the result must use this request ID.
184
+ */
185
+ set request_id(value: RequestId | null | undefined);
197
186
  /**
198
187
  * The list of ciphertexts to reencrypt.
199
188
  */
200
- typed_ciphertexts: (TypedCiphertext)[];
189
+ typed_ciphertexts: TypedCiphertext[];
190
+ /**
191
+ * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
192
+ * used for key generation
193
+ */
194
+ get key_id(): RequestId | undefined;
201
195
  /**
202
196
  * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
203
197
  * used for key generation
204
198
  */
205
- key_id?: RequestId;
199
+ set key_id(value: RequestId | null | undefined);
206
200
  /**
207
201
  * The client's (blockchain wallet) address,
208
202
  * encoded using EIP-55.
@@ -214,7 +208,8 @@ export class ReencryptionRequest {
214
208
  * Montgomery point.
215
209
  */
216
210
  enc_key: Uint8Array;
217
- domain?: Eip712DomainMsg;
211
+ get domain(): Eip712DomainMsg | undefined;
212
+ set domain(value: Eip712DomainMsg | null | undefined);
218
213
  }
219
214
  export class ReencryptionResponse {
220
215
  private constructor();
@@ -233,7 +228,11 @@ export class ReencryptionResponse {
233
228
  /**
234
229
  * The actual \[ReencryptionResponsePayload\].
235
230
  */
236
- payload?: ReencryptionResponsePayload;
231
+ get payload(): ReencryptionResponsePayload | undefined;
232
+ /**
233
+ * The actual \[ReencryptionResponsePayload\].
234
+ */
235
+ set payload(value: ReencryptionResponsePayload | null | undefined);
237
236
  }
238
237
  export class ReencryptionResponsePayload {
239
238
  private constructor();
@@ -255,7 +254,7 @@ export class ReencryptionResponsePayload {
255
254
  * must be decrypted and then reconstructed with the other shares
256
255
  * to produce the final plaintext.
257
256
  */
258
- signcrypted_ciphertexts: (TypedSigncryptedCiphertext)[];
257
+ signcrypted_ciphertexts: TypedSigncryptedCiphertext[];
259
258
  /**
260
259
  * The ID of the MPC party doing the reencryption. Used for polynomial
261
260
  * reconstruction.
@@ -279,11 +278,12 @@ export class TypedCiphertext {
279
278
  private constructor();
280
279
  free(): void;
281
280
  /**
282
- * The actual ciphertext to decrypt, taken directly from HTTPZ.
281
+ * The actual ciphertext to decrypt, taken directly from fhevm.
283
282
  */
284
283
  ciphertext: Uint8Array;
285
284
  /**
286
- * The type of plaintext encrypted.
285
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
286
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
287
287
  */
288
288
  fhe_type: number;
289
289
  /**
@@ -307,7 +307,8 @@ export class TypedPlaintext {
307
307
  */
308
308
  bytes: Uint8Array;
309
309
  /**
310
- * The type of plaintext encrypted.
310
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
311
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
311
312
  */
312
313
  fhe_type: number;
313
314
  }
@@ -315,7 +316,8 @@ export class TypedSigncryptedCiphertext {
315
316
  private constructor();
316
317
  free(): void;
317
318
  /**
318
- * The type of plaintext encrypted.
319
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
320
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
319
321
  */
320
322
  fhe_type: number;
321
323
  /**
@@ -327,6 +329,11 @@ export class TypedSigncryptedCiphertext {
327
329
  * The external handles that were originally in the request.
328
330
  */
329
331
  external_handle: Uint8Array;
332
+ /**
333
+ * The packing factor determines whether the decrypted plaintext
334
+ * has a different way of packing compared to what is specified in the plaintext modulus.
335
+ */
336
+ packing_factor: number;
330
337
  }
331
338
 
332
339
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -336,6 +343,10 @@ export interface InitOutput {
336
343
  readonly __wbg_client_free: (a: number, b: number) => void;
337
344
  readonly __wbg_ciphertexthandle_free: (a: number, b: number) => void;
338
345
  readonly __wbg_parsedreencryptionrequest_free: (a: number, b: number) => void;
346
+ readonly __wbg_publicenckey_free: (a: number, b: number) => void;
347
+ readonly __wbg_privateenckey_free: (a: number, b: number) => void;
348
+ readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
349
+ readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
339
350
  readonly public_sig_key_to_u8vec: (a: number) => [number, number];
340
351
  readonly u8vec_to_public_sig_key: (a: number, b: number) => [number, number, number];
341
352
  readonly private_sig_key_to_u8vec: (a: number) => [number, number, number, number];
@@ -355,10 +366,6 @@ export interface InitOutput {
355
366
  readonly cryptobox_decrypt: (a: number, b: number, c: number) => [number, number];
356
367
  readonly process_reencryption_resp_from_js: (a: number, b: any, c: any, d: any, e: number, f: number, g: number) => [number, number, number, number];
357
368
  readonly process_reencryption_resp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
358
- readonly __wbg_publicenckey_free: (a: number, b: number) => void;
359
- readonly __wbg_privateenckey_free: (a: number, b: number) => void;
360
- readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
361
- readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
362
369
  readonly __wbg_requestid_free: (a: number, b: number) => void;
363
370
  readonly __wbg_typedciphertext_free: (a: number, b: number) => void;
364
371
  readonly __wbg_get_typedciphertext_fhe_type: (a: number) => number;
@@ -404,6 +411,7 @@ export interface InitOutput {
404
411
  readonly __wbg_get_requestid_request_id: (a: number) => [number, number];
405
412
  readonly __wbg_get_reencryptionrequest_client_address: (a: number) => [number, number];
406
413
  readonly __wbg_get_typedsigncryptedciphertext_fhe_type: (a: number) => number;
414
+ readonly __wbg_get_typedsigncryptedciphertext_packing_factor: (a: number) => number;
407
415
  readonly __wbg_set_typedciphertext_ciphertext: (a: number, b: number, c: number) => void;
408
416
  readonly __wbg_set_typedplaintext_bytes: (a: number, b: number, c: number) => void;
409
417
  readonly __wbg_set_requestid_request_id: (a: number, b: number, c: number) => void;
@@ -425,6 +433,7 @@ export interface InitOutput {
425
433
  readonly __wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext: (a: number) => [number, number];
426
434
  readonly __wbg_get_typedsigncryptedciphertext_external_handle: (a: number) => [number, number];
427
435
  readonly __wbg_set_typedsigncryptedciphertext_fhe_type: (a: number, b: number) => void;
436
+ readonly __wbg_set_typedsigncryptedciphertext_packing_factor: (a: number, b: number) => void;
428
437
  readonly __wbindgen_malloc: (a: number, b: number) => number;
429
438
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
430
439
  readonly __wbindgen_exn_store: (a: number) => void;
package/kms_lib.js CHANGED
@@ -246,9 +246,9 @@ export function u8vec_to_private_sig_key(v) {
246
246
 
247
247
  function passArrayJsValueToWasm0(array, malloc) {
248
248
  const ptr = malloc(array.length * 4, 4) >>> 0;
249
- const mem = getDataViewMemory0();
250
249
  for (let i = 0; i < array.length; i++) {
251
- mem.setUint32(ptr + 4 * i, addToExternrefTable0(array[i]), true);
250
+ const add = addToExternrefTable0(array[i]);
251
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
252
252
  }
253
253
  WASM_VECTOR_LEN = array.length;
254
254
  return ptr;
@@ -264,7 +264,7 @@ function passArrayJsValueToWasm0(array, malloc) {
264
264
  *
265
265
  * * `fhe_parameter` - the parameter choice, which can be either `"test"` or `"default"`.
266
266
  * The "default" parameter choice is selected if no matching string is found.
267
- * @param {(string)[]} server_addrs
267
+ * @param {string[]} server_addrs
268
268
  * @param {string} client_address_hex
269
269
  * @param {string} fhe_parameter
270
270
  * @returns {Client}
@@ -295,7 +295,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
295
295
  }
296
296
  /**
297
297
  * @param {Client} client
298
- * @returns {(string)[]}
298
+ * @returns {string[]}
299
299
  */
300
300
  export function get_server_addrs(client) {
301
301
  _assertClass(client, Client);
@@ -506,7 +506,7 @@ export function cryptobox_decrypt(ct, my_sk, their_pk) {
506
506
  * @param {PublicEncKey} enc_pk
507
507
  * @param {PrivateEncKey} enc_sk
508
508
  * @param {boolean} verify
509
- * @returns {(TypedPlaintext)[]}
509
+ * @returns {TypedPlaintext[]}
510
510
  */
511
511
  export function process_reencryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
512
512
  _assertClass(client, Client);
@@ -544,13 +544,13 @@ export function process_reencryption_resp_from_js(client, request, eip712_domain
544
544
  * * `verify` - Whether to perform signature verification for the response.
545
545
  * It is insecure if `verify = false`!
546
546
  * @param {Client} client
547
- * @param {ParsedReencryptionRequest | undefined} request
548
- * @param {Eip712DomainMsg | undefined} eip712_domain
549
- * @param {(ReencryptionResponse)[]} agg_resp
547
+ * @param {ParsedReencryptionRequest | null | undefined} request
548
+ * @param {Eip712DomainMsg | null | undefined} eip712_domain
549
+ * @param {ReencryptionResponse[]} agg_resp
550
550
  * @param {PublicEncKey} enc_pk
551
551
  * @param {PrivateEncKey} enc_sk
552
552
  * @param {boolean} verify
553
- * @returns {(TypedPlaintext)[]}
553
+ * @returns {TypedPlaintext[]}
554
554
  */
555
555
  export function process_reencryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
556
556
  _assertClass(client, Client);
@@ -577,25 +577,6 @@ export function process_reencryption_resp(client, request, eip712_domain, agg_re
577
577
  return v4;
578
578
  }
579
579
 
580
- /**
581
- * The plaintext types that can be encrypted in a HTTPZ ciphertext.
582
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11}
583
- */
584
- export const FheType = Object.freeze({
585
- Ebool: 0, "0": "Ebool",
586
- Euint4: 1, "1": "Euint4",
587
- Euint8: 2, "2": "Euint8",
588
- Euint16: 3, "3": "Euint16",
589
- Euint32: 4, "4": "Euint32",
590
- Euint64: 5, "5": "Euint64",
591
- Euint128: 6, "6": "Euint128",
592
- Euint160: 7, "7": "Euint160",
593
- Euint256: 8, "8": "Euint256",
594
- Euint512: 9, "9": "Euint512",
595
- Euint1024: 10, "10": "Euint1024",
596
- Euint2048: 11, "11": "Euint2048",
597
- });
598
-
599
580
  const CiphertextHandleFinalization = (typeof FinalizationRegistry === 'undefined')
600
581
  ? { register: () => {}, unregister: () => {} }
601
582
  : new FinalizationRegistry(ptr => wasm.__wbg_ciphertexthandle_free(ptr >>> 0, 1));
@@ -803,7 +784,7 @@ export class Eip712DomainMsg {
803
784
  return v1;
804
785
  }
805
786
  /**
806
- * @param {Uint8Array | undefined} [arg0]
787
+ * @param {Uint8Array | null} [arg0]
807
788
  */
808
789
  set salt(arg0) {
809
790
  var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
@@ -970,7 +951,7 @@ export class ReencryptionRequest {
970
951
  /**
971
952
  * The 32 Byte / 256 Bit ID of the user decryption request, without `0x`
972
953
  * prefix. Future queries for the result must use this request ID.
973
- * @param {RequestId | undefined} [arg0]
954
+ * @param {RequestId | null} [arg0]
974
955
  */
975
956
  set request_id(arg0) {
976
957
  let ptr0 = 0;
@@ -982,7 +963,7 @@ export class ReencryptionRequest {
982
963
  }
983
964
  /**
984
965
  * The list of ciphertexts to reencrypt.
985
- * @returns {(TypedCiphertext)[]}
966
+ * @returns {TypedCiphertext[]}
986
967
  */
987
968
  get typed_ciphertexts() {
988
969
  const ret = wasm.__wbg_get_reencryptionrequest_typed_ciphertexts(this.__wbg_ptr);
@@ -992,7 +973,7 @@ export class ReencryptionRequest {
992
973
  }
993
974
  /**
994
975
  * The list of ciphertexts to reencrypt.
995
- * @param {(TypedCiphertext)[]} arg0
976
+ * @param {TypedCiphertext[]} arg0
996
977
  */
997
978
  set typed_ciphertexts(arg0) {
998
979
  const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
@@ -1011,7 +992,7 @@ export class ReencryptionRequest {
1011
992
  /**
1012
993
  * The 32 Byte / 256 Bit key id to use for decryption. This is the request_id
1013
994
  * used for key generation
1014
- * @param {RequestId | undefined} [arg0]
995
+ * @param {RequestId | null} [arg0]
1015
996
  */
1016
997
  set key_id(arg0) {
1017
998
  let ptr0 = 0;
@@ -1079,7 +1060,7 @@ export class ReencryptionRequest {
1079
1060
  return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
1080
1061
  }
1081
1062
  /**
1082
- * @param {Eip712DomainMsg | undefined} [arg0]
1063
+ * @param {Eip712DomainMsg | null} [arg0]
1083
1064
  */
1084
1065
  set domain(arg0) {
1085
1066
  let ptr0 = 0;
@@ -1173,7 +1154,7 @@ export class ReencryptionResponse {
1173
1154
  }
1174
1155
  /**
1175
1156
  * The actual \[ReencryptionResponsePayload\].
1176
- * @param {ReencryptionResponsePayload | undefined} [arg0]
1157
+ * @param {ReencryptionResponsePayload | null} [arg0]
1177
1158
  */
1178
1159
  set payload(arg0) {
1179
1160
  let ptr0 = 0;
@@ -1260,7 +1241,7 @@ export class ReencryptionResponsePayload {
1260
1241
  * The resulting signcrypted ciphertexts, each ciphertext
1261
1242
  * must be decrypted and then reconstructed with the other shares
1262
1243
  * to produce the final plaintext.
1263
- * @returns {(TypedSigncryptedCiphertext)[]}
1244
+ * @returns {TypedSigncryptedCiphertext[]}
1264
1245
  */
1265
1246
  get signcrypted_ciphertexts() {
1266
1247
  const ret = wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);
@@ -1272,7 +1253,7 @@ export class ReencryptionResponsePayload {
1272
1253
  * The resulting signcrypted ciphertexts, each ciphertext
1273
1254
  * must be decrypted and then reconstructed with the other shares
1274
1255
  * to produce the final plaintext.
1275
- * @param {(TypedSigncryptedCiphertext)[]} arg0
1256
+ * @param {TypedSigncryptedCiphertext[]} arg0
1276
1257
  */
1277
1258
  set signcrypted_ciphertexts(arg0) {
1278
1259
  const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
@@ -1399,7 +1380,7 @@ export class TypedCiphertext {
1399
1380
  wasm.__wbg_typedciphertext_free(ptr, 0);
1400
1381
  }
1401
1382
  /**
1402
- * The actual ciphertext to decrypt, taken directly from HTTPZ.
1383
+ * The actual ciphertext to decrypt, taken directly from fhevm.
1403
1384
  * @returns {Uint8Array}
1404
1385
  */
1405
1386
  get ciphertext() {
@@ -1409,7 +1390,7 @@ export class TypedCiphertext {
1409
1390
  return v1;
1410
1391
  }
1411
1392
  /**
1412
- * The actual ciphertext to decrypt, taken directly from HTTPZ.
1393
+ * The actual ciphertext to decrypt, taken directly from fhevm.
1413
1394
  * @param {Uint8Array} arg0
1414
1395
  */
1415
1396
  set ciphertext(arg0) {
@@ -1418,7 +1399,8 @@ export class TypedCiphertext {
1418
1399
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1419
1400
  }
1420
1401
  /**
1421
- * The type of plaintext encrypted.
1402
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1403
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1422
1404
  * @returns {number}
1423
1405
  */
1424
1406
  get fhe_type() {
@@ -1426,7 +1408,8 @@ export class TypedCiphertext {
1426
1408
  return ret;
1427
1409
  }
1428
1410
  /**
1429
- * The type of plaintext encrypted.
1411
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1412
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1430
1413
  * @param {number} arg0
1431
1414
  */
1432
1415
  set fhe_type(arg0) {
@@ -1517,7 +1500,8 @@ export class TypedPlaintext {
1517
1500
  wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
1518
1501
  }
1519
1502
  /**
1520
- * The type of plaintext encrypted.
1503
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1504
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1521
1505
  * @returns {number}
1522
1506
  */
1523
1507
  get fhe_type() {
@@ -1525,7 +1509,8 @@ export class TypedPlaintext {
1525
1509
  return ret;
1526
1510
  }
1527
1511
  /**
1528
- * The type of plaintext encrypted.
1512
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1513
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1529
1514
  * @param {number} arg0
1530
1515
  */
1531
1516
  set fhe_type(arg0) {
@@ -1566,7 +1551,8 @@ export class TypedSigncryptedCiphertext {
1566
1551
  wasm.__wbg_typedsigncryptedciphertext_free(ptr, 0);
1567
1552
  }
1568
1553
  /**
1569
- * The type of plaintext encrypted.
1554
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1555
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1570
1556
  * @returns {number}
1571
1557
  */
1572
1558
  get fhe_type() {
@@ -1574,7 +1560,8 @@ export class TypedSigncryptedCiphertext {
1574
1560
  return ret;
1575
1561
  }
1576
1562
  /**
1577
- * The type of plaintext encrypted.
1563
+ * The type of plaintext encrypted. The type should match FheType from tfhe-rs:
1564
+ * <https://github.com/zama-ai/tfhe-rs/blob/main/tfhe/src/high_level_api/mod.rs>
1578
1565
  * @param {number} arg0
1579
1566
  */
1580
1567
  set fhe_type(arg0) {
@@ -1620,6 +1607,23 @@ export class TypedSigncryptedCiphertext {
1620
1607
  const len0 = WASM_VECTOR_LEN;
1621
1608
  wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
1622
1609
  }
1610
+ /**
1611
+ * The packing factor determines whether the decrypted plaintext
1612
+ * has a different way of packing compared to what is specified in the plaintext modulus.
1613
+ * @returns {number}
1614
+ */
1615
+ get packing_factor() {
1616
+ const ret = wasm.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr);
1617
+ return ret >>> 0;
1618
+ }
1619
+ /**
1620
+ * The packing factor determines whether the decrypted plaintext
1621
+ * has a different way of packing compared to what is specified in the plaintext modulus.
1622
+ * @param {number} arg0
1623
+ */
1624
+ set packing_factor(arg0) {
1625
+ wasm.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr, arg0);
1626
+ }
1623
1627
  }
1624
1628
 
1625
1629
  async function __wbg_load(module, imports) {
@@ -1663,23 +1667,23 @@ function __wbg_get_imports() {
1663
1667
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1664
1668
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1665
1669
  };
1666
- imports.wbg.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
1670
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1667
1671
  const ret = arg0.buffer;
1668
1672
  return ret;
1669
1673
  };
1670
- imports.wbg.__wbg_call_500db948e69c7330 = function() { return handleError(function (arg0, arg1, arg2) {
1671
- const ret = arg0.call(arg1, arg2);
1674
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1675
+ const ret = arg0.call(arg1);
1672
1676
  return ret;
1673
1677
  }, arguments) };
1674
- imports.wbg.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
1675
- const ret = arg0.call(arg1);
1678
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1679
+ const ret = arg0.call(arg1, arg2);
1676
1680
  return ret;
1677
1681
  }, arguments) };
1678
1682
  imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1679
1683
  const ret = arg0.crypto;
1680
1684
  return ret;
1681
1685
  };
1682
- imports.wbg.__wbg_done_f22c1561fa919baa = function(arg0) {
1686
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
1683
1687
  const ret = arg0.done;
1684
1688
  return ret;
1685
1689
  };
@@ -1697,19 +1701,19 @@ function __wbg_get_imports() {
1697
1701
  imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1698
1702
  arg0.getRandomValues(arg1);
1699
1703
  }, arguments) };
1700
- imports.wbg.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) {
1701
- const ret = arg0[arg1 >>> 0];
1702
- return ret;
1703
- };
1704
- imports.wbg.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) {
1704
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1705
1705
  const ret = Reflect.get(arg0, arg1);
1706
1706
  return ret;
1707
1707
  }, arguments) };
1708
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1709
+ const ret = arg0[arg1 >>> 0];
1710
+ return ret;
1711
+ };
1708
1712
  imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1709
1713
  const ret = arg0[arg1];
1710
1714
  return ret;
1711
1715
  };
1712
- imports.wbg.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
1716
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1713
1717
  let result;
1714
1718
  try {
1715
1719
  result = arg0 instanceof ArrayBuffer;
@@ -1719,7 +1723,7 @@ function __wbg_get_imports() {
1719
1723
  const ret = result;
1720
1724
  return ret;
1721
1725
  };
1722
- imports.wbg.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
1726
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1723
1727
  let result;
1724
1728
  try {
1725
1729
  result = arg0 instanceof Uint8Array;
@@ -1729,23 +1733,23 @@ function __wbg_get_imports() {
1729
1733
  const ret = result;
1730
1734
  return ret;
1731
1735
  };
1732
- imports.wbg.__wbg_isArray_1ba11a930108ec51 = function(arg0) {
1736
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1733
1737
  const ret = Array.isArray(arg0);
1734
1738
  return ret;
1735
1739
  };
1736
- imports.wbg.__wbg_isSafeInteger_12f5549b2fca23f4 = function(arg0) {
1740
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1737
1741
  const ret = Number.isSafeInteger(arg0);
1738
1742
  return ret;
1739
1743
  };
1740
- imports.wbg.__wbg_iterator_23604bb983791576 = function() {
1744
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1741
1745
  const ret = Symbol.iterator;
1742
1746
  return ret;
1743
1747
  };
1744
- imports.wbg.__wbg_length_65d1cd11729ced11 = function(arg0) {
1748
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1745
1749
  const ret = arg0.length;
1746
1750
  return ret;
1747
1751
  };
1748
- imports.wbg.__wbg_length_d65cf0786bfc5739 = function(arg0) {
1752
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1749
1753
  const ret = arg0.length;
1750
1754
  return ret;
1751
1755
  };
@@ -1753,34 +1757,34 @@ function __wbg_get_imports() {
1753
1757
  const ret = arg0.msCrypto;
1754
1758
  return ret;
1755
1759
  };
1756
- imports.wbg.__wbg_new_3ff5b33b1ce712df = function(arg0) {
1757
- const ret = new Uint8Array(arg0);
1758
- return ret;
1759
- };
1760
1760
  imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1761
1761
  const ret = new Error();
1762
1762
  return ret;
1763
1763
  };
1764
- imports.wbg.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) {
1764
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1765
+ const ret = new Uint8Array(arg0);
1766
+ return ret;
1767
+ };
1768
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1765
1769
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1766
1770
  return ret;
1767
1771
  };
1768
- imports.wbg.__wbg_newwithbyteoffsetandlength_ba35896968751d91 = function(arg0, arg1, arg2) {
1772
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1769
1773
  const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1770
1774
  return ret;
1771
1775
  };
1772
- imports.wbg.__wbg_newwithlength_34ce8f1051e74449 = function(arg0) {
1776
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1773
1777
  const ret = new Uint8Array(arg0 >>> 0);
1774
1778
  return ret;
1775
1779
  };
1776
- imports.wbg.__wbg_next_01dd9234a5bf6d05 = function() { return handleError(function (arg0) {
1777
- const ret = arg0.next();
1778
- return ret;
1779
- }, arguments) };
1780
- imports.wbg.__wbg_next_137428deb98342b0 = function(arg0) {
1780
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1781
1781
  const ret = arg0.next;
1782
1782
  return ret;
1783
1783
  };
1784
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1785
+ const ret = arg0.next();
1786
+ return ret;
1787
+ }, arguments) };
1784
1788
  imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
1785
1789
  const ret = arg0.node;
1786
1790
  return ret;
@@ -1800,7 +1804,7 @@ function __wbg_get_imports() {
1800
1804
  const ret = module.require;
1801
1805
  return ret;
1802
1806
  }, arguments) };
1803
- imports.wbg.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
1807
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1804
1808
  arg0.set(arg1, arg2 >>> 0);
1805
1809
  };
1806
1810
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
@@ -1810,23 +1814,23 @@ function __wbg_get_imports() {
1810
1814
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1811
1815
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1812
1816
  };
1813
- imports.wbg.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() {
1817
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1814
1818
  const ret = typeof global === 'undefined' ? null : global;
1815
1819
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1816
1820
  };
1817
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() {
1821
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1818
1822
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
1819
1823
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1820
1824
  };
1821
- imports.wbg.__wbg_static_accessor_SELF_1dc398a895c82351 = function() {
1825
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1822
1826
  const ret = typeof self === 'undefined' ? null : self;
1823
1827
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1824
1828
  };
1825
- imports.wbg.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() {
1829
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1826
1830
  const ret = typeof window === 'undefined' ? null : window;
1827
1831
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1828
1832
  };
1829
- imports.wbg.__wbg_subarray_46adeb9b86949d12 = function(arg0, arg1, arg2) {
1833
+ imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1830
1834
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1831
1835
  return ret;
1832
1836
  };
@@ -1850,7 +1854,7 @@ function __wbg_get_imports() {
1850
1854
  const ret = TypedSigncryptedCiphertext.__unwrap(arg0);
1851
1855
  return ret;
1852
1856
  };
1853
- imports.wbg.__wbg_value_4c32fd138a88eee2 = function(arg0) {
1857
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1854
1858
  const ret = arg0.value;
1855
1859
  return ret;
1856
1860
  };
package/kms_lib_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "collaborators": [
5
5
  "Zama"
6
6
  ],
7
- "version": "0.11.0-rc7",
7
+ "version": "0.11.0-rc9",
8
8
  "license": "BSD-3-Clause-Clear",
9
9
  "files": [
10
10
  "kms_lib_bg.wasm",