@signalapp/libsignal-client 0.74.1 → 0.75.1
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 +281 -281
- package/dist/AccountKeys.d.ts +7 -8
- package/dist/Address.d.ts +12 -9
- package/dist/Address.js +10 -6
- package/dist/EcKeys.d.ts +12 -13
- package/dist/Errors.d.ts +43 -37
- package/dist/Errors.js +37 -36
- package/dist/MessageBackup.d.ts +6 -7
- package/dist/Minidump.d.ts +1 -2
- package/dist/Mp4Sanitizer.d.ts +1 -2
- package/dist/SealedSenderMultiRecipientMessage.d.ts +3 -4
- package/dist/SealedSenderMultiRecipientMessage.js +4 -2
- package/dist/WebpSanitizer.d.ts +1 -2
- package/dist/acknowledgments.md +24 -631
- package/dist/incremental_mac.d.ts +5 -5
- package/dist/incremental_mac.js +3 -1
- package/dist/index.d.ts +90 -91
- package/dist/index.js +4 -4
- package/dist/io.d.ts +3 -5
- package/dist/net/Chat.d.ts +1 -3
- package/dist/net/Chat.js +1 -3
- package/dist/net/KeyTransparency.d.ts +6 -7
- package/dist/net/Registration.d.ts +2 -3
- package/dist/net/Registration.js +1 -1
- package/dist/net.d.ts +1 -3
- package/dist/usernames.d.ts +8 -9
- package/dist/usernames.js +2 -2
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -2
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -3
- package/dist/zkgroup/NotarySignature.d.ts +1 -2
- package/dist/zkgroup/ServerPublicParams.d.ts +4 -5
- package/dist/zkgroup/ServerPublicParams.js +1 -1
- package/dist/zkgroup/ServerSecretParams.d.ts +5 -6
- package/dist/zkgroup/ServerSecretParams.js +1 -1
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -2
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -2
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +1 -2
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +1 -2
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +3 -4
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +2 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +2 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +2 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +2 -3
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +2 -3
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -2
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +2 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +3 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +2 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +2 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +3 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +3 -4
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -2
- package/dist/zkgroup/groups/GroupIdentifier.js +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -2
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +1 -2
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +2 -3
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -2
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +2 -3
- package/dist/zkgroup/groups/UuidCiphertext.js +2 -2
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +1 -2
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +1 -2
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +2 -3
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +1 -2
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +1 -2
- package/dist/zkgroup/internal/ByteArray.d.ts +5 -6
- package/dist/zkgroup/internal/ByteArray.js +2 -2
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +2 -3
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -2
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKey.d.ts +2 -3
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +4 -2
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +1 -2
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +2 -3
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -2
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +1 -2
- package/package.json +2 -2
- 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/dist/usernames.js
CHANGED
|
@@ -39,8 +39,8 @@ function decryptUsernameLink(usernameLink) {
|
|
|
39
39
|
exports.decryptUsernameLink = decryptUsernameLink;
|
|
40
40
|
function createUsernameLink(username, previousEntropy) {
|
|
41
41
|
const usernameLinkData = Native.UsernameLink_Create(username, previousEntropy ?? null);
|
|
42
|
-
const entropy = usernameLinkData.
|
|
43
|
-
const encryptedUsername = usernameLinkData.
|
|
42
|
+
const entropy = usernameLinkData.subarray(0, 32);
|
|
43
|
+
const encryptedUsername = usernameLinkData.subarray(32);
|
|
44
44
|
return { entropy, encryptedUsername };
|
|
45
45
|
}
|
|
46
46
|
exports.createUsernameLink = createUsernameLink;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from './internal/ByteArray';
|
|
3
2
|
import GenericServerPublicParams from './GenericServerPublicParams';
|
|
4
3
|
export default class GenericServerSecretParams extends ByteArray {
|
|
5
4
|
private readonly __type?;
|
|
6
5
|
static generate(): GenericServerSecretParams;
|
|
7
|
-
static generateWithRandom(random:
|
|
8
|
-
constructor(contents:
|
|
6
|
+
static generateWithRandom(random: Uint8Array): GenericServerSecretParams;
|
|
7
|
+
constructor(contents: Uint8Array);
|
|
9
8
|
getPublicParams(): GenericServerPublicParams;
|
|
10
9
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../../Native';
|
|
3
2
|
import NotarySignature from './NotarySignature';
|
|
4
3
|
export default class ServerPublicParams {
|
|
5
4
|
readonly _nativeHandle: Native.ServerPublicParams;
|
|
6
|
-
constructor(contents:
|
|
5
|
+
constructor(contents: Uint8Array | Native.ServerPublicParams);
|
|
7
6
|
/**
|
|
8
7
|
* Get the serialized form of the params' endorsement key.
|
|
9
8
|
*
|
|
10
9
|
* Allows decoupling RingRTC's use of endorsements from libsignal's.
|
|
11
10
|
*/
|
|
12
|
-
getEndorsementPublicKey():
|
|
13
|
-
verifySignature(message:
|
|
14
|
-
serialize():
|
|
11
|
+
getEndorsementPublicKey(): Uint8Array;
|
|
12
|
+
verifySignature(message: Uint8Array, notarySignature: NotarySignature): void;
|
|
13
|
+
serialize(): Uint8Array;
|
|
15
14
|
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const Native = require("../../Native");
|
|
8
8
|
class ServerPublicParams {
|
|
9
9
|
constructor(contents) {
|
|
10
|
-
if (contents instanceof
|
|
10
|
+
if (contents instanceof Uint8Array) {
|
|
11
11
|
this._nativeHandle = Native.ServerPublicParams_Deserialize(contents);
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../../Native';
|
|
3
2
|
import ServerPublicParams from './ServerPublicParams';
|
|
4
3
|
import NotarySignature from './NotarySignature';
|
|
5
4
|
export default class ServerSecretParams {
|
|
6
5
|
static generate(): ServerSecretParams;
|
|
7
|
-
static generateWithRandom(random:
|
|
6
|
+
static generateWithRandom(random: Uint8Array): ServerSecretParams;
|
|
8
7
|
readonly _nativeHandle: Native.ServerSecretParams;
|
|
9
|
-
constructor(contents:
|
|
8
|
+
constructor(contents: Uint8Array | Native.ServerSecretParams);
|
|
10
9
|
getPublicParams(): ServerPublicParams;
|
|
11
|
-
sign(message:
|
|
12
|
-
signWithRandom(random:
|
|
13
|
-
serialize():
|
|
10
|
+
sign(message: Uint8Array): NotarySignature;
|
|
11
|
+
signWithRandom(random: Uint8Array, message: Uint8Array): NotarySignature;
|
|
12
|
+
serialize(): Uint8Array;
|
|
14
13
|
}
|
|
@@ -18,7 +18,7 @@ class ServerSecretParams {
|
|
|
18
18
|
return new ServerSecretParams(Native.ServerSecretParams_GenerateDeterministic(random));
|
|
19
19
|
}
|
|
20
20
|
constructor(contents) {
|
|
21
|
-
if (contents instanceof
|
|
21
|
+
if (contents instanceof Uint8Array) {
|
|
22
22
|
this._nativeHandle = Native.ServerSecretParams_Deserialize(contents);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
4
3
|
export default class AuthCredentialPresentation extends ByteArray {
|
|
5
4
|
private readonly __type?;
|
|
6
|
-
constructor(contents:
|
|
5
|
+
constructor(contents: Uint8Array);
|
|
7
6
|
getUuidCiphertext(): UuidCiphertext;
|
|
8
7
|
getPniCiphertext(): UuidCiphertext;
|
|
9
8
|
getRedemptionTime(): Date;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ServerPublicParams from '../ServerPublicParams';
|
|
3
2
|
import AuthCredentialPresentation from './AuthCredentialPresentation';
|
|
4
3
|
import AuthCredentialWithPni from './AuthCredentialWithPni';
|
|
@@ -15,5 +14,5 @@ export default class ClientZkAuthOperations {
|
|
|
15
14
|
*/
|
|
16
15
|
receiveAuthCredentialWithPniAsServiceId(aci: Aci, pni: Pni, redemptionTime: number, authCredentialResponse: AuthCredentialWithPniResponse): AuthCredentialWithPni;
|
|
17
16
|
createAuthCredentialWithPniPresentation(groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
|
|
18
|
-
createAuthCredentialWithPniPresentationWithRandom(random:
|
|
17
|
+
createAuthCredentialWithPniPresentationWithRandom(random: Uint8Array, groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
|
|
19
18
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ServerSecretParams from '../ServerSecretParams';
|
|
3
2
|
import AuthCredentialPresentation from './AuthCredentialPresentation';
|
|
4
3
|
import AuthCredentialWithPniResponse from './AuthCredentialWithPniResponse';
|
|
@@ -8,6 +7,6 @@ export default class ServerZkAuthOperations {
|
|
|
8
7
|
serverSecretParams: ServerSecretParams;
|
|
9
8
|
constructor(serverSecretParams: ServerSecretParams);
|
|
10
9
|
issueAuthCredentialWithPniZkc(aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
11
|
-
issueAuthCredentialWithPniZkcWithRandom(random:
|
|
10
|
+
issueAuthCredentialWithPniZkcWithRandom(random: Uint8Array, aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
12
11
|
verifyAuthCredentialPresentation(groupPublicParams: GroupPublicParams, authCredentialPresentation: AuthCredentialPresentation, now?: Date): void;
|
|
13
12
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
4
3
|
import BackupAuthCredentialPresentation from './BackupAuthCredentialPresentation';
|
|
@@ -6,10 +5,10 @@ import BackupLevel from './BackupLevel';
|
|
|
6
5
|
import BackupCredentialType from './BackupCredentialType';
|
|
7
6
|
export default class BackupAuthCredential extends ByteArray {
|
|
8
7
|
private readonly __type?;
|
|
9
|
-
constructor(contents:
|
|
8
|
+
constructor(contents: Uint8Array);
|
|
10
9
|
present(serverParams: GenericServerPublicParams): BackupAuthCredentialPresentation;
|
|
11
|
-
presentWithRandom(serverParams: GenericServerPublicParams, random:
|
|
12
|
-
getBackupId():
|
|
10
|
+
presentWithRandom(serverParams: GenericServerPublicParams, random: Uint8Array): BackupAuthCredentialPresentation;
|
|
11
|
+
getBackupId(): Uint8Array;
|
|
13
12
|
getBackupLevel(): BackupLevel;
|
|
14
13
|
getType(): BackupCredentialType;
|
|
15
14
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
3
|
import BackupLevel from './BackupLevel';
|
|
5
4
|
import BackupCredentialType from './BackupCredentialType';
|
|
6
5
|
export default class BackupAuthCredentialPresentation extends ByteArray {
|
|
7
6
|
private readonly __type?;
|
|
8
|
-
constructor(contents:
|
|
7
|
+
constructor(contents: Uint8Array);
|
|
9
8
|
verify(serverParams: GenericServerSecretParams, now?: Date): void;
|
|
10
|
-
getBackupId():
|
|
9
|
+
getBackupId(): Uint8Array;
|
|
11
10
|
getBackupLevel(): BackupLevel;
|
|
12
11
|
getType(): BackupCredentialType;
|
|
13
12
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
3
|
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse';
|
|
@@ -6,7 +5,7 @@ import BackupLevel from './BackupLevel';
|
|
|
6
5
|
import BackupCredentialType from './BackupCredentialType';
|
|
7
6
|
export default class BackupAuthCredentialRequest extends ByteArray {
|
|
8
7
|
private readonly __type?;
|
|
9
|
-
constructor(contents:
|
|
8
|
+
constructor(contents: Uint8Array);
|
|
10
9
|
issueCredential(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams): BackupAuthCredentialResponse;
|
|
11
|
-
issueCredentialWithRandom(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams, random:
|
|
10
|
+
issueCredentialWithRandom(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams, random: Uint8Array): BackupAuthCredentialResponse;
|
|
12
11
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import BackupAuthCredentialRequest from './BackupAuthCredentialRequest';
|
|
4
3
|
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse';
|
|
@@ -7,8 +6,8 @@ import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
|
7
6
|
import type { Uuid } from '../..';
|
|
8
7
|
export default class BackupAuthCredentialRequestContext extends ByteArray {
|
|
9
8
|
private readonly __type?;
|
|
10
|
-
constructor(contents:
|
|
11
|
-
static create(backupKey:
|
|
9
|
+
constructor(contents: Uint8Array);
|
|
10
|
+
static create(backupKey: Uint8Array, aci: Uuid): BackupAuthCredentialRequestContext;
|
|
12
11
|
getRequest(): BackupAuthCredentialRequest;
|
|
13
12
|
receive(response: BackupAuthCredentialResponse, redemptionTime: number, params: GenericServerPublicParams): BackupAuthCredential;
|
|
14
13
|
}
|
|
@@ -14,7 +14,7 @@ class BackupAuthCredentialRequestContext extends ByteArray_1.default {
|
|
|
14
14
|
super(contents, Native.BackupAuthCredentialRequestContext_CheckValidContents);
|
|
15
15
|
}
|
|
16
16
|
static create(backupKey, aci) {
|
|
17
|
-
return new BackupAuthCredentialRequestContext(Native.BackupAuthCredentialRequestContext_New(backupKey,
|
|
17
|
+
return new BackupAuthCredentialRequestContext(Native.BackupAuthCredentialRequestContext_New(backupKey, uuid.parse(aci)));
|
|
18
18
|
}
|
|
19
19
|
getRequest() {
|
|
20
20
|
return new BackupAuthCredentialRequest_1.default(Native.BackupAuthCredentialRequestContext_GetRequest(this.contents));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CallLinkSecretParams from './CallLinkSecretParams';
|
|
4
3
|
import CallLinkAuthCredentialPresentation from './CallLinkAuthCredentialPresentation';
|
|
@@ -6,7 +5,7 @@ import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
|
6
5
|
import { Aci } from '../../Address';
|
|
7
6
|
export default class CallLinkAuthCredential extends ByteArray {
|
|
8
7
|
private readonly __type?;
|
|
9
|
-
constructor(contents:
|
|
8
|
+
constructor(contents: Uint8Array);
|
|
10
9
|
present(userId: Aci, redemptionTime: number, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams): CallLinkAuthCredentialPresentation;
|
|
11
|
-
presentWithRandom(userId: Aci, redemptionTime: number, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random:
|
|
10
|
+
presentWithRandom(userId: Aci, redemptionTime: number, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random: Uint8Array): CallLinkAuthCredentialPresentation;
|
|
12
11
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CallLinkPublicParams from './CallLinkPublicParams';
|
|
4
3
|
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
5
4
|
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
6
5
|
export default class CallLinkAuthCredentialPresentation extends ByteArray {
|
|
7
6
|
private readonly __type?;
|
|
8
|
-
constructor(contents:
|
|
7
|
+
constructor(contents: Uint8Array);
|
|
9
8
|
verify(serverParams: GenericServerSecretParams, callLinkParams: CallLinkPublicParams, now?: Date): void;
|
|
10
9
|
getUserId(): UuidCiphertext;
|
|
11
10
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
3
|
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
@@ -6,8 +5,8 @@ import CallLinkAuthCredential from './CallLinkAuthCredential';
|
|
|
6
5
|
import { Aci } from '../../Address';
|
|
7
6
|
export default class CallLinkAuthCredentialResponse extends ByteArray {
|
|
8
7
|
private readonly __type?;
|
|
9
|
-
constructor(contents:
|
|
8
|
+
constructor(contents: Uint8Array);
|
|
10
9
|
static issueCredential(userId: Aci, redemptionTime: number, params: GenericServerSecretParams): CallLinkAuthCredentialResponse;
|
|
11
|
-
static issueCredentialWithRandom(userId: Aci, redemptionTime: number, params: GenericServerSecretParams, random:
|
|
10
|
+
static issueCredentialWithRandom(userId: Aci, redemptionTime: number, params: GenericServerSecretParams, random: Uint8Array): CallLinkAuthCredentialResponse;
|
|
12
11
|
receive(userId: Aci, redemptionTime: number, params: GenericServerPublicParams): CallLinkAuthCredential;
|
|
13
12
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CallLinkPublicParams from './CallLinkPublicParams';
|
|
4
3
|
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
5
4
|
import { Aci } from '../../Address';
|
|
6
5
|
export default class CallLinkSecretParams extends ByteArray {
|
|
7
6
|
private readonly __type?;
|
|
8
|
-
static deriveFromRootKey(callLinkRootKey:
|
|
9
|
-
constructor(contents:
|
|
7
|
+
static deriveFromRootKey(callLinkRootKey: Uint8Array): CallLinkSecretParams;
|
|
8
|
+
constructor(contents: Uint8Array);
|
|
10
9
|
getPublicParams(): CallLinkPublicParams;
|
|
11
10
|
decryptUserId(userId: UuidCiphertext): Aci;
|
|
12
11
|
encryptUserId(userId: Aci): UuidCiphertext;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CallLinkSecretParams from './CallLinkSecretParams';
|
|
4
3
|
import CreateCallLinkCredentialPresentation from './CreateCallLinkCredentialPresentation';
|
|
@@ -6,7 +5,7 @@ import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
|
6
5
|
import { Aci } from '../../Address';
|
|
7
6
|
export default class CreateCallLinkCredential extends ByteArray {
|
|
8
7
|
private readonly __type?;
|
|
9
|
-
constructor(contents:
|
|
10
|
-
present(roomId:
|
|
11
|
-
presentWithRandom(roomId:
|
|
8
|
+
constructor(contents: Uint8Array);
|
|
9
|
+
present(roomId: Uint8Array, userId: Aci, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams): CreateCallLinkCredentialPresentation;
|
|
10
|
+
presentWithRandom(roomId: Uint8Array, userId: Aci, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random: Uint8Array): CreateCallLinkCredentialPresentation;
|
|
12
11
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CallLinkPublicParams from './CallLinkPublicParams';
|
|
4
3
|
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
5
4
|
export default class CreateCallLinkCredentialPresentation extends ByteArray {
|
|
6
5
|
private readonly __type?;
|
|
7
|
-
constructor(contents:
|
|
8
|
-
verify(roomId:
|
|
6
|
+
constructor(contents: Uint8Array);
|
|
7
|
+
verify(roomId: Uint8Array, serverParams: GenericServerSecretParams, callLinkParams: CallLinkPublicParams, now?: Date): void;
|
|
9
8
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse';
|
|
4
3
|
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
5
4
|
import { Aci } from '../../Address';
|
|
6
5
|
export default class CreateCallLinkCredentialRequest extends ByteArray {
|
|
7
6
|
private readonly __type?;
|
|
8
|
-
constructor(contents:
|
|
7
|
+
constructor(contents: Uint8Array);
|
|
9
8
|
issueCredential(userId: Aci, timestamp: number, params: GenericServerSecretParams): CreateCallLinkCredentialResponse;
|
|
10
|
-
issueCredentialWithRandom(userId: Aci, timestamp: number, params: GenericServerSecretParams, random:
|
|
9
|
+
issueCredentialWithRandom(userId: Aci, timestamp: number, params: GenericServerSecretParams, random: Uint8Array): CreateCallLinkCredentialResponse;
|
|
11
10
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import CreateCallLinkCredentialRequest from './CreateCallLinkCredentialRequest';
|
|
4
3
|
import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse';
|
|
@@ -7,9 +6,9 @@ import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
|
7
6
|
import { Aci } from '../../Address';
|
|
8
7
|
export default class CreateCallLinkCredentialRequestContext extends ByteArray {
|
|
9
8
|
private readonly __type?;
|
|
10
|
-
constructor(contents:
|
|
11
|
-
static forRoomId(roomId:
|
|
12
|
-
static forRoomIdWithRandom(roomId:
|
|
9
|
+
constructor(contents: Uint8Array);
|
|
10
|
+
static forRoomId(roomId: Uint8Array): CreateCallLinkCredentialRequestContext;
|
|
11
|
+
static forRoomIdWithRandom(roomId: Uint8Array, random: Uint8Array): CreateCallLinkCredentialRequestContext;
|
|
13
12
|
getRequest(): CreateCallLinkCredentialRequest;
|
|
14
13
|
receive(response: CreateCallLinkCredentialResponse, userId: Aci, params: GenericServerPublicParams): CreateCallLinkCredential;
|
|
15
14
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import UuidCiphertext from './UuidCiphertext';
|
|
3
2
|
import ProfileKeyCiphertext from './ProfileKeyCiphertext';
|
|
4
3
|
import ProfileKey from '../profiles/ProfileKey';
|
|
@@ -11,7 +10,7 @@ export default class ClientZkGroupCipher {
|
|
|
11
10
|
decryptServiceId(ciphertext: UuidCiphertext): ServiceId;
|
|
12
11
|
encryptProfileKey(profileKey: ProfileKey, userId: Aci): ProfileKeyCiphertext;
|
|
13
12
|
decryptProfileKey(profileKeyCiphertext: ProfileKeyCiphertext, userId: Aci): ProfileKey;
|
|
14
|
-
encryptBlob(plaintext:
|
|
15
|
-
encryptBlobWithRandom(random:
|
|
16
|
-
decryptBlob(blobCiphertext:
|
|
13
|
+
encryptBlob(plaintext: Uint8Array): Uint8Array;
|
|
14
|
+
encryptBlobWithRandom(random: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
15
|
+
decryptBlob(blobCiphertext: Uint8Array): Uint8Array;
|
|
17
16
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
export default class GroupIdentifier extends ByteArray {
|
|
4
3
|
private readonly __type?;
|
|
5
4
|
static SIZE: number;
|
|
6
|
-
constructor(contents:
|
|
5
|
+
constructor(contents: Uint8Array);
|
|
7
6
|
/** Returns the group ID as a base64 string (with padding). */
|
|
8
7
|
toString(): string;
|
|
9
8
|
}
|
|
@@ -11,7 +11,7 @@ class GroupIdentifier extends ByteArray_1.default {
|
|
|
11
11
|
}
|
|
12
12
|
/** Returns the group ID as a base64 string (with padding). */
|
|
13
13
|
toString() {
|
|
14
|
-
return this.contents.toString('base64');
|
|
14
|
+
return Buffer.from(this.contents).toString('base64');
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
GroupIdentifier.SIZE = 32;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GroupIdentifier from './GroupIdentifier';
|
|
4
3
|
export default class GroupPublicParams extends ByteArray {
|
|
5
4
|
private readonly __type?;
|
|
6
|
-
constructor(contents:
|
|
5
|
+
constructor(contents: Uint8Array);
|
|
7
6
|
getGroupIdentifier(): GroupIdentifier;
|
|
8
7
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GroupMasterKey from './GroupMasterKey';
|
|
4
3
|
import GroupPublicParams from './GroupPublicParams';
|
|
5
4
|
export default class GroupSecretParams extends ByteArray {
|
|
6
5
|
private readonly __type?;
|
|
7
6
|
static generate(): GroupSecretParams;
|
|
8
|
-
static generateWithRandom(random:
|
|
7
|
+
static generateWithRandom(random: Uint8Array): GroupSecretParams;
|
|
9
8
|
static deriveFromMasterKey(groupMasterKey: GroupMasterKey): GroupSecretParams;
|
|
10
|
-
constructor(contents:
|
|
9
|
+
constructor(contents: Uint8Array);
|
|
11
10
|
getMasterKey(): GroupMasterKey;
|
|
12
11
|
getPublicParams(): GroupPublicParams;
|
|
13
12
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
export default class UuidCiphertext extends ByteArray {
|
|
4
3
|
private readonly __type?;
|
|
5
|
-
constructor(contents:
|
|
6
|
-
static serializeAndConcatenate(ciphertexts: UuidCiphertext[]):
|
|
4
|
+
constructor(contents: Uint8Array);
|
|
5
|
+
static serializeAndConcatenate(ciphertexts: UuidCiphertext[]): Uint8Array;
|
|
7
6
|
}
|
|
@@ -12,10 +12,10 @@ class UuidCiphertext extends ByteArray_1.default {
|
|
|
12
12
|
}
|
|
13
13
|
static serializeAndConcatenate(ciphertexts) {
|
|
14
14
|
if (ciphertexts.length == 0) {
|
|
15
|
-
return
|
|
15
|
+
return Uint8Array.of();
|
|
16
16
|
}
|
|
17
17
|
const uuidCiphertextLen = ciphertexts[0].contents.length;
|
|
18
|
-
const concatenated =
|
|
18
|
+
const concatenated = new Uint8Array(ciphertexts.length * uuidCiphertextLen);
|
|
19
19
|
let offset = 0;
|
|
20
20
|
for (const next of ciphertexts) {
|
|
21
21
|
if (next.contents.length !== uuidCiphertextLen) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import ServerSecretParams from '../ServerSecretParams';
|
|
4
3
|
/**
|
|
@@ -13,7 +12,7 @@ import ServerSecretParams from '../ServerSecretParams';
|
|
|
13
12
|
* @see {@link GroupSendFullToken#verify}
|
|
14
13
|
*/
|
|
15
14
|
export default class GroupSendDerivedKeyPair extends ByteArray {
|
|
16
|
-
constructor(contents:
|
|
15
|
+
constructor(contents: Uint8Array);
|
|
17
16
|
/**
|
|
18
17
|
* Derives a new key for group send endorsements that expire at `expiration`.
|
|
19
18
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray';
|
|
3
2
|
import GroupSecretParams from '../groups/GroupSecretParams';
|
|
4
3
|
import GroupSendFullToken from './GroupSendFullToken';
|
|
@@ -32,7 +31,7 @@ import CallLinkSecretParams from '../calllinks/CallLinkSecretParams';
|
|
|
32
31
|
* it's still cheaper than a usual zkgroup presentation.)
|
|
33
32
|
*/
|
|
34
33
|
export default class GroupSendEndorsement extends ByteArray {
|
|
35
|
-
constructor(contents:
|
|
34
|
+
constructor(contents: Uint8Array, marker?: typeof UNCHECKED_AND_UNCLONED);
|
|
36
35
|
/**
|
|
37
36
|
* Combines several endorsements into one.
|
|
38
37
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GroupSecretParams from '../groups/GroupSecretParams';
|
|
4
3
|
import ServerPublicParams from '../ServerPublicParams';
|
|
@@ -26,7 +25,7 @@ export type ReceivedEndorsements = {
|
|
|
26
25
|
* perspective.
|
|
27
26
|
*/
|
|
28
27
|
export default class GroupSendEndorsementsResponse extends ByteArray {
|
|
29
|
-
constructor(contents:
|
|
28
|
+
constructor(contents: Uint8Array);
|
|
30
29
|
/**
|
|
31
30
|
* Issues a new set of endorsements for `groupMembers`.
|
|
32
31
|
*
|
|
@@ -41,7 +40,7 @@ export default class GroupSendEndorsementsResponse extends ByteArray {
|
|
|
41
40
|
*
|
|
42
41
|
* @see {@link GroupSendEndorsementsResponse#issue}
|
|
43
42
|
*/
|
|
44
|
-
static issueWithRandom(groupMembers: UuidCiphertext[], keyPair: GroupSendDerivedKeyPair, random:
|
|
43
|
+
static issueWithRandom(groupMembers: UuidCiphertext[], keyPair: GroupSendDerivedKeyPair, random: Uint8Array): GroupSendEndorsementsResponse;
|
|
45
44
|
/** Returns the expiration for the contained endorsements. */
|
|
46
45
|
getExpiration(): Date;
|
|
47
46
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import { ServiceId } from '../../Address';
|
|
4
3
|
import GroupSendDerivedKeyPair from './GroupSendDerivedKeyPair';
|
|
@@ -9,7 +8,7 @@ import GroupSendDerivedKeyPair from './GroupSendDerivedKeyPair';
|
|
|
9
8
|
* Generated by {@link GroupSendToken#toFullToken}, and verified by the chat server.
|
|
10
9
|
*/
|
|
11
10
|
export default class GroupSendFullToken extends ByteArray {
|
|
12
|
-
constructor(contents:
|
|
11
|
+
constructor(contents: Uint8Array);
|
|
13
12
|
/** Gets the expiration embedded in the token. */
|
|
14
13
|
getExpiration(): Date;
|
|
15
14
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from '../internal/ByteArray';
|
|
3
2
|
import GroupSendFullToken from './GroupSendFullToken';
|
|
4
3
|
/**
|
|
@@ -11,7 +10,7 @@ import GroupSendFullToken from './GroupSendFullToken';
|
|
|
11
10
|
* Generated by {@link GroupSendEndorsement#toToken}.
|
|
12
11
|
*/
|
|
13
12
|
export default class GroupSendToken extends ByteArray {
|
|
14
|
-
constructor(contents:
|
|
13
|
+
constructor(contents: Uint8Array);
|
|
15
14
|
/**
|
|
16
15
|
* Converts this token to a "full token", which can be sent to the chat server as authentication.
|
|
17
16
|
*
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export declare const UNCHECKED_AND_UNCLONED: unique symbol;
|
|
3
2
|
export default class ByteArray {
|
|
4
|
-
contents:
|
|
5
|
-
protected constructor(contents:
|
|
6
|
-
protected static checkLength(expectedLength: number): (contents:
|
|
7
|
-
getContents():
|
|
8
|
-
serialize():
|
|
3
|
+
contents: Uint8Array;
|
|
4
|
+
protected constructor(contents: Uint8Array, checkValid: ((contents: Uint8Array) => void) | typeof UNCHECKED_AND_UNCLONED);
|
|
5
|
+
protected static checkLength(expectedLength: number): (contents: Uint8Array) => void;
|
|
6
|
+
getContents(): Uint8Array;
|
|
7
|
+
serialize(): Uint8Array;
|
|
9
8
|
}
|