@signalapp/libsignal-client 0.81.0 → 0.82.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/Native.d.ts +34 -31
- package/Native.js +4 -1
- package/dist/AccountKeys.d.ts +3 -3
- package/dist/AccountKeys.js +8 -14
- package/dist/Address.d.ts +1 -1
- package/dist/Address.js +8 -15
- package/dist/EcKeys.d.ts +1 -1
- package/dist/EcKeys.js +4 -10
- package/dist/Errors.d.ts +2 -2
- package/dist/Errors.js +5 -9
- package/dist/MessageBackup.d.ts +4 -4
- package/dist/MessageBackup.js +10 -18
- package/dist/Minidump.js +2 -6
- package/dist/Mp4Sanitizer.d.ts +2 -2
- package/dist/Mp4Sanitizer.js +3 -8
- package/dist/SealedSenderMultiRecipientMessage.d.ts +1 -1
- package/dist/SealedSenderMultiRecipientMessage.js +2 -5
- package/dist/WebpSanitizer.js +2 -6
- package/dist/acknowledgments.md +254 -89
- package/dist/incremental_mac.d.ts +1 -1
- package/dist/incremental_mac.js +11 -19
- package/dist/index.d.ts +18 -18
- package/dist/index.js +93 -158
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +3 -8
- package/dist/io.d.ts +1 -1
- package/dist/io.js +1 -5
- package/dist/net/CDSI.d.ts +2 -2
- package/dist/net/CDSI.js +8 -12
- package/dist/net/Chat.d.ts +11 -12
- package/dist/net/Chat.js +15 -22
- package/dist/net/KeyTransparency.d.ts +10 -10
- package/dist/net/KeyTransparency.js +4 -8
- package/dist/net/Registration.d.ts +5 -5
- package/dist/net/Registration.js +16 -22
- package/dist/net/SvrB.d.ts +3 -3
- package/dist/net/SvrB.js +5 -9
- package/dist/net/chat/UnauthUsernamesService.d.ts +4 -4
- package/dist/net/chat/UnauthUsernamesService.js +5 -7
- package/dist/net.d.ts +11 -11
- package/dist/net.js +27 -46
- package/dist/usernames.js +12 -23
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -1
- package/dist/zkgroup/GenericServerPublicParams.js +3 -6
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -2
- package/dist/zkgroup/GenericServerSecretParams.js +8 -11
- package/dist/zkgroup/NotarySignature.d.ts +1 -1
- package/dist/zkgroup/NotarySignature.js +3 -5
- package/dist/zkgroup/ServerPublicParams.d.ts +2 -2
- package/dist/zkgroup/ServerPublicParams.js +2 -5
- package/dist/zkgroup/ServerSecretParams.d.ts +3 -3
- package/dist/zkgroup/ServerSecretParams.js +10 -13
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/auth/AuthCredentialPresentation.js +6 -9
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPni.js +3 -6
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.js +3 -6
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +6 -6
- package/dist/zkgroup/auth/ClientZkAuthOperations.js +9 -12
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +5 -5
- package/dist/zkgroup/auth/ServerZkAuthOperations.js +7 -10
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +5 -5
- package/dist/zkgroup/backups/BackupAuthCredential.js +12 -15
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +4 -4
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +7 -10
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +5 -5
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +8 -11
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +6 -6
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +8 -11
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +3 -6
- package/dist/zkgroup/backups/BackupCredentialType.js +1 -3
- package/dist/zkgroup/backups/BackupLevel.js +1 -3
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +5 -5
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.js +8 -11
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +4 -4
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.js +5 -8
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +5 -5
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.js +8 -11
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkPublicParams.js +3 -6
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +4 -4
- package/dist/zkgroup/calllinks/CallLinkSecretParams.js +9 -12
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +5 -5
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.js +8 -11
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.js +3 -6
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +4 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.js +8 -11
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +6 -6
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.js +10 -13
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.js +3 -6
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +5 -5
- package/dist/zkgroup/groups/ClientZkGroupCipher.js +13 -16
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -1
- package/dist/zkgroup/groups/GroupIdentifier.js +3 -5
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.js +3 -5
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +2 -2
- package/dist/zkgroup/groups/GroupPublicParams.js +5 -8
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +3 -3
- package/dist/zkgroup/groups/GroupSecretParams.js +10 -13
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/ProfileKeyCiphertext.js +3 -6
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/UuidCiphertext.js +3 -6
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.js +3 -6
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +5 -5
- package/dist/zkgroup/groupsend/GroupSendEndorsement.js +10 -13
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +7 -7
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.js +14 -17
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +3 -3
- package/dist/zkgroup/groupsend/GroupSendFullToken.js +5 -8
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendToken.js +5 -8
- package/dist/zkgroup/index.d.ts +57 -57
- package/dist/zkgroup/index.js +57 -118
- package/dist/zkgroup/internal/ByteArray.js +6 -10
- package/dist/zkgroup/internal/Constants.js +4 -7
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +8 -8
- package/dist/zkgroup/profiles/ClientZkProfileOperations.js +12 -15
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.js +3 -6
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.js +3 -6
- package/dist/zkgroup/profiles/ProfileKey.d.ts +4 -4
- package/dist/zkgroup/profiles/ProfileKey.js +8 -10
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCommitment.js +3 -6
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +3 -3
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.js +7 -10
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.js +3 -6
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +2 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.js +5 -8
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +3 -5
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +7 -7
- package/dist/zkgroup/profiles/ServerZkProfileOperations.js +7 -10
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +6 -6
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.js +12 -15
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredential.js +3 -6
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.js +6 -8
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.js +3 -6
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +2 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.js +6 -8
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.js +3 -6
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptSerial.js +3 -5
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +4 -4
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.js +7 -10
- package/package.json +24 -20
- package/prebuilds/darwin-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/darwin-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-x64/@signalapp+libsignal-client.node +0 -0
- package/zkgroup.js +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse';
|
|
3
|
-
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse.js';
|
|
3
|
+
import GenericServerSecretParams from '../GenericServerSecretParams.js';
|
|
4
|
+
import { Aci } from '../../Address.js';
|
|
5
5
|
export default class CreateCallLinkCredentialRequest extends ByteArray {
|
|
6
6
|
private readonly __type?;
|
|
7
7
|
constructor(contents: Uint8Array);
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class CreateCallLinkCredentialRequest extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
8
|
+
import Native from '../../../Native.js';
|
|
9
|
+
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse.js';
|
|
10
|
+
export default class CreateCallLinkCredentialRequest extends ByteArray {
|
|
13
11
|
constructor(contents) {
|
|
14
12
|
super(contents, Native.CreateCallLinkCredentialRequest_CheckValidContents);
|
|
15
13
|
}
|
|
16
14
|
issueCredential(userId, timestamp, params) {
|
|
17
|
-
const random =
|
|
15
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
18
16
|
return this.issueCredentialWithRandom(userId, timestamp, params, random);
|
|
19
17
|
}
|
|
20
18
|
issueCredentialWithRandom(userId, timestamp, params, random) {
|
|
21
|
-
return new
|
|
19
|
+
return new CreateCallLinkCredentialResponse(Native.CreateCallLinkCredentialRequest_IssueDeterministic(this.contents, userId.getServiceIdFixedWidthBinary(), timestamp, params.contents, random));
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
exports.default = CreateCallLinkCredentialRequest;
|
|
25
22
|
//# sourceMappingURL=CreateCallLinkCredentialRequest.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CreateCallLinkCredentialRequest from './CreateCallLinkCredentialRequest';
|
|
3
|
-
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse';
|
|
4
|
-
import CreateCallLinkCredential from './CreateCallLinkCredential';
|
|
5
|
-
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
6
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CreateCallLinkCredentialRequest from './CreateCallLinkCredentialRequest.js';
|
|
3
|
+
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse.js';
|
|
4
|
+
import CreateCallLinkCredential from './CreateCallLinkCredential.js';
|
|
5
|
+
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
6
|
+
import { Aci } from '../../Address.js';
|
|
7
7
|
export default class CreateCallLinkCredentialRequestContext extends ByteArray {
|
|
8
8
|
private readonly __type?;
|
|
9
9
|
constructor(contents: Uint8Array);
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class CreateCallLinkCredentialRequestContext extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
8
|
+
import Native from '../../../Native.js';
|
|
9
|
+
import CreateCallLinkCredentialRequest from './CreateCallLinkCredentialRequest.js';
|
|
10
|
+
import CreateCallLinkCredential from './CreateCallLinkCredential.js';
|
|
11
|
+
export default class CreateCallLinkCredentialRequestContext extends ByteArray {
|
|
14
12
|
constructor(contents) {
|
|
15
13
|
super(contents, Native.CreateCallLinkCredentialRequestContext_CheckValidContents);
|
|
16
14
|
}
|
|
17
15
|
static forRoomId(roomId) {
|
|
18
|
-
const random =
|
|
16
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
19
17
|
return this.forRoomIdWithRandom(roomId, random);
|
|
20
18
|
}
|
|
21
19
|
static forRoomIdWithRandom(roomId, random) {
|
|
22
20
|
return new CreateCallLinkCredentialRequestContext(Native.CreateCallLinkCredentialRequestContext_NewDeterministic(roomId, random));
|
|
23
21
|
}
|
|
24
22
|
getRequest() {
|
|
25
|
-
return new
|
|
23
|
+
return new CreateCallLinkCredentialRequest(Native.CreateCallLinkCredentialRequestContext_GetRequest(this.contents));
|
|
26
24
|
}
|
|
27
25
|
receive(response, userId, params) {
|
|
28
|
-
return new
|
|
26
|
+
return new CreateCallLinkCredential(Native.CreateCallLinkCredentialRequestContext_ReceiveResponse(this.contents, response.contents, userId.getServiceIdFixedWidthBinary(), params.contents));
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
|
-
exports.default = CreateCallLinkCredentialRequestContext;
|
|
32
29
|
//# sourceMappingURL=CreateCallLinkCredentialRequestContext.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class CreateCallLinkCredentialResponse extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class CreateCallLinkCredentialResponse extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.CreateCallLinkCredentialResponse_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = CreateCallLinkCredentialResponse;
|
|
15
12
|
//# sourceMappingURL=CreateCallLinkCredentialResponse.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import UuidCiphertext from './UuidCiphertext';
|
|
2
|
-
import ProfileKeyCiphertext from './ProfileKeyCiphertext';
|
|
3
|
-
import ProfileKey from '../profiles/ProfileKey';
|
|
4
|
-
import GroupSecretParams from './GroupSecretParams';
|
|
5
|
-
import { Aci, ServiceId } from '../../Address';
|
|
1
|
+
import UuidCiphertext from './UuidCiphertext.js';
|
|
2
|
+
import ProfileKeyCiphertext from './ProfileKeyCiphertext.js';
|
|
3
|
+
import ProfileKey from '../profiles/ProfileKey.js';
|
|
4
|
+
import GroupSecretParams from './GroupSecretParams.js';
|
|
5
|
+
import { Aci, ServiceId } from '../../Address.js';
|
|
6
6
|
export default class ClientZkGroupCipher {
|
|
7
7
|
groupSecretParams: GroupSecretParams;
|
|
8
8
|
constructor(groupSecretParams: GroupSecretParams);
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class ClientZkGroupCipher {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
7
|
+
import Native from '../../../Native.js';
|
|
8
|
+
import UuidCiphertext from './UuidCiphertext.js';
|
|
9
|
+
import ProfileKeyCiphertext from './ProfileKeyCiphertext.js';
|
|
10
|
+
import ProfileKey from '../profiles/ProfileKey.js';
|
|
11
|
+
import { ServiceId } from '../../Address.js';
|
|
12
|
+
export default class ClientZkGroupCipher {
|
|
15
13
|
constructor(groupSecretParams) {
|
|
16
14
|
this.groupSecretParams = groupSecretParams;
|
|
17
15
|
}
|
|
18
16
|
encryptServiceId(serviceId) {
|
|
19
|
-
return new
|
|
17
|
+
return new UuidCiphertext(Native.GroupSecretParams_EncryptServiceId(this.groupSecretParams.getContents(), serviceId.getServiceIdFixedWidthBinary()));
|
|
20
18
|
}
|
|
21
19
|
decryptServiceId(ciphertext) {
|
|
22
|
-
return
|
|
20
|
+
return ServiceId.parseFromServiceIdFixedWidthBinary(Native.GroupSecretParams_DecryptServiceId(this.groupSecretParams.getContents(), ciphertext.getContents()));
|
|
23
21
|
}
|
|
24
22
|
encryptProfileKey(profileKey, userId) {
|
|
25
|
-
return new
|
|
23
|
+
return new ProfileKeyCiphertext(Native.GroupSecretParams_EncryptProfileKey(this.groupSecretParams.getContents(), profileKey.getContents(), userId.getServiceIdFixedWidthBinary()));
|
|
26
24
|
}
|
|
27
25
|
decryptProfileKey(profileKeyCiphertext, userId) {
|
|
28
|
-
return new
|
|
26
|
+
return new ProfileKey(Native.GroupSecretParams_DecryptProfileKey(this.groupSecretParams.getContents(), profileKeyCiphertext.getContents(), userId.getServiceIdFixedWidthBinary()));
|
|
29
27
|
}
|
|
30
28
|
encryptBlob(plaintext) {
|
|
31
|
-
const random =
|
|
29
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
32
30
|
return this.encryptBlobWithRandom(random, plaintext);
|
|
33
31
|
}
|
|
34
32
|
encryptBlobWithRandom(random, plaintext) {
|
|
@@ -38,5 +36,4 @@ class ClientZkGroupCipher {
|
|
|
38
36
|
return Native.GroupSecretParams_DecryptBlobWithPadding(this.groupSecretParams.getContents(), blobCiphertext);
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
|
-
exports.default = ClientZkGroupCipher;
|
|
42
39
|
//# sourceMappingURL=ClientZkGroupCipher.js.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class GroupIdentifier extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
class GroupIdentifier extends ByteArray {
|
|
9
7
|
constructor(contents) {
|
|
10
8
|
super(contents, GroupIdentifier.checkLength(GroupIdentifier.SIZE));
|
|
11
9
|
}
|
|
@@ -15,5 +13,5 @@ class GroupIdentifier extends ByteArray_1.default {
|
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
GroupIdentifier.SIZE = 32;
|
|
18
|
-
|
|
16
|
+
export default GroupIdentifier;
|
|
19
17
|
//# sourceMappingURL=GroupIdentifier.js.map
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class GroupMasterKey extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
class GroupMasterKey extends ByteArray {
|
|
9
7
|
constructor(contents) {
|
|
10
8
|
super(contents, GroupMasterKey.checkLength(GroupMasterKey.SIZE));
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
GroupMasterKey.SIZE = 32;
|
|
14
|
-
|
|
12
|
+
export default GroupMasterKey;
|
|
15
13
|
//# sourceMappingURL=GroupMasterKey.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GroupIdentifier from './GroupIdentifier';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GroupIdentifier from './GroupIdentifier.js';
|
|
3
3
|
export default class GroupPublicParams extends ByteArray {
|
|
4
4
|
private readonly __type?;
|
|
5
5
|
constructor(contents: Uint8Array);
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class GroupPublicParams extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import GroupIdentifier from './GroupIdentifier.js';
|
|
8
|
+
export default class GroupPublicParams extends ByteArray {
|
|
11
9
|
constructor(contents) {
|
|
12
10
|
super(contents, Native.GroupPublicParams_CheckValidContents);
|
|
13
11
|
}
|
|
14
12
|
getGroupIdentifier() {
|
|
15
|
-
return new
|
|
13
|
+
return new GroupIdentifier(Native.GroupPublicParams_GetGroupIdentifier(this.contents));
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
exports.default = GroupPublicParams;
|
|
19
16
|
//# sourceMappingURL=GroupPublicParams.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GroupMasterKey from './GroupMasterKey';
|
|
3
|
-
import GroupPublicParams from './GroupPublicParams';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GroupMasterKey from './GroupMasterKey.js';
|
|
3
|
+
import GroupPublicParams from './GroupPublicParams.js';
|
|
4
4
|
export default class GroupSecretParams extends ByteArray {
|
|
5
5
|
private readonly __type?;
|
|
6
6
|
static generate(): GroupSecretParams;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class GroupSecretParams extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import Native from '../../../Native.js';
|
|
8
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
9
|
+
import GroupMasterKey from './GroupMasterKey.js';
|
|
10
|
+
import GroupPublicParams from './GroupPublicParams.js';
|
|
11
|
+
export default class GroupSecretParams extends ByteArray {
|
|
14
12
|
static generate() {
|
|
15
|
-
const random =
|
|
13
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
16
14
|
return GroupSecretParams.generateWithRandom(random);
|
|
17
15
|
}
|
|
18
16
|
static generateWithRandom(random) {
|
|
@@ -25,11 +23,10 @@ class GroupSecretParams extends ByteArray_1.default {
|
|
|
25
23
|
super(contents, Native.GroupSecretParams_CheckValidContents);
|
|
26
24
|
}
|
|
27
25
|
getMasterKey() {
|
|
28
|
-
return new
|
|
26
|
+
return new GroupMasterKey(Native.GroupSecretParams_GetMasterKey(this.contents));
|
|
29
27
|
}
|
|
30
28
|
getPublicParams() {
|
|
31
|
-
return new
|
|
29
|
+
return new GroupPublicParams(Native.GroupSecretParams_GetPublicParams(this.contents));
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
exports.default = GroupSecretParams;
|
|
35
32
|
//# sourceMappingURL=GroupSecretParams.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ProfileKeyCiphertext extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ProfileKeyCiphertext extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ProfileKeyCiphertext_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = ProfileKeyCiphertext;
|
|
15
12
|
//# sourceMappingURL=ProfileKeyCiphertext.js.map
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class UuidCiphertext extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class UuidCiphertext extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.UuidCiphertext_CheckValidContents);
|
|
12
10
|
}
|
|
@@ -27,5 +25,4 @@ class UuidCiphertext extends ByteArray_1.default {
|
|
|
27
25
|
return concatenated;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
exports.default = UuidCiphertext;
|
|
31
28
|
//# sourceMappingURL=UuidCiphertext.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import ServerSecretParams from '../ServerSecretParams';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import ServerSecretParams from '../ServerSecretParams.js';
|
|
3
3
|
/**
|
|
4
4
|
* The key pair used to issue and verify group send endorsements.
|
|
5
5
|
*
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Native = require("../../../Native");
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
9
7
|
/**
|
|
10
8
|
* The key pair used to issue and verify group send endorsements.
|
|
11
9
|
*
|
|
@@ -17,7 +15,7 @@ const Native = require("../../../Native");
|
|
|
17
15
|
* @see {@link GroupSendEndorsementsResponse.issue}
|
|
18
16
|
* @see {@link GroupSendFullToken#verify}
|
|
19
17
|
*/
|
|
20
|
-
class GroupSendDerivedKeyPair extends
|
|
18
|
+
export default class GroupSendDerivedKeyPair extends ByteArray {
|
|
21
19
|
constructor(contents) {
|
|
22
20
|
super(contents, Native.GroupSendDerivedKeyPair_CheckValidContents);
|
|
23
21
|
}
|
|
@@ -30,5 +28,4 @@ class GroupSendDerivedKeyPair extends ByteArray_1.default {
|
|
|
30
28
|
return new GroupSendDerivedKeyPair(Native.GroupSendDerivedKeyPair_ForExpiration(Math.floor(expiration.getTime() / 1000), params));
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
exports.default = GroupSendDerivedKeyPair;
|
|
34
31
|
//# sourceMappingURL=GroupSendDerivedKeyPair.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray';
|
|
2
|
-
import GroupSecretParams from '../groups/GroupSecretParams';
|
|
3
|
-
import GroupSendFullToken from './GroupSendFullToken';
|
|
4
|
-
import GroupSendToken from './GroupSendToken';
|
|
5
|
-
import CallLinkSecretParams from '../calllinks/CallLinkSecretParams';
|
|
1
|
+
import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray.js';
|
|
2
|
+
import GroupSecretParams from '../groups/GroupSecretParams.js';
|
|
3
|
+
import GroupSendFullToken from './GroupSendFullToken.js';
|
|
4
|
+
import GroupSendToken from './GroupSendToken.js';
|
|
5
|
+
import CallLinkSecretParams from '../calllinks/CallLinkSecretParams.js';
|
|
6
6
|
/**
|
|
7
7
|
* An endorsement for a user or set of users in a group.
|
|
8
8
|
*
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const CallLinkSecretParams_1 = require("../calllinks/CallLinkSecretParams");
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import GroupSecretParams from '../groups/GroupSecretParams.js';
|
|
8
|
+
import GroupSendToken from './GroupSendToken.js';
|
|
9
|
+
import CallLinkSecretParams from '../calllinks/CallLinkSecretParams.js';
|
|
12
10
|
/**
|
|
13
11
|
* An endorsement for a user or set of users in a group.
|
|
14
12
|
*
|
|
@@ -36,7 +34,7 @@ const CallLinkSecretParams_1 = require("../calllinks/CallLinkSecretParams");
|
|
|
36
34
|
* send. (Saving the repeated work of converting to a token is left to the clients here; worst case,
|
|
37
35
|
* it's still cheaper than a usual zkgroup presentation.)
|
|
38
36
|
*/
|
|
39
|
-
class GroupSendEndorsement extends
|
|
37
|
+
export default class GroupSendEndorsement extends ByteArray {
|
|
40
38
|
constructor(contents, marker) {
|
|
41
39
|
super(contents, marker ?? Native.GroupSendEndorsement_CheckValidContents);
|
|
42
40
|
}
|
|
@@ -68,11 +66,11 @@ class GroupSendEndorsement extends ByteArray_1.default {
|
|
|
68
66
|
* @see {@link GroupSendToken}
|
|
69
67
|
*/
|
|
70
68
|
toToken(params) {
|
|
71
|
-
if (params instanceof
|
|
72
|
-
return new
|
|
69
|
+
if (params instanceof GroupSecretParams) {
|
|
70
|
+
return new GroupSendToken(Native.GroupSendEndorsement_ToToken(this.contents, params.contents));
|
|
73
71
|
}
|
|
74
|
-
else if (params instanceof
|
|
75
|
-
return new
|
|
72
|
+
else if (params instanceof CallLinkSecretParams) {
|
|
73
|
+
return new GroupSendToken(Native.GroupSendEndorsement_CallLinkParams_ToToken(this.contents, params.contents));
|
|
76
74
|
}
|
|
77
75
|
throw new Error('Unsupported token type');
|
|
78
76
|
}
|
|
@@ -88,5 +86,4 @@ class GroupSendEndorsement extends ByteArray_1.default {
|
|
|
88
86
|
return this.toToken(params).toFullToken(expiration);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
exports.default = GroupSendEndorsement;
|
|
92
89
|
//# sourceMappingURL=GroupSendEndorsement.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GroupSecretParams from '../groups/GroupSecretParams';
|
|
3
|
-
import ServerPublicParams from '../ServerPublicParams';
|
|
4
|
-
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
5
|
-
import { Aci, ServiceId } from '../../Address';
|
|
6
|
-
import GroupSendDerivedKeyPair from './GroupSendDerivedKeyPair';
|
|
7
|
-
import GroupSendEndorsement from './GroupSendEndorsement';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GroupSecretParams from '../groups/GroupSecretParams.js';
|
|
3
|
+
import ServerPublicParams from '../ServerPublicParams.js';
|
|
4
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
5
|
+
import { Aci, ServiceId } from '../../Address.js';
|
|
6
|
+
import GroupSendDerivedKeyPair from './GroupSendDerivedKeyPair.js';
|
|
7
|
+
import GroupSendEndorsement from './GroupSendEndorsement.js';
|
|
8
8
|
/**
|
|
9
9
|
* A collection of endorsements known to be valid.
|
|
10
10
|
*
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const GroupSendEndorsement_1 = require("./GroupSendEndorsement");
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray.js';
|
|
7
|
+
import Native from '../../../Native.js';
|
|
8
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
9
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
10
|
+
import { ServiceId } from '../../Address.js';
|
|
11
|
+
import GroupSendEndorsement from './GroupSendEndorsement.js';
|
|
14
12
|
/**
|
|
15
13
|
* A set of endorsements of the members in a group, along with a proof of their validity.
|
|
16
14
|
*
|
|
@@ -19,7 +17,7 @@ const GroupSendEndorsement_1 = require("./GroupSendEndorsement");
|
|
|
19
17
|
* {@link GroupSendEndorsement} for a full description of the endorsement flow from the client's
|
|
20
18
|
* perspective.
|
|
21
19
|
*/
|
|
22
|
-
class GroupSendEndorsementsResponse extends
|
|
20
|
+
export default class GroupSendEndorsementsResponse extends ByteArray {
|
|
23
21
|
constructor(contents) {
|
|
24
22
|
super(contents, Native.GroupSendEndorsementsResponse_CheckValidContents);
|
|
25
23
|
}
|
|
@@ -29,7 +27,7 @@ class GroupSendEndorsementsResponse extends ByteArray_1.default {
|
|
|
29
27
|
* `groupMembers` should include `requestingUser` as well.
|
|
30
28
|
*/
|
|
31
29
|
static issue(groupMembers, keyPair) {
|
|
32
|
-
const random =
|
|
30
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
33
31
|
return this.issueWithRandom(groupMembers, keyPair, random);
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
@@ -41,7 +39,7 @@ class GroupSendEndorsementsResponse extends ByteArray_1.default {
|
|
|
41
39
|
* @see {@link GroupSendEndorsementsResponse#issue}
|
|
42
40
|
*/
|
|
43
41
|
static issueWithRandom(groupMembers, keyPair, random) {
|
|
44
|
-
return new GroupSendEndorsementsResponse(Native.GroupSendEndorsementsResponse_IssueDeterministic(
|
|
42
|
+
return new GroupSendEndorsementsResponse(Native.GroupSendEndorsementsResponse_IssueDeterministic(UuidCiphertext.serializeAndConcatenate(groupMembers), keyPair.contents, random));
|
|
45
43
|
}
|
|
46
44
|
/** Returns the expiration for the contained endorsements. */
|
|
47
45
|
getExpiration() {
|
|
@@ -60,11 +58,11 @@ class GroupSendEndorsementsResponse extends ByteArray_1.default {
|
|
|
60
58
|
* @throws {VerificationFailedError} if the endorsements are not valid for any reason
|
|
61
59
|
*/
|
|
62
60
|
receiveWithServiceIds(groupMembers, localUser, groupParams, serverParams, now = new Date()) {
|
|
63
|
-
const endorsementContents = Native.GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds(this.contents,
|
|
61
|
+
const endorsementContents = Native.GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds(this.contents, ServiceId.toConcatenatedFixedWidthBinary(groupMembers), localUser.getServiceIdFixedWidthBinary(), Math.floor(now.getTime() / 1000), groupParams.contents, serverParams);
|
|
64
62
|
const endorsements = endorsementContents.map((next) => {
|
|
65
63
|
// Normally we don't notice the cost of validating just-created zkgroup objects,
|
|
66
64
|
// but in this case we may have up to 1000 of these. Let's assume they're created correctly.
|
|
67
|
-
return new
|
|
65
|
+
return new GroupSendEndorsement(next, UNCHECKED_AND_UNCLONED);
|
|
68
66
|
});
|
|
69
67
|
const combinedEndorsement = endorsements.pop();
|
|
70
68
|
if (!combinedEndorsement) {
|
|
@@ -85,11 +83,11 @@ class GroupSendEndorsementsResponse extends ByteArray_1.default {
|
|
|
85
83
|
* @throws {VerificationFailedError} if the endorsements are not valid for any reason
|
|
86
84
|
*/
|
|
87
85
|
receiveWithCiphertexts(groupMembers, localUser, serverParams, now = new Date()) {
|
|
88
|
-
const endorsementContents = Native.GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts(this.contents,
|
|
86
|
+
const endorsementContents = Native.GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts(this.contents, UuidCiphertext.serializeAndConcatenate(groupMembers), localUser.contents, Math.floor(now.getTime() / 1000), serverParams);
|
|
89
87
|
const endorsements = endorsementContents.map((next) => {
|
|
90
88
|
// Normally we don't notice the cost of validating just-created zkgroup objects,
|
|
91
89
|
// but in this case we may have up to 1000 of these. Let's assume they're created correctly.
|
|
92
|
-
return new
|
|
90
|
+
return new GroupSendEndorsement(next, UNCHECKED_AND_UNCLONED);
|
|
93
91
|
});
|
|
94
92
|
const combinedEndorsement = endorsements.pop();
|
|
95
93
|
if (!combinedEndorsement) {
|
|
@@ -98,5 +96,4 @@ class GroupSendEndorsementsResponse extends ByteArray_1.default {
|
|
|
98
96
|
return { endorsements, combinedEndorsement };
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
|
-
exports.default = GroupSendEndorsementsResponse;
|
|
102
99
|
//# sourceMappingURL=GroupSendEndorsementsResponse.js.map
|