@wireapp/core-crypto 6.0.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "6.0.1",
3
+ "version": "7.0.0",
4
4
  "author": "Wire CoreCrypto team <team.corecrypto@wire.com>",
5
5
  "repository": {
6
6
  "type": "git",
Binary file
@@ -14,18 +14,11 @@ export const __wbg_set_groupinfobundle_encryption_type: (a: number, b: number) =
14
14
  export const __wbg_get_groupinfobundle_ratchet_tree_type: (a: number) => number;
15
15
  export const __wbg_set_groupinfobundle_ratchet_tree_type: (a: number, b: number) => void;
16
16
  export const __wbg_get_groupinfobundle_payload: (a: number) => [number, number];
17
- export const __wbg_proposalbundle_free: (a: number, b: number) => void;
18
- export const __wbg_get_proposalbundle_proposal: (a: number) => [number, number];
19
- export const __wbg_get_proposalbundle_proposal_ref: (a: number) => [number, number];
20
- export const __wbg_set_proposalbundle_proposal_ref: (a: number, b: number, c: number) => void;
21
- export const __wbg_get_proposalbundle_crl_new_distribution_points: (a: number) => [number, number];
22
- export const __wbg_set_proposalbundle_crl_new_distribution_points: (a: number, b: number, c: number) => void;
23
17
  export const __wbg_get_proteusautoprekeybundle_id: (a: number) => number;
24
18
  export const __wbg_get_proteusautoprekeybundle_pkb: (a: number) => [number, number];
25
19
  export const __wbg_welcomebundle_free: (a: number, b: number) => void;
26
20
  export const __wbg_get_welcomebundle_id: (a: number) => [number, number];
27
- export const __wbg_get_welcomebundle_crl_new_distribution_points: (a: number) => [number, number];
28
- export const __wbg_set_welcomebundle_crl_new_distribution_points: (a: number, b: number, c: number) => void;
21
+ export const __wbg_get_welcomebundle_crlNewDistributionPoints: (a: number) => [number, number];
29
22
  export const __wbg_ciphersuite_free: (a: number, b: number) => void;
30
23
  export const ciphersuite_as_u16: (a: number) => number;
31
24
  export const ciphersuite_new: (a: number) => [number, number, number];
@@ -176,7 +169,6 @@ export const __wbg_get_decryptedmessage_bufferedMessages: (a: number) => [number
176
169
  export const __wbg_get_decryptedmessage_crlNewDistributionPoints: (a: number) => number;
177
170
  export const __wbg_buffereddecryptedmessage_free: (a: number, b: number) => void;
178
171
  export const __wbg_get_buffereddecryptedmessage_message: (a: number) => [number, number];
179
- export const __wbg_get_buffereddecryptedmessage_proposals: (a: number) => [number, number];
180
172
  export const __wbg_get_buffereddecryptedmessage_isActive: (a: number) => number;
181
173
  export const __wbg_get_buffereddecryptedmessage_commitDelay: (a: number) => [number, bigint];
182
174
  export const __wbg_get_buffereddecryptedmessage_senderClientId: (a: number) => number;
@@ -214,6 +206,7 @@ export const __wbg_get_newacmeauthz_challenge: (a: number) => number;
214
206
  export const __wbg_newacmeorder_free: (a: number, b: number) => void;
215
207
  export const __wbg_get_newacmeorder_delegate: (a: number) => [number, number];
216
208
  export const __wbg_get_newacmeorder_authorizations: (a: number) => [number, number];
209
+ export const corecrypto_history_client: (a: number, b: number) => any;
217
210
  export const __wbg_wireidentity_free: (a: number, b: number) => void;
218
211
  export const __wbg_get_wireidentity_clientId: (a: number) => [number, number];
219
212
  export const __wbg_get_wireidentity_status: (a: number) => number;
@@ -249,8 +242,6 @@ export const __wbg_get_buildmetadata_gitSha: (a: number) => [number, number];
249
242
  export const __wbg_get_buildmetadata_gitDirty: (a: number) => [number, number];
250
243
  export const build_metadata: () => number;
251
244
  export const __wbg_set_groupinfobundle_payload: (a: number, b: number, c: number) => void;
252
- export const __wbg_set_proposalbundle_proposal: (a: number, b: number, c: number) => void;
253
- export const __wbg_set_welcomebundle_id: (a: number, b: number, c: number) => void;
254
245
  export const __wbg_get_decryptedmessage_commitDelay: (a: number) => [number, bigint];
255
246
  export const __wbg_get_e2eidumpedpkienv_root_ca: (a: number) => [number, number];
256
247
  export const __wbg_get_acmedirectory_newAccount: (a: number) => [number, number];
@@ -259,7 +250,6 @@ export const __wbg_get_newacmeauthz_identifier: (a: number) => [number, number];
259
250
  export const __wbg_get_decryptedmessage_message: (a: number) => [number, number];
260
251
  export const __wbg_get_decryptedmessage_senderClientId: (a: number) => number;
261
252
  export const corecryptocontext_proteus_last_resort_prekey_id: () => [number, number, number];
262
- export const __wbg_get_decryptedmessage_proposals: (a: number) => [number, number];
263
253
  export const __wbg_get_decryptedmessage_identity: (a: number) => number;
264
254
  export const __wbg_proteusautoprekeybundle_free: (a: number, b: number) => void;
265
255
  export const corecryptocontext_proteus_fingerprint_prekeybundle: (a: number, b: number) => [number, number, number, number];
@@ -272,8 +262,8 @@ export const __wbindgen_free: (a: number, b: number, c: number) => void;
272
262
  export const __wbindgen_export_6: WebAssembly.Table;
273
263
  export const __externref_drop_slice: (a: number, b: number) => void;
274
264
  export const __externref_table_dealloc: (a: number) => void;
275
- export const closure874_externref_shim: (a: number, b: number, c: any) => void;
276
- export const closure2569_externref_shim: (a: number, b: number, c: any) => void;
277
- export const closure2769_externref_shim: (a: number, b: number, c: any) => void;
278
- export const closure2870_externref_shim: (a: number, b: number, c: any, d: any) => void;
265
+ export const closure971_externref_shim: (a: number, b: number, c: any) => void;
266
+ export const closure2659_externref_shim: (a: number, b: number, c: any) => void;
267
+ export const closure2859_externref_shim: (a: number, b: number, c: any) => void;
268
+ export const closure2954_externref_shim: (a: number, b: number, c: any, d: any) => void;
279
269
  export const __wbindgen_start: () => void;
@@ -116,7 +116,7 @@ export enum WirePolicy {
116
116
  /**
117
117
  * For creating a challenge.
118
118
  *
119
- * - See https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
119
+ * - See <https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1>
120
120
  * - See [core_crypto::e2e_identity::types::E2eiAcmeChallenge]
121
121
  */
122
122
  export class AcmeChallenge {
@@ -165,7 +165,6 @@ declare class BufferedDecryptedMessage {
165
165
  private constructor();
166
166
  free(): void;
167
167
  readonly message: Uint8Array | undefined;
168
- readonly proposals: ProposalBundle[];
169
168
  /**
170
169
  * It is set to false if ingesting this MLS message has resulted in the client being removed from the group (i.e. a Remove commit)
171
170
  */
@@ -308,7 +307,7 @@ declare class CoreCryptoContext {
308
307
  /**
309
308
  * See [core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash]
310
309
  *
311
- * Note that this can only succeed id the enrollment is unique and there are no other hard refs to it.
310
+ * Note that this can only succeed if the enrollment is unique and there are no other hard refs to it.
312
311
  */
313
312
  e2ei_enrollment_stash(enrollment: FfiWireE2EIdentity): Promise<Uint8Array>;
314
313
  /**
@@ -316,96 +315,99 @@ declare class CoreCryptoContext {
316
315
  */
317
316
  e2ei_enrollment_stash_pop(handle: Uint8Array): Promise<FfiWireE2EIdentity>;
318
317
  /**
319
- * See [core_crypto::mls::conversation::conversation_guard::ConversationGuard::e2ei_conversation_state]
318
+ * See [core_crypto::mls::conversation::Conversation::e2ei_conversation_state]
320
319
  */
321
320
  e2ei_conversation_state(conversation_id: Uint8Array): Promise<E2eiConversationState>;
322
321
  /**
323
- * See [core_crypto::mls::Client::e2ei_is_enabled]
322
+ * See [core_crypto::prelude::Session::e2ei_is_enabled]
324
323
  */
325
324
  e2ei_is_enabled(ciphersuite: Ciphersuite$1): Promise<boolean>;
326
325
  /**
327
- * See [core_crypto::mls::Client::get_device_identities]
326
+ * See [core_crypto::mls::conversation::Conversation::get_device_identities]
328
327
  */
329
328
  get_device_identities(conversation_id: Uint8Array, device_ids: ClientId[]): Promise<WireIdentity[]>;
330
329
  /**
331
- * See [core_crypto::mls::Client::get_user_identities]
330
+ * See [core_crypto::mls::conversation::Conversation::get_user_identities]
332
331
  */
333
332
  get_user_identities(conversation_id: Uint8Array, user_ids: string[]): Promise<Map<string, WireIdentity[]>>;
334
333
  /**
335
- * See [core_crypto::mls::Client::get_credential_in_use]
334
+ * See [core_crypto::prelude::Session::get_credential_in_use]
336
335
  */
337
336
  get_credential_in_use(group_info: Uint8Array, credential_type: CredentialType): Promise<E2eiConversationState>;
337
+ /**
338
+ * See [core_crypto::prelude::Session::e2ei_dump_pki_env]
339
+ */
338
340
  e2ei_dump_pki_env(): Promise<E2eiDumpedPkiEnv | undefined>;
339
341
  /**
340
- * See [core_crypto::mls::MlsCentral::e2ei_is_pki_env_setup]
342
+ * See [core_crypto::prelude::Session::e2ei_is_pki_env_setup]
341
343
  */
342
344
  e2ei_is_pki_env_setup(): Promise<boolean>;
343
345
  /**
344
- * See [core_crypto::context::CentralContext::mls_init]
346
+ * See [core_crypto::transaction_context::TransactionContext::mls_init]
345
347
  */
346
348
  mls_init(client_id: ClientId, ciphersuites: Ciphersuites, nb_key_package?: number | null): Promise<void>;
347
349
  /**
348
- * See [core_crypto::context::CentralContext::mls_generate_keypairs]
350
+ * See [core_crypto::transaction_context::TransactionContext::mls_generate_keypairs]
349
351
  */
350
352
  mls_generate_keypairs(ciphersuites: Ciphersuites): Promise<ClientId[]>;
351
353
  /**
352
- * See [core_crypto::context::CentralContext::mls_init_with_client_id]
354
+ * See [core_crypto::transaction_context::TransactionContext::mls_init_with_client_id]
353
355
  */
354
356
  mls_init_with_client_id(client_id: ClientId, tmp_client_ids: ClientId[], ciphersuites: Ciphersuites): Promise<void>;
355
357
  /**
356
- * See [core_crypto::mls::MlsCentral::client_public_key]
358
+ * See [core_crypto::transaction_context::TransactionContext::client_public_key]
357
359
  */
358
360
  client_public_key(ciphersuite: Ciphersuite$1, credential_type: CredentialType): Promise<Uint8Array>;
359
361
  /**
360
- * See [core_crypto::mls::conversation::ConversationGuard::epoch]
362
+ * See [core_crypto::mls::conversation::Conversation::epoch]
361
363
  */
362
364
  conversation_epoch(conversation_id: Uint8Array): Promise<bigint>;
363
365
  /**
364
- * See [core_crypto::mls::conversation::ConversationGuard::ciphersuite]
366
+ * See [core_crypto::mls::conversation::Conversation::ciphersuite]
365
367
  */
366
368
  conversation_ciphersuite(conversation_id: Uint8Array): Promise<Ciphersuite$1>;
367
369
  /**
368
- * See [core_crypto::mls::MlsCentral::conversation_exists]
370
+ * See [core_crypto::prelude::Session::conversation_exists]
369
371
  */
370
372
  conversation_exists(conversation_id: Uint8Array): Promise<boolean>;
371
373
  /**
372
- * See [core_crypto::mls::conversation::ImmutableConversation::get_client_ids]
374
+ * See [core_crypto::mls::conversation::Conversation::get_client_ids]
373
375
  */
374
376
  get_client_ids(conversation_id: Uint8Array): Promise<ClientId[]>;
375
377
  /**
376
- * See [core_crypto::mls::conversation::ImmutableConversation::export_secret_key]
378
+ * See [core_crypto::mls::conversation::Conversation::export_secret_key]
377
379
  */
378
380
  export_secret_key(conversation_id: Uint8Array, key_length: number): Promise<Uint8Array>;
379
381
  /**
380
- * See [core_crypto::mls::conversation::ImmutableConversation::get_external_sender]
382
+ * See [core_crypto::mls::conversation::Conversation::get_external_sender]
381
383
  */
382
384
  get_external_sender(conversation_id: Uint8Array): Promise<Uint8Array>;
383
385
  /**
384
- * See [core_crypto::context::CentralContext::get_or_create_client_keypackages]
386
+ * See [core_crypto::transaction_context::TransactionContext::get_or_create_client_keypackages]
385
387
  */
386
388
  client_keypackages(ciphersuite: Ciphersuite$1, credential_type: CredentialType, amount_requested: number): Promise<ArrayOfByteArray>;
387
389
  /**
388
- * See [core_crypto::context::CentralContext::client_valid_key_packages_count]
390
+ * See [core_crypto::transaction_context::TransactionContext::client_valid_key_packages_count]
389
391
  */
390
392
  client_valid_keypackages_count(ciphersuite: Ciphersuite$1, credential_type: CredentialType): Promise<bigint>;
391
393
  /**
392
- * See [core_crypto::context::CentralContext::delete_keypackages]
394
+ * See [core_crypto::transaction_context::TransactionContext::delete_keypackages]
393
395
  */
394
396
  delete_keypackages(refs: ArrayOfByteArray): Promise<void>;
395
397
  /**
396
- * See [core_crypto::context::CentralContext::new_conversation]
398
+ * See [core_crypto::transaction_context::TransactionContext::new_conversation]
397
399
  */
398
400
  create_conversation(conversation_id: Uint8Array, creator_credential_type: CredentialType, config: ConversationConfiguration): Promise<void>;
399
401
  /**
400
- * See [core_crypto::context::CentralContext::process_raw_welcome_message]
402
+ * See [core_crypto::transaction_context::TransactionContext::process_raw_welcome_message]
401
403
  */
402
404
  process_welcome_message(welcome_message: Uint8Array, custom_configuration: CustomConfiguration): Promise<WelcomeBundle>;
403
405
  /**
404
- * See [core_crypto::mls::conversation::conversation_guard::ConversationGuard::add_members]
406
+ * See [core_crypto::mls::conversation::ConversationGuard::add_members]
405
407
  */
406
408
  add_clients_to_conversation(conversation_id: Uint8Array, key_packages: ArrayOfByteArray): Promise<NewCrlDistributionPoints>;
407
409
  /**
408
- * See [core_crypto::context::CentralContext::remove_members_from_conversation]
410
+ * See [core_crypto::mls::conversation::ConversationGuard::remove_members]
409
411
  */
410
412
  remove_clients_from_conversation(conversation_id: Uint8Array, clients: ClientId[]): Promise<void>;
411
413
  /**
@@ -413,27 +415,27 @@ declare class CoreCryptoContext {
413
415
  */
414
416
  mark_conversation_as_child_of(child_id: Uint8Array, parent_id: Uint8Array): Promise<void>;
415
417
  /**
416
- * See [core_crypto::context::CentralContext::update_keying_material]
418
+ * See [core_crypto::mls::conversation::ConversationGuard::update_key_material]
417
419
  */
418
420
  update_keying_material(conversation_id: Uint8Array): Promise<void>;
419
421
  /**
420
- * See [core_crypto::mls::conversation::conversation_guard::ConversationGuard::commit_pending_proposals]
422
+ * See [core_crypto::mls::conversation::ConversationGuard::commit_pending_proposals]
421
423
  */
422
424
  commit_pending_proposals(conversation_id: Uint8Array): Promise<void>;
423
425
  /**
424
- * see [core_crypto::context::CentralContext::wipe_conversation]
426
+ * See [core_crypto::mls::conversation::ConversationGuard::wipe]
425
427
  */
426
428
  wipe_conversation(conversation_id: Uint8Array): Promise<void>;
427
429
  /**
428
- * See [core_crypto::mls::conversation::conversation_guard::ConversationGuard::decrypt_message]
430
+ * See [core_crypto::mls::conversation::ConversationGuard::decrypt_message]
429
431
  */
430
432
  decrypt_message(conversation_id: Uint8Array, payload: Uint8Array): Promise<DecryptedMessage>;
431
433
  /**
432
- * See [core_crypto::mls::conversation::conversation_guard::ConversationGuard::encrypt_message]
434
+ * See [core_crypto::mls::conversation::ConversationGuard::encrypt_message]
433
435
  */
434
436
  encrypt_message(conversation_id: Uint8Array, message: Uint8Array): Promise<Uint8Array>;
435
437
  /**
436
- * See [core_crypto::context::CentralContext::join_by_external_commit]
438
+ * See [core_crypto::transaction_context::TransactionContext::join_by_external_commit]
437
439
  */
438
440
  join_by_external_commit(group_info: Uint8Array, custom_configuration: CustomConfiguration, credential_type: CredentialType): Promise<WelcomeBundle>;
439
441
  /**
@@ -441,68 +443,70 @@ declare class CoreCryptoContext {
441
443
  */
442
444
  proteus_init(): Promise<void>;
443
445
  /**
444
- * See [core_crypto::context::CentralContext::proteus_session_from_prekey]
446
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_from_prekey]
445
447
  */
446
448
  proteus_session_from_prekey(session_id: string, prekey: Uint8Array): Promise<void>;
447
449
  /**
448
- * See [core_crypto::context::CentralContext::proteus_session_from_message]
450
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_from_message]
449
451
  */
450
452
  proteus_session_from_message(session_id: string, envelope: Uint8Array): Promise<Uint8Array>;
451
453
  /**
452
- * See [core_crypto::context::CentralContext::proteus_session_save]
453
- * **Note**: This isn't usually needed as persisting sessions happens automatically when decrypting/encrypting messages and initializing Sessions
454
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_save]
455
+ *
456
+ * **Note**: This isn't usually needed as persisting sessions happens automatically when
457
+ * decrypting/encrypting messages and initializing Sessions
454
458
  */
455
459
  proteus_session_save(session_id: string): Promise<void>;
456
460
  /**
457
- * See [core_crypto::context::CentralContext::proteus_session_delete]
461
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_delete]
458
462
  */
459
463
  proteus_session_delete(session_id: string): Promise<void>;
460
464
  /**
461
- * See [core_crypto::context::CentralContext::proteus_session_exists]
465
+ * See [core_crypto::transaction_context::TransactionContext::proteus_session_exists]
462
466
  */
463
467
  proteus_session_exists(session_id: string): Promise<boolean>;
464
468
  /**
465
- * See [core_crypto::context::CentralContext::proteus_decrypt]
469
+ * See [core_crypto::transaction_context::TransactionContext::proteus_decrypt]
466
470
  */
467
471
  proteus_decrypt(session_id: string, ciphertext: Uint8Array): Promise<Uint8Array>;
468
472
  /**
469
- * See [core_crypto::context::CentralContext::proteus_encrypt]
473
+ * See [core_crypto::transaction_context::TransactionContext::proteus_encrypt]
470
474
  */
471
475
  proteus_encrypt(session_id: string, plaintext: Uint8Array): Promise<Uint8Array>;
472
476
  /**
473
- * See [core_crypto::context::CentralContext::proteus_encrypt_batched]
477
+ * See [core_crypto::transaction_context::TransactionContext::proteus_encrypt_batched]
474
478
  */
475
479
  proteus_encrypt_batched(sessions: string[], plaintext: Uint8Array): Promise<Map<string, Uint8Array>>;
476
480
  /**
477
- * See [core_crypto::context::CentralContext::proteus_new_prekey]
481
+ * See [core_crypto::transaction_context::TransactionContext::proteus_new_prekey]
478
482
  */
479
483
  proteus_new_prekey(prekey_id: number): Promise<Uint8Array>;
480
484
  /**
481
- * See [core_crypto::context::CentralContext::proteus_new_prekey_auto]
485
+ * See [core_crypto::transaction_context::TransactionContext::proteus_new_prekey_auto]
482
486
  */
483
487
  proteus_new_prekey_auto(): Promise<ProteusAutoPrekeyBundle>;
484
488
  /**
485
- * See [core_crypto::context::CentralContext::proteus_last_resort_prekey]
489
+ * See [core_crypto::transaction_context::TransactionContext::proteus_last_resort_prekey]
486
490
  */
487
491
  proteus_last_resort_prekey(): Promise<Uint8Array>;
488
492
  /**
489
- * See [core_crypto::context::CentralContext::proteus_fingerprint]
493
+ * See [core_crypto::transaction_context::TransactionContext::proteus_fingerprint]
490
494
  */
491
495
  proteus_fingerprint(): Promise<string>;
492
496
  /**
493
- * See [core_crypto::context::CentralContext::proteus_fingerprint_local]
497
+ * See [core_crypto::transaction_context::TransactionContext::proteus_fingerprint_local]
494
498
  */
495
499
  proteus_fingerprint_local(session_id: string): Promise<string>;
496
500
  /**
497
- * See [core_crypto::context::CentralContext::proteus_fingerprint_remote]
501
+ * See [core_crypto::transaction_context::TransactionContext::proteus_fingerprint_remote]
498
502
  */
499
503
  proteus_fingerprint_remote(session_id: string): Promise<string>;
500
504
  /**
501
- * See [core_crypto::context::CentralContext::proteus_cryptobox_migrate]
505
+ * See [core_crypto::transaction_context::TransactionContext::proteus_cryptobox_migrate]
502
506
  */
503
507
  proteus_cryptobox_migrate(path: string): Promise<void>;
504
508
  /**
505
- * See [core_crypto::context::CentralContext::proteus_reload_sessions]
509
+ * See [core_crypto::transaction_context::TransactionContext::proteus_reload_sessions]
506
510
  */
507
511
  proteus_reload_sessions(): Promise<void>;
508
512
  /**
@@ -514,15 +518,15 @@ declare class CoreCryptoContext {
514
518
  */
515
519
  static proteus_fingerprint_prekeybundle(prekey: Uint8Array): string;
516
520
  /**
517
- * See [core_crypto::context::CentralContext::set_data].
521
+ * See [core_crypto::transaction_context::TransactionContext::set_data]
518
522
  */
519
523
  set_data(data: Uint8Array): Promise<void>;
520
524
  /**
521
- * See [core_crypto::context::CentralContext::get_data].
525
+ * See [core_crypto::transaction_context::TransactionContext::get_data]
522
526
  */
523
527
  get_data(): Promise<Uint8Array | undefined>;
524
528
  /**
525
- * see [core_crypto::mls::context::CentralContext::random_bytes]
529
+ * See [core_crypto::prelude::Session::random_bytes].
526
530
  */
527
531
  random_bytes(len: number): Promise<Uint8Array>;
528
532
  }
@@ -577,7 +581,6 @@ declare class DecryptedMessage {
577
581
  private constructor();
578
582
  free(): void;
579
583
  readonly message: Uint8Array | undefined;
580
- readonly proposals: ProposalBundle[];
581
584
  /**
582
585
  * It is set to false if ingesting this MLS message has resulted in the client being removed from the group (i.e. a Remove commit)
583
586
  */
@@ -694,7 +697,7 @@ declare class FfiWireE2EIdentity {
694
697
  /**
695
698
  * Result of an authorization creation.
696
699
  *
697
- * - See https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
700
+ * - See <https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5>
698
701
  * - See [core_crypto::e2e_identity::types::E2eiNewAcmeAuthz]
699
702
  */
700
703
  export class NewAcmeAuthz {
@@ -716,7 +719,7 @@ export class NewAcmeAuthz {
716
719
  /**
717
720
  * Result of an order creation.
718
721
  *
719
- * - See https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
722
+ * - See <https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4>
720
723
  * - See [core_crypto::e2e_identity::types::E2eiNewAcmeOrder]
721
724
  */
722
725
  export class NewAcmeOrder {
@@ -730,26 +733,6 @@ declare class NewCrlDistributionPoints {
730
733
  free(): void;
731
734
  as_strings(): string[] | undefined;
732
735
  }
733
- declare class ProposalBundle {
734
- private constructor();
735
- free(): void;
736
- /**
737
- * TLS-serialized MLS proposal that needs to be fanned out to other (existing) members of the conversation
738
- */
739
- proposal: Uint8Array;
740
- /**
741
- * Unique identifier of a proposal.
742
- */
743
- proposal_ref: Uint8Array;
744
- /**
745
- * New CRL Distribution of members of this group
746
- */
747
- get crl_new_distribution_points(): string[] | undefined;
748
- /**
749
- * New CRL Distribution of members of this group
750
- */
751
- set crl_new_distribution_points(value: string[] | null | undefined);
752
- }
753
736
  declare class ProteusAutoPrekeyBundle {
754
737
  private constructor();
755
738
  free(): void;
@@ -757,7 +740,7 @@ declare class ProteusAutoPrekeyBundle {
757
740
  readonly pkb: Uint8Array;
758
741
  }
759
742
  /**
760
- * see [core_crypto::prelude::MlsConversationCreationMessage]
743
+ * see [core_crypto::prelude::WelcomeBundle]
761
744
  */
762
745
  export class WelcomeBundle {
763
746
  private constructor();
@@ -765,15 +748,11 @@ export class WelcomeBundle {
765
748
  /**
766
749
  * Identifier of the joined conversation
767
750
  */
768
- id: Uint8Array;
751
+ readonly id: Uint8Array;
769
752
  /**
770
753
  * New CRL Distribution of members of this group
771
754
  */
772
- get crl_new_distribution_points(): string[] | undefined;
773
- /**
774
- * New CRL Distribution of members of this group
775
- */
776
- set crl_new_distribution_points(value: string[] | null | undefined);
755
+ readonly crlNewDistributionPoints: string[] | undefined;
777
756
  }
778
757
  /**
779
758
  * See [core_crypto::prelude::WireIdentity]
@@ -917,13 +896,6 @@ interface DecryptedMessage$1 {
917
896
  * Raw decrypted application message, if the decrypted MLS message is an application message
918
897
  */
919
898
  message?: Uint8Array;
920
- /**
921
- * Only when decrypted message is a commit, CoreCrypto will renew local proposal which could not make it in the commit.
922
- * This will contain either:
923
- * * local pending proposal not in the accepted commit
924
- * * If there is a pending commit, its proposals which are not in the accepted commit
925
- */
926
- proposals: ProposalBundle$1[];
927
899
  /**
928
900
  * It is set to false if ingesting this MLS message has resulted in the client being removed from the group (i.e. a Remove commit)
929
901
  */
@@ -965,10 +937,6 @@ interface BufferedDecryptedMessage$1 {
965
937
  * see {@link DecryptedMessage.message}
966
938
  */
967
939
  message?: Uint8Array;
968
- /**
969
- * see {@link DecryptedMessage.proposals}
970
- */
971
- proposals: ProposalBundle$1[];
972
940
  /**
973
941
  * see {@link DecryptedMessage.isActive}
974
942
  */
@@ -994,29 +962,6 @@ interface BufferedDecryptedMessage$1 {
994
962
  */
995
963
  crlNewDistributionPoints?: string[];
996
964
  }
997
- /**
998
- * Returned by all methods creating proposals. Contains a proposal message and an identifier to roll back the proposal
999
- */
1000
- interface ProposalBundle$1 {
1001
- /**
1002
- * TLS-serialized MLS proposal that needs to be fanned out to other (existing) members of the conversation
1003
- *
1004
- * @readonly
1005
- */
1006
- proposal: Uint8Array;
1007
- /**
1008
- * Unique identifier of a proposal.
1009
- *
1010
- * @readonly
1011
- */
1012
- proposalRef: ProposalRef;
1013
- /**
1014
- * New CRL Distribution of members of this group
1015
- *
1016
- * @readonly
1017
- */
1018
- crlNewDistributionPoints?: string[];
1019
- }
1020
965
  /**
1021
966
  * Returned by {@link MlsTransport} callbacks.
1022
967
  */
@@ -1981,6 +1926,13 @@ export declare class CoreCrypto {
1981
1926
  * @param params - {@link CoreCryptoDeferredParams}
1982
1927
  */
1983
1928
  static deferredInit({ databaseName, key, entropySeed, wasmFilePath, }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
1929
+ /**
1930
+ * Instantiate a history client.
1931
+ *
1932
+ * This client exposes the full interface of `CoreCrypto`, but it should only be used to decrypt messages.
1933
+ * Other use is a logic error.
1934
+ */
1935
+ static historyClient(historySecret: Uint8Array): Promise<CoreCrypto>;
1984
1936
  /**
1985
1937
  * Starts a new transaction in Core Crypto. If the callback succeeds, it will be committed,
1986
1938
  * otherwise, every operation performed with the context will be discarded.
@@ -2186,6 +2138,12 @@ export declare class CoreCrypto {
2186
2138
  */
2187
2139
  registerEpochObserver(observer: EpochObserver): Promise<void>;
2188
2140
  }
2141
+ /**
2142
+ * Initialises the wasm module necessary for running core crypto.
2143
+ *
2144
+ * @param location path where the wasm module is located. If omitted the module is assumed be located at the root of the core crypto module.
2145
+ */
2146
+ export declare function initWasmModule(location?: string | undefined): Promise<void>;
2189
2147
 
2190
2148
  export {
2191
2149
  AcmeDirectory$1 as AcmeDirectory,
@@ -2198,7 +2156,6 @@ export {
2198
2156
  MlsGroupInfoEncryptionType as GroupInfoEncryptionType,
2199
2157
  MlsRatchetTreeType as RatchetTreeType,
2200
2158
  NewCrlDistributionPoints$1 as NewCrlDistributionPoints,
2201
- ProposalBundle$1 as ProposalBundle,
2202
2159
  ProteusAutoPrekeyBundle$1 as ProteusAutoPrekeyBundle,
2203
2160
  };
2204
2161
 
package/src/corecrypto.js CHANGED
@@ -279,15 +279,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
279
279
  wasm.__externref_drop_slice(ptr, len);
280
280
  return result;
281
281
  }
282
- function passArrayJsValueToWasm0(array, malloc) {
283
- const ptr = malloc(array.length * 4, 4) >>> 0;
284
- for (let i = 0;i < array.length; i++) {
285
- const add = addToExternrefTable0(array[i]);
286
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
287
- }
288
- WASM_VECTOR_LEN = array.length;
289
- return ptr;
290
- }
291
282
  function takeFromExternrefTable0(idx) {
292
283
  const value = wasm.__wbindgen_export_4.get(idx);
293
284
  wasm.__externref_table_dealloc(idx);
@@ -306,6 +297,15 @@ function passArray16ToWasm0(arg, malloc) {
306
297
  WASM_VECTOR_LEN = arg.length;
307
298
  return ptr;
308
299
  }
300
+ function passArrayJsValueToWasm0(array, malloc) {
301
+ const ptr = malloc(array.length * 4, 4) >>> 0;
302
+ for (let i = 0;i < array.length; i++) {
303
+ const add = addToExternrefTable0(array[i]);
304
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
305
+ }
306
+ WASM_VECTOR_LEN = array.length;
307
+ return ptr;
308
+ }
309
309
  function migrateDatabaseKeyTypeToBytes(name, old_key, new_key) {
310
310
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
311
311
  const len0 = WASM_VECTOR_LEN;
@@ -332,16 +332,16 @@ function build_metadata() {
332
332
  return BuildMetadata.__wrap(ret);
333
333
  }
334
334
  function __wbg_adapter_60(arg0, arg1, arg2) {
335
- wasm.closure874_externref_shim(arg0, arg1, arg2);
335
+ wasm.closure971_externref_shim(arg0, arg1, arg2);
336
336
  }
337
337
  function __wbg_adapter_63(arg0, arg1, arg2) {
338
- wasm.closure2569_externref_shim(arg0, arg1, arg2);
338
+ wasm.closure2659_externref_shim(arg0, arg1, arg2);
339
339
  }
340
340
  function __wbg_adapter_66(arg0, arg1, arg2) {
341
- wasm.closure2769_externref_shim(arg0, arg1, arg2);
341
+ wasm.closure2859_externref_shim(arg0, arg1, arg2);
342
342
  }
343
- function __wbg_adapter_566(arg0, arg1, arg2, arg3) {
344
- wasm.closure2870_externref_shim(arg0, arg1, arg2, arg3);
343
+ function __wbg_adapter_555(arg0, arg1, arg2, arg3) {
344
+ wasm.closure2954_externref_shim(arg0, arg1, arg2, arg3);
345
345
  }
346
346
  var CoreCryptoLogLevel = Object.freeze({
347
347
  Off: 1,
@@ -593,12 +593,6 @@ class BufferedDecryptedMessage {
593
593
  }
594
594
  return v1;
595
595
  }
596
- get proposals() {
597
- const ret = wasm.__wbg_get_buffereddecryptedmessage_proposals(this.__wbg_ptr);
598
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
599
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
600
- return v1;
601
- }
602
596
  get isActive() {
603
597
  const ret = wasm.__wbg_get_buffereddecryptedmessage_isActive(this.__wbg_ptr);
604
598
  return ret !== 0;
@@ -1098,6 +1092,12 @@ class CoreCrypto {
1098
1092
  const ret = wasm.corecrypto_can_close(this.__wbg_ptr);
1099
1093
  return ret;
1100
1094
  }
1095
+ static history_client(history_secret) {
1096
+ const ptr0 = passArray8ToWasm0(history_secret, wasm.__wbindgen_malloc);
1097
+ const len0 = WASM_VECTOR_LEN;
1098
+ const ret = wasm.corecrypto_history_client(ptr0, len0);
1099
+ return ret;
1100
+ }
1101
1101
  }
1102
1102
  var CoreCryptoContextFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_corecryptocontext_free(ptr >>> 0, 1));
1103
1103
 
@@ -1687,12 +1687,6 @@ class DecryptedMessage {
1687
1687
  }
1688
1688
  return v1;
1689
1689
  }
1690
- get proposals() {
1691
- const ret = wasm.__wbg_get_decryptedmessage_proposals(this.__wbg_ptr);
1692
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1693
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1694
- return v1;
1695
- }
1696
1690
  get isActive() {
1697
1691
  const ret = wasm.__wbg_get_decryptedmessage_isActive(this.__wbg_ptr);
1698
1692
  return ret !== 0;
@@ -2156,63 +2150,6 @@ class NewCrlDistributionPoints {
2156
2150
  return v1;
2157
2151
  }
2158
2152
  }
2159
- var ProposalBundleFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_proposalbundle_free(ptr >>> 0, 1));
2160
-
2161
- class ProposalBundle {
2162
- static __wrap(ptr) {
2163
- ptr = ptr >>> 0;
2164
- const obj = Object.create(ProposalBundle.prototype);
2165
- obj.__wbg_ptr = ptr;
2166
- ProposalBundleFinalization.register(obj, obj.__wbg_ptr, obj);
2167
- return obj;
2168
- }
2169
- __destroy_into_raw() {
2170
- const ptr = this.__wbg_ptr;
2171
- this.__wbg_ptr = 0;
2172
- ProposalBundleFinalization.unregister(this);
2173
- return ptr;
2174
- }
2175
- free() {
2176
- const ptr = this.__destroy_into_raw();
2177
- wasm.__wbg_proposalbundle_free(ptr, 0);
2178
- }
2179
- get proposal() {
2180
- const ret = wasm.__wbg_get_proposalbundle_proposal(this.__wbg_ptr);
2181
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2182
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2183
- return v1;
2184
- }
2185
- set proposal(arg0) {
2186
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
2187
- const len0 = WASM_VECTOR_LEN;
2188
- wasm.__wbg_set_commitbundle_commit(this.__wbg_ptr, ptr0, len0);
2189
- }
2190
- get proposal_ref() {
2191
- const ret = wasm.__wbg_get_proposalbundle_proposal_ref(this.__wbg_ptr);
2192
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2193
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2194
- return v1;
2195
- }
2196
- set proposal_ref(arg0) {
2197
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
2198
- const len0 = WASM_VECTOR_LEN;
2199
- wasm.__wbg_set_proposalbundle_proposal_ref(this.__wbg_ptr, ptr0, len0);
2200
- }
2201
- get crl_new_distribution_points() {
2202
- const ret = wasm.__wbg_get_proposalbundle_crl_new_distribution_points(this.__wbg_ptr);
2203
- let v1;
2204
- if (ret[0] !== 0) {
2205
- v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2206
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2207
- }
2208
- return v1;
2209
- }
2210
- set crl_new_distribution_points(arg0) {
2211
- var ptr0 = isLikeNone(arg0) ? 0 : passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
2212
- var len0 = WASM_VECTOR_LEN;
2213
- wasm.__wbg_set_proposalbundle_crl_new_distribution_points(this.__wbg_ptr, ptr0, len0);
2214
- }
2215
- }
2216
2153
  var ProteusAutoPrekeyBundleFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_proteusautoprekeybundle_free(ptr >>> 0, 1));
2217
2154
 
2218
2155
  class ProteusAutoPrekeyBundle {
@@ -2270,13 +2207,8 @@ class WelcomeBundle {
2270
2207
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2271
2208
  return v1;
2272
2209
  }
2273
- set id(arg0) {
2274
- const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
2275
- const len0 = WASM_VECTOR_LEN;
2276
- wasm.__wbg_set_commitbundle_commit(this.__wbg_ptr, ptr0, len0);
2277
- }
2278
- get crl_new_distribution_points() {
2279
- const ret = wasm.__wbg_get_welcomebundle_crl_new_distribution_points(this.__wbg_ptr);
2210
+ get crlNewDistributionPoints() {
2211
+ const ret = wasm.__wbg_get_welcomebundle_crlNewDistributionPoints(this.__wbg_ptr);
2280
2212
  let v1;
2281
2213
  if (ret[0] !== 0) {
2282
2214
  v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
@@ -2284,11 +2216,6 @@ class WelcomeBundle {
2284
2216
  }
2285
2217
  return v1;
2286
2218
  }
2287
- set crl_new_distribution_points(arg0) {
2288
- var ptr0 = isLikeNone(arg0) ? 0 : passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
2289
- var len0 = WASM_VECTOR_LEN;
2290
- wasm.__wbg_set_welcomebundle_crl_new_distribution_points(this.__wbg_ptr, ptr0, len0);
2291
- }
2292
2219
  }
2293
2220
  var WireIdentityFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_wireidentity_free(ptr >>> 0, 1));
2294
2221
 
@@ -2676,7 +2603,7 @@ function __wbg_get_imports() {
2676
2603
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2677
2604
  }, arguments);
2678
2605
  };
2679
- imports.wbg.__wbg_execute_20b310ab25324b17 = function() {
2606
+ imports.wbg.__wbg_execute_7164ab6090225d0a = function() {
2680
2607
  return handleError(function(arg0, arg1) {
2681
2608
  const ret = arg0.execute(CoreCryptoContext.__wrap(arg1));
2682
2609
  return ret;
@@ -2927,7 +2854,7 @@ function __wbg_get_imports() {
2927
2854
  const a = state0.a;
2928
2855
  state0.a = 0;
2929
2856
  try {
2930
- return __wbg_adapter_566(a, state0.b, arg02, arg12);
2857
+ return __wbg_adapter_555(a, state0.b, arg02, arg12);
2931
2858
  } finally {
2932
2859
  state0.a = a;
2933
2860
  }
@@ -3052,10 +2979,6 @@ function __wbg_get_imports() {
3052
2979
  const ret = arg0.process;
3053
2980
  return ret;
3054
2981
  };
3055
- imports.wbg.__wbg_proposalbundle_new = function(arg0) {
3056
- const ret = ProposalBundle.__wrap(arg0);
3057
- return ret;
3058
- };
3059
2982
  imports.wbg.__wbg_proteusautoprekeybundle_new = function(arg0) {
3060
2983
  const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
3061
2984
  return ret;
@@ -3282,16 +3205,16 @@ function __wbg_get_imports() {
3282
3205
  const ret = false;
3283
3206
  return ret;
3284
3207
  };
3285
- imports.wbg.__wbindgen_closure_wrapper14006 = function(arg0, arg1, arg2) {
3286
- const ret = makeMutClosure(arg0, arg1, 2570, __wbg_adapter_63);
3208
+ imports.wbg.__wbindgen_closure_wrapper14691 = function(arg0, arg1, arg2) {
3209
+ const ret = makeMutClosure(arg0, arg1, 2660, __wbg_adapter_63);
3287
3210
  return ret;
3288
3211
  };
3289
- imports.wbg.__wbindgen_closure_wrapper15172 = function(arg0, arg1, arg2) {
3290
- const ret = makeMutClosure(arg0, arg1, 2770, __wbg_adapter_66);
3212
+ imports.wbg.__wbindgen_closure_wrapper15848 = function(arg0, arg1, arg2) {
3213
+ const ret = makeMutClosure(arg0, arg1, 2860, __wbg_adapter_66);
3291
3214
  return ret;
3292
3215
  };
3293
- imports.wbg.__wbindgen_closure_wrapper3886 = function(arg0, arg1, arg2) {
3294
- const ret = makeMutClosure(arg0, arg1, 875, __wbg_adapter_60);
3216
+ imports.wbg.__wbindgen_closure_wrapper4521 = function(arg0, arg1, arg2) {
3217
+ const ret = makeMutClosure(arg0, arg1, 972, __wbg_adapter_60);
3295
3218
  return ret;
3296
3219
  };
3297
3220
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
@@ -3450,7 +3373,6 @@ function decryptedMessageFromFfi(m) {
3450
3373
  function bufferedDecryptedMessageFromFfi(m) {
3451
3374
  return {
3452
3375
  message: m.message,
3453
- proposals: m.proposals.map((proposal) => proposalBundleFromFfi(proposal)),
3454
3376
  isActive: m.isActive,
3455
3377
  commitDelay: m.commitDelay ? safeBigintToNumber(m.commitDelay) : undefined,
3456
3378
  senderClientId: m.senderClientId?.as_bytes(),
@@ -3459,13 +3381,6 @@ function bufferedDecryptedMessageFromFfi(m) {
3459
3381
  crlNewDistributionPoints: m.crlNewDistributionPoints.as_strings()
3460
3382
  };
3461
3383
  }
3462
- function proposalBundleFromFfi(p) {
3463
- return {
3464
- proposal: p.proposal,
3465
- proposalRef: p.proposal_ref,
3466
- crlNewDistributionPoints: p.crl_new_distribution_points
3467
- };
3468
- }
3469
3384
  function mapTransportResponseToFfi(response) {
3470
3385
  if (response === "success") {
3471
3386
  return new MlsTransportResponse(MlsTransportResponseVariant.Success);
@@ -3939,6 +3854,10 @@ class CoreCrypto2 {
3939
3854
  const cc = await CoreCryptoError.asyncMapErr(CoreCrypto.deferred_init(databaseName, key, entropySeed));
3940
3855
  return new this(cc);
3941
3856
  }
3857
+ static async historyClient(historySecret) {
3858
+ const cc = await CoreCryptoError.asyncMapErr(CoreCrypto.history_client(historySecret));
3859
+ return new this(cc);
3860
+ }
3942
3861
  async transaction(callback) {
3943
3862
  let result;
3944
3863
  let error = null;
@@ -4070,21 +3989,30 @@ class CoreCrypto2 {
4070
3989
  }
4071
3990
  }
4072
3991
  // src/CoreCrypto.ts
4073
- if (typeof window !== "undefined") {
4074
- await core_crypto_ffi_default({});
4075
- } else {
4076
- const fs = await import("fs/promises");
4077
- const path = new URL("core-crypto-ffi_bg.wasm", import.meta.url);
4078
- const file = await fs.open(path);
4079
- const buffer = await file.readFile();
4080
- const module = new WebAssembly.Module(buffer);
4081
- await core_crypto_ffi_default({ module_or_path: module });
3992
+ async function initWasmModule(location = undefined) {
3993
+ if (typeof window !== "undefined") {
3994
+ if (typeof location === "string") {
3995
+ const path = new URL("core-crypto-ffi_bg.wasm", location);
3996
+ await core_crypto_ffi_default({ path });
3997
+ } else {
3998
+ const path = new URL("core-crypto-ffi_bg.wasm", import.meta.url);
3999
+ await core_crypto_ffi_default({ path });
4000
+ }
4001
+ } else {
4002
+ const fs = await import("fs/promises");
4003
+ const path = new URL("core-crypto-ffi_bg.wasm", import.meta.url);
4004
+ const file = await fs.open(path);
4005
+ const buffer = await file.readFile();
4006
+ const module = new WebAssembly.Module(buffer);
4007
+ await core_crypto_ffi_default({ module_or_path: module });
4008
+ }
4082
4009
  }
4083
4010
  export {
4084
4011
  version2 as version,
4085
4012
  setMaxLogLevel,
4086
4013
  setLogger,
4087
4014
  migrateDatabaseKeyTypeToBytes,
4015
+ initWasmModule,
4088
4016
  buildMetadata,
4089
4017
  X509Identity2 as X509Identity,
4090
4018
  WirePolicy,