@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,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2022 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ExpiringProfileKeyCredentialResponse extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ExpiringProfileKeyCredentialResponse extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ExpiringProfileKeyCredentialResponse_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = ExpiringProfileKeyCredentialResponse;
|
|
15
12
|
//# sourceMappingURL=ExpiringProfileKeyCredentialResponse.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import ProfileKeyCommitment from './ProfileKeyCommitment';
|
|
3
|
-
import ProfileKeyVersion from './ProfileKeyVersion';
|
|
4
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import ProfileKeyCommitment from './ProfileKeyCommitment.js';
|
|
3
|
+
import ProfileKeyVersion from './ProfileKeyVersion.js';
|
|
4
|
+
import { Aci } from '../../Address.js';
|
|
5
5
|
export default class ProfileKey extends ByteArray {
|
|
6
6
|
private readonly __type?;
|
|
7
7
|
static SIZE: number;
|
|
@@ -1,27 +1,25 @@
|
|
|
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
|
-
class ProfileKey extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import ProfileKeyCommitment from './ProfileKeyCommitment.js';
|
|
8
|
+
import ProfileKeyVersion from './ProfileKeyVersion.js';
|
|
9
|
+
class ProfileKey extends ByteArray {
|
|
12
10
|
constructor(contents) {
|
|
13
11
|
super(contents, ProfileKey.checkLength(ProfileKey.SIZE));
|
|
14
12
|
}
|
|
15
13
|
getCommitment(userId) {
|
|
16
|
-
return new
|
|
14
|
+
return new ProfileKeyCommitment(Native.ProfileKey_GetCommitment(this.contents, userId.getServiceIdFixedWidthBinary()));
|
|
17
15
|
}
|
|
18
16
|
getProfileKeyVersion(userId) {
|
|
19
|
-
return new
|
|
17
|
+
return new ProfileKeyVersion(Native.ProfileKey_GetProfileKeyVersion(this.contents, userId.getServiceIdFixedWidthBinary()));
|
|
20
18
|
}
|
|
21
19
|
deriveAccessKey() {
|
|
22
20
|
return Native.ProfileKey_DeriveAccessKey(this.contents);
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
ProfileKey.SIZE = 32;
|
|
26
|
-
|
|
24
|
+
export default ProfileKey;
|
|
27
25
|
//# sourceMappingURL=ProfileKey.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 ProfileKeyCommitment extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ProfileKeyCommitment extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ProfileKeyCommitment_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = ProfileKeyCommitment;
|
|
15
12
|
//# sourceMappingURL=ProfileKeyCommitment.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
3
|
-
import ProfileKeyCiphertext from '../groups/ProfileKeyCiphertext';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
3
|
+
import ProfileKeyCiphertext from '../groups/ProfileKeyCiphertext.js';
|
|
4
4
|
export default class ProfileKeyCredentialPresentation extends ByteArray {
|
|
5
5
|
private readonly __type?;
|
|
6
6
|
constructor(contents: Uint8Array);
|
|
@@ -1,23 +1,20 @@
|
|
|
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
|
-
class ProfileKeyCredentialPresentation extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
8
|
+
import ProfileKeyCiphertext from '../groups/ProfileKeyCiphertext.js';
|
|
9
|
+
export default class ProfileKeyCredentialPresentation extends ByteArray {
|
|
12
10
|
constructor(contents) {
|
|
13
11
|
super(contents, Native.ProfileKeyCredentialPresentation_CheckValidContents);
|
|
14
12
|
}
|
|
15
13
|
getUuidCiphertext() {
|
|
16
|
-
return new
|
|
14
|
+
return new UuidCiphertext(Native.ProfileKeyCredentialPresentation_GetUuidCiphertext(this.contents));
|
|
17
15
|
}
|
|
18
16
|
getProfileKeyCiphertext() {
|
|
19
|
-
return new
|
|
17
|
+
return new ProfileKeyCiphertext(Native.ProfileKeyCredentialPresentation_GetProfileKeyCiphertext(this.contents));
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
exports.default = ProfileKeyCredentialPresentation;
|
|
23
20
|
//# sourceMappingURL=ProfileKeyCredentialPresentation.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 ProfileKeyCredentialRequest extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ProfileKeyCredentialRequest extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ProfileKeyCredentialRequest_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = ProfileKeyCredentialRequest;
|
|
15
12
|
//# sourceMappingURL=ProfileKeyCredentialRequest.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest.js';
|
|
3
3
|
export default class ProfileKeyCredentialRequestContext 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 ProfileKeyCredentialRequestContext extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest.js';
|
|
8
|
+
export default class ProfileKeyCredentialRequestContext extends ByteArray {
|
|
11
9
|
constructor(contents) {
|
|
12
10
|
super(contents, Native.ProfileKeyCredentialRequestContext_CheckValidContents);
|
|
13
11
|
}
|
|
14
12
|
getRequest() {
|
|
15
|
-
return new
|
|
13
|
+
return new ProfileKeyCredentialRequest(Native.ProfileKeyCredentialRequestContext_GetRequest(this.contents));
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
exports.default = ProfileKeyCredentialRequestContext;
|
|
19
16
|
//# sourceMappingURL=ProfileKeyCredentialRequestContext.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 ProfileKeyVersion extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
class ProfileKeyVersion extends ByteArray {
|
|
9
7
|
constructor(contents) {
|
|
10
8
|
super(typeof contents === 'string'
|
|
11
9
|
? new TextEncoder().encode(contents)
|
|
@@ -16,5 +14,5 @@ class ProfileKeyVersion extends ByteArray_1.default {
|
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
ProfileKeyVersion.SIZE = 64;
|
|
19
|
-
|
|
17
|
+
export default ProfileKeyVersion;
|
|
20
18
|
//# sourceMappingURL=ProfileKeyVersion.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import ServerSecretParams from '../ServerSecretParams';
|
|
2
|
-
import GroupPublicParams from '../groups/GroupPublicParams';
|
|
3
|
-
import ExpiringProfileKeyCredentialResponse from './ExpiringProfileKeyCredentialResponse';
|
|
4
|
-
import ProfileKeyCommitment from './ProfileKeyCommitment';
|
|
5
|
-
import ProfileKeyCredentialPresentation from './ProfileKeyCredentialPresentation';
|
|
6
|
-
import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest';
|
|
7
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ServerSecretParams from '../ServerSecretParams.js';
|
|
2
|
+
import GroupPublicParams from '../groups/GroupPublicParams.js';
|
|
3
|
+
import ExpiringProfileKeyCredentialResponse from './ExpiringProfileKeyCredentialResponse.js';
|
|
4
|
+
import ProfileKeyCommitment from './ProfileKeyCommitment.js';
|
|
5
|
+
import ProfileKeyCredentialPresentation from './ProfileKeyCredentialPresentation.js';
|
|
6
|
+
import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest.js';
|
|
7
|
+
import { Aci } from '../../Address.js';
|
|
8
8
|
export default class ServerZkProfileOperations {
|
|
9
9
|
serverSecretParams: ServerSecretParams;
|
|
10
10
|
constructor(serverSecretParams: ServerSecretParams);
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2022 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class ServerZkProfileOperations {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
8
|
+
import ExpiringProfileKeyCredentialResponse from './ExpiringProfileKeyCredentialResponse.js';
|
|
9
|
+
export default class ServerZkProfileOperations {
|
|
12
10
|
constructor(serverSecretParams) {
|
|
13
11
|
this.serverSecretParams = serverSecretParams;
|
|
14
12
|
}
|
|
15
13
|
issueExpiringProfileKeyCredential(profileKeyCredentialRequest, userId, profileKeyCommitment, expirationInSeconds) {
|
|
16
|
-
const random =
|
|
14
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
17
15
|
return this.issueExpiringProfileKeyCredentialWithRandom(random, profileKeyCredentialRequest, userId, profileKeyCommitment, expirationInSeconds);
|
|
18
16
|
}
|
|
19
17
|
issueExpiringProfileKeyCredentialWithRandom(random, profileKeyCredentialRequest, userId, profileKeyCommitment, expirationInSeconds) {
|
|
20
|
-
return new
|
|
18
|
+
return new ExpiringProfileKeyCredentialResponse(Native.ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic(this.serverSecretParams, random, profileKeyCredentialRequest.getContents(), userId.getServiceIdFixedWidthBinary(), profileKeyCommitment.getContents(), expirationInSeconds));
|
|
21
19
|
}
|
|
22
20
|
verifyProfileKeyCredentialPresentation(groupPublicParams, profileKeyCredentialPresentation, now = new Date()) {
|
|
23
21
|
Native.ServerSecretParams_VerifyProfileKeyCredentialPresentation(this.serverSecretParams, groupPublicParams.getContents(), profileKeyCredentialPresentation.getContents(), Math.floor(now.getTime() / 1000));
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
exports.default = ServerZkProfileOperations;
|
|
27
24
|
//# sourceMappingURL=ServerZkProfileOperations.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ServerPublicParams from '../ServerPublicParams';
|
|
2
|
-
import ReceiptCredential from './ReceiptCredential';
|
|
3
|
-
import ReceiptCredentialPresentation from './ReceiptCredentialPresentation';
|
|
4
|
-
import ReceiptCredentialRequestContext from './ReceiptCredentialRequestContext';
|
|
5
|
-
import ReceiptCredentialResponse from './ReceiptCredentialResponse';
|
|
6
|
-
import ReceiptSerial from './ReceiptSerial';
|
|
1
|
+
import ServerPublicParams from '../ServerPublicParams.js';
|
|
2
|
+
import ReceiptCredential from './ReceiptCredential.js';
|
|
3
|
+
import ReceiptCredentialPresentation from './ReceiptCredentialPresentation.js';
|
|
4
|
+
import ReceiptCredentialRequestContext from './ReceiptCredentialRequestContext.js';
|
|
5
|
+
import ReceiptCredentialResponse from './ReceiptCredentialResponse.js';
|
|
6
|
+
import ReceiptSerial from './ReceiptSerial.js';
|
|
7
7
|
export default class ClientZkReceiptOperations {
|
|
8
8
|
serverPublicParams: ServerPublicParams;
|
|
9
9
|
constructor(serverPublicParams: ServerPublicParams);
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class ClientZkReceiptOperations {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
7
|
+
import Native from '../../../Native.js';
|
|
8
|
+
import ReceiptCredential from './ReceiptCredential.js';
|
|
9
|
+
import ReceiptCredentialPresentation from './ReceiptCredentialPresentation.js';
|
|
10
|
+
import ReceiptCredentialRequestContext from './ReceiptCredentialRequestContext.js';
|
|
11
|
+
export default class ClientZkReceiptOperations {
|
|
14
12
|
constructor(serverPublicParams) {
|
|
15
13
|
this.serverPublicParams = serverPublicParams;
|
|
16
14
|
}
|
|
17
15
|
createReceiptCredentialRequestContext(receiptSerial) {
|
|
18
|
-
const random =
|
|
16
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
19
17
|
return this.createReceiptCredentialRequestContextWithRandom(random, receiptSerial);
|
|
20
18
|
}
|
|
21
19
|
createReceiptCredentialRequestContextWithRandom(random, receiptSerial) {
|
|
22
|
-
return new
|
|
20
|
+
return new ReceiptCredentialRequestContext(Native.ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic(this.serverPublicParams, random, receiptSerial.getContents()));
|
|
23
21
|
}
|
|
24
22
|
receiveReceiptCredential(receiptCredentialRequestContext, receiptCredentialResponse) {
|
|
25
|
-
return new
|
|
23
|
+
return new ReceiptCredential(Native.ServerPublicParams_ReceiveReceiptCredential(this.serverPublicParams, receiptCredentialRequestContext.getContents(), receiptCredentialResponse.getContents()));
|
|
26
24
|
}
|
|
27
25
|
createReceiptCredentialPresentation(receiptCredential) {
|
|
28
|
-
const random =
|
|
26
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
29
27
|
return this.createReceiptCredentialPresentationWithRandom(random, receiptCredential);
|
|
30
28
|
}
|
|
31
29
|
createReceiptCredentialPresentationWithRandom(random, receiptCredential) {
|
|
32
|
-
return new
|
|
30
|
+
return new ReceiptCredentialPresentation(Native.ServerPublicParams_CreateReceiptCredentialPresentationDeterministic(this.serverPublicParams, random, receiptCredential.getContents()));
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
|
-
exports.default = ClientZkReceiptOperations;
|
|
36
33
|
//# sourceMappingURL=ClientZkReceiptOperations.js.map
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ReceiptCredential extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ReceiptCredential extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ReceiptCredential_CheckValidContents);
|
|
12
10
|
}
|
|
@@ -17,5 +15,4 @@ class ReceiptCredential extends ByteArray_1.default {
|
|
|
17
15
|
return Native.ReceiptCredential_GetReceiptLevel(this.contents);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
exports.default = ReceiptCredential;
|
|
21
18
|
//# sourceMappingURL=ReceiptCredential.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import ReceiptSerial from './ReceiptSerial';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import ReceiptSerial from './ReceiptSerial.js';
|
|
3
3
|
export default class ReceiptCredentialPresentation extends ByteArray {
|
|
4
4
|
private readonly __type?;
|
|
5
5
|
static SIZE: number;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class ReceiptCredentialPresentation extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import ReceiptSerial from './ReceiptSerial.js';
|
|
8
|
+
class ReceiptCredentialPresentation extends ByteArray {
|
|
11
9
|
constructor(contents) {
|
|
12
10
|
super(contents, Native.ReceiptCredentialPresentation_CheckValidContents);
|
|
13
11
|
}
|
|
@@ -18,9 +16,9 @@ class ReceiptCredentialPresentation extends ByteArray_1.default {
|
|
|
18
16
|
return Native.ReceiptCredentialPresentation_GetReceiptLevel(this.contents);
|
|
19
17
|
}
|
|
20
18
|
getReceiptSerialBytes() {
|
|
21
|
-
return new
|
|
19
|
+
return new ReceiptSerial(Native.ReceiptCredentialPresentation_GetReceiptSerial(this.contents));
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
ReceiptCredentialPresentation.SIZE = 329;
|
|
25
|
-
|
|
23
|
+
export default ReceiptCredentialPresentation;
|
|
26
24
|
//# sourceMappingURL=ReceiptCredentialPresentation.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ReceiptCredentialRequest extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ReceiptCredentialRequest extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ReceiptCredentialRequest_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = ReceiptCredentialRequest;
|
|
15
12
|
//# sourceMappingURL=ReceiptCredentialRequest.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import ReceiptCredentialRequest from './ReceiptCredentialRequest';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import ReceiptCredentialRequest from './ReceiptCredentialRequest.js';
|
|
3
3
|
export default class ReceiptCredentialRequestContext extends ByteArray {
|
|
4
4
|
private readonly __type?;
|
|
5
5
|
static SIZE: number;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class ReceiptCredentialRequestContext extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import ReceiptCredentialRequest from './ReceiptCredentialRequest.js';
|
|
8
|
+
class ReceiptCredentialRequestContext extends ByteArray {
|
|
11
9
|
constructor(contents) {
|
|
12
10
|
super(contents, Native.ReceiptCredentialRequestContext_CheckValidContents);
|
|
13
11
|
}
|
|
14
12
|
getRequest() {
|
|
15
|
-
return new
|
|
13
|
+
return new ReceiptCredentialRequest(Native.ReceiptCredentialRequestContext_GetRequest(this.contents));
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
ReceiptCredentialRequestContext.SIZE = 177;
|
|
19
|
-
|
|
17
|
+
export default ReceiptCredentialRequestContext;
|
|
20
18
|
//# sourceMappingURL=ReceiptCredentialRequestContext.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ReceiptCredentialResponse extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class ReceiptCredentialResponse extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.ReceiptCredentialResponse_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = ReceiptCredentialResponse;
|
|
15
12
|
//# sourceMappingURL=ReceiptCredentialResponse.js.map
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ReceiptSerial extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
class ReceiptSerial extends ByteArray {
|
|
9
7
|
constructor(contents) {
|
|
10
8
|
super(contents, ReceiptSerial.checkLength(ReceiptSerial.SIZE));
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
ReceiptSerial.SIZE = 16;
|
|
14
|
-
|
|
12
|
+
export default ReceiptSerial;
|
|
15
13
|
//# sourceMappingURL=ReceiptSerial.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ServerSecretParams from '../ServerSecretParams';
|
|
2
|
-
import ReceiptCredentialRequest from './ReceiptCredentialRequest';
|
|
3
|
-
import ReceiptCredentialResponse from './ReceiptCredentialResponse';
|
|
4
|
-
import ReceiptCredentialPresentation from './ReceiptCredentialPresentation';
|
|
1
|
+
import ServerSecretParams from '../ServerSecretParams.js';
|
|
2
|
+
import ReceiptCredentialRequest from './ReceiptCredentialRequest.js';
|
|
3
|
+
import ReceiptCredentialResponse from './ReceiptCredentialResponse.js';
|
|
4
|
+
import ReceiptCredentialPresentation from './ReceiptCredentialPresentation.js';
|
|
5
5
|
export default class ServerZkReceiptOperations {
|
|
6
6
|
serverSecretParams: ServerSecretParams;
|
|
7
7
|
constructor(serverSecretParams: ServerSecretParams);
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class ServerZkReceiptOperations {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
8
|
+
import ReceiptCredentialResponse from './ReceiptCredentialResponse.js';
|
|
9
|
+
export default class ServerZkReceiptOperations {
|
|
12
10
|
constructor(serverSecretParams) {
|
|
13
11
|
this.serverSecretParams = serverSecretParams;
|
|
14
12
|
}
|
|
15
13
|
issueReceiptCredential(receiptCredentialRequest, receiptExpirationTime, receiptLevel) {
|
|
16
|
-
const random =
|
|
14
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
17
15
|
return this.issueReceiptCredentialWithRandom(random, receiptCredentialRequest, receiptExpirationTime, receiptLevel);
|
|
18
16
|
}
|
|
19
17
|
issueReceiptCredentialWithRandom(random, receiptCredentialRequest, receiptExpirationTime, receiptLevel) {
|
|
20
|
-
return new
|
|
18
|
+
return new ReceiptCredentialResponse(Native.ServerSecretParams_IssueReceiptCredentialDeterministic(this.serverSecretParams, random, receiptCredentialRequest.getContents(), receiptExpirationTime, receiptLevel));
|
|
21
19
|
}
|
|
22
20
|
verifyReceiptCredentialPresentation(receiptCredentialPresentation) {
|
|
23
21
|
Native.ServerSecretParams_VerifyReceiptCredentialPresentation(this.serverSecretParams, receiptCredentialPresentation.getContents());
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
exports.default = ServerZkReceiptOperations;
|
|
27
24
|
//# sourceMappingURL=ServerZkReceiptOperations.js.map
|