@signalapp/libsignal-client 0.41.2 → 0.43.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.
Files changed (41) hide show
  1. package/Native.d.ts +35 -28
  2. package/dist/Errors.d.ts +22 -10
  3. package/dist/Errors.js +12 -9
  4. package/dist/acknowledgments.md +72 -68
  5. package/dist/net.d.ts +59 -25
  6. package/dist/net.js +47 -6
  7. package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +0 -5
  8. package/dist/zkgroup/auth/ClientZkAuthOperations.js +0 -11
  9. package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +0 -3
  10. package/dist/zkgroup/auth/ServerZkAuthOperations.js +0 -8
  11. package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +23 -0
  12. package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.js +34 -0
  13. package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +68 -0
  14. package/dist/zkgroup/groupsend/GroupSendEndorsement.js +84 -0
  15. package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +73 -0
  16. package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.js +102 -0
  17. package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +23 -0
  18. package/dist/zkgroup/groupsend/GroupSendFullToken.js +36 -0
  19. package/dist/zkgroup/groupsend/GroupSendToken.d.ts +22 -0
  20. package/dist/zkgroup/groupsend/GroupSendToken.js +34 -0
  21. package/dist/zkgroup/index.d.ts +5 -5
  22. package/dist/zkgroup/index.js +12 -12
  23. package/dist/zkgroup/internal/ByteArray.d.ts +2 -1
  24. package/dist/zkgroup/internal/ByteArray.js +10 -2
  25. package/package.json +2 -1
  26. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  27. package/prebuilds/darwin-x64/node.napi.node +0 -0
  28. package/prebuilds/linux-arm64/node.napi.node +0 -0
  29. package/prebuilds/linux-x64/node.napi.node +0 -0
  30. package/prebuilds/win32-arm64/node.napi.node +0 -0
  31. package/prebuilds/win32-x64/node.napi.node +0 -0
  32. package/dist/zkgroup/auth/AuthCredential.d.ts +0 -6
  33. package/dist/zkgroup/auth/AuthCredential.js +0 -15
  34. package/dist/zkgroup/auth/AuthCredentialResponse.d.ts +0 -6
  35. package/dist/zkgroup/auth/AuthCredentialResponse.js +0 -15
  36. package/dist/zkgroup/groupsend/GroupSendCredential.d.ts +0 -30
  37. package/dist/zkgroup/groupsend/GroupSendCredential.js +0 -45
  38. package/dist/zkgroup/groupsend/GroupSendCredentialPresentation.d.ts +0 -24
  39. package/dist/zkgroup/groupsend/GroupSendCredentialPresentation.js +0 -34
  40. package/dist/zkgroup/groupsend/GroupSendCredentialResponse.d.ts +0 -67
  41. package/dist/zkgroup/groupsend/GroupSendCredentialResponse.js +0 -87
@@ -1,87 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2023 Signal Messenger, LLC.
4
- // SPDX-License-Identifier: AGPL-3.0-only
5
- //
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const crypto_1 = require("crypto");
8
- const ByteArray_1 = require("../internal/ByteArray");
9
- const Native = require("../../../Native");
10
- const Constants_1 = require("../internal/Constants");
11
- const GroupSendCredential_1 = require("./GroupSendCredential");
12
- const UuidCiphertext_1 = require("../groups/UuidCiphertext");
13
- const Address_1 = require("../../Address");
14
- /**
15
- * The issuance of a credential indicating membership in a group, based on the set of *other* users
16
- * in the group with you.
17
- *
18
- * Follows the usual zkgroup pattern of "issue response -> receive response -> present credential ->
19
- * verify presentation".
20
- *
21
- * @see {@link GroupSendCredential}
22
- * @see {@link GroupSendCredentialPresentation}
23
- */
24
- class GroupSendCredentialResponse extends ByteArray_1.default {
25
- constructor(contents) {
26
- super(contents, Native.GroupSendCredentialResponse_CheckValidContents);
27
- }
28
- static defaultExpiration() {
29
- const expirationInSeconds = Native.GroupSendCredentialResponse_DefaultExpirationBasedOnCurrentTime();
30
- return new Date(expirationInSeconds * 1000);
31
- }
32
- /**
33
- * Issues a new credential stating that `requestingMember` is a member of a group containing
34
- * `groupMembers`.
35
- *
36
- * `groupMembers` should include `requestingMember` as well.
37
- */
38
- static issueCredential(groupMembers, requestingMember, params) {
39
- const random = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
40
- return this.issueCredentialWithExpirationAndRandom(groupMembers, requestingMember, this.defaultExpiration(), params, random);
41
- }
42
- /**
43
- * Issues a new credential stating that `requestingMember` is a member of a group containing
44
- * `groupMembers`, with an explicity-chosen expiration and source of randomness.
45
- *
46
- * Should only be used for testing purposes.
47
- *
48
- * @see {@link GroupSendCredentialResponse#issueCredential}
49
- */
50
- static issueCredentialWithExpirationAndRandom(groupMembers, requestingMember, expiration, params, random) {
51
- return new GroupSendCredentialResponse(Native.GroupSendCredentialResponse_IssueDeterministic(UuidCiphertext_1.default.serializeAndConcatenate(groupMembers), requestingMember.contents, Math.floor(expiration.getTime() / 1000), params.contents, random));
52
- }
53
- /**
54
- * Receives, validates, and extracts the credential from a response.
55
- *
56
- * Note that the `receive` operation is provided for both {@link ServiceId}s and
57
- * {@link UuidCiphertext}s. If you already have the ciphertexts for the group members available,
58
- * {@link GroupSendCredentialResponse#receiveWithCiphertexts} will be *significantly* faster; if
59
- * you don't, this method is faster than generating the ciphertexts and throwing them away
60
- * afterwards.
61
- *
62
- * `localUser` should be included in `groupMembers`.
63
- *
64
- * @throws {VerificationFailedError} if the credential is not valid for any reason
65
- */
66
- receive(groupMembers, localUser, serverParams, groupParams, now = new Date()) {
67
- return new GroupSendCredential_1.default(Native.GroupSendCredentialResponse_Receive(this.contents, Address_1.ServiceId.toConcatenatedFixedWidthBinary(groupMembers), localUser.getServiceIdFixedWidthBinary(), Math.floor(now.getTime() / 1000), serverParams.contents, groupParams.contents));
68
- }
69
- /**
70
- * Receives, validates, and extracts the credential from a response.
71
- *
72
- * Note that the `receive` operation is provided for both {@link ServiceId}s and
73
- * {@link UuidCiphertext}s. If you already have the ciphertexts for the group members available,
74
- * this method will be *significantly* faster; if you don't,
75
- * {@link GroupSendCredentialResponse#receive} is faster than generating the ciphertexts and
76
- * throwing them away afterwards.
77
- *
78
- * `localUser` should be included in `groupMembers`.
79
- *
80
- * @throws {VerificationFailedError} if the credential is not valid for any reason
81
- */
82
- receiveWithCiphertexts(groupMembers, localUser, serverParams, groupParams, now = new Date()) {
83
- return new GroupSendCredential_1.default(Native.GroupSendCredentialResponse_ReceiveWithCiphertexts(this.contents, UuidCiphertext_1.default.serializeAndConcatenate(groupMembers), localUser.contents, Math.floor(now.getTime() / 1000), serverParams.contents, groupParams.contents));
84
- }
85
- }
86
- exports.default = GroupSendCredentialResponse;
87
- //# sourceMappingURL=GroupSendCredentialResponse.js.map