You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@signalapp/libsignal-client

Package Overview
Dependencies
Maintainers
9
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signalapp/libsignal-client - npm Package Compare versions

Comparing version

to
0.75.0

15

dist/AccountKeys.d.ts

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from './zkgroup/internal/ByteArray';

@@ -31,3 +30,3 @@ import { Aci } from './Address';

*/
static deriveSvrKey(accountEntropyPool: string): Buffer;
static deriveSvrKey(accountEntropyPool: string): Uint8Array;
/**

@@ -53,3 +52,3 @@ * Derives a backup key from the given account entropy pool.

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
/**

@@ -68,3 +67,3 @@ * Generates a random backup key.

*/
deriveBackupId(aci: Aci): Buffer;
deriveBackupId(aci: Aci): Uint8Array;
/**

@@ -81,3 +80,3 @@ * Derives the backup EC key to use given the current device's ACI.

*/
deriveLocalBackupMetadataKey(): Buffer;
deriveLocalBackupMetadataKey(): Uint8Array;
/**

@@ -88,3 +87,3 @@ * Derives the ID for uploading media with the name `mediaName`.

*/
deriveMediaId(mediaName: string): Buffer;
deriveMediaId(mediaName: string): Uint8Array;
/**

@@ -97,3 +96,3 @@ * Derives the composite encryption key for re-encrypting media with the given ID.

*/
deriveMediaEncryptionKey(mediaId: Buffer): Buffer;
deriveMediaEncryptionKey(mediaId: Uint8Array): Uint8Array;
/**

@@ -107,3 +106,3 @@ * Derives the composite encryption key for uploading thumbnails with the given ID to the "transit

*/
deriveThumbnailTransitEncryptionKey(mediaId: Buffer): Buffer;
deriveThumbnailTransitEncryptionKey(mediaId: Uint8Array): Uint8Array;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import * as Native from '../Native';

@@ -15,14 +14,14 @@ export declare enum ServiceIdKind {

private readonly serviceIdFixedWidthBinary;
constructor(serviceIdFixedWidthBinary: Buffer);
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary: Buffer) => InstanceType<T>, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): InstanceType<T>;
getServiceIdBinary(): Buffer;
getServiceIdFixedWidthBinary(): Buffer;
constructor(serviceIdFixedWidthBinary: Uint8Array);
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary: Uint8Array) => InstanceType<T>, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): InstanceType<T>;
getServiceIdBinary(): Uint8Array;
getServiceIdFixedWidthBinary(): Uint8Array;
getServiceIdString(): string;
toString(): string;
private downcastTo;
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Buffer): InstanceType<T>;
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary: Buffer): InstanceType<T>;
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Uint8Array): InstanceType<T>;
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary: Uint8Array): InstanceType<T>;
static parseFromServiceIdString<T extends typeof ServiceId>(this: T, serviceIdString: string): InstanceType<T>;
getRawUuid(): string;
getRawUuidBytes(): Buffer;
getRawUuidBytes(): Uint8Array;
isEqual(other: ServiceId): boolean;

@@ -35,3 +34,3 @@ /**

static comparator(this: void, lhs: ServiceId, rhs: ServiceId): number;
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]): Buffer;
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]): Uint8Array;
}

@@ -52,2 +51,6 @@ export declare class Aci extends ServiceId {

static _fromNativeHandle(handle: Native.ProtocolAddress): ProtocolAddress;
/**
* @param name the identifer for the recipient, usually a `ServiceId`
* @param deviceId the identifier for the device; must be in the range 1-127 inclusive
*/
static new(name: string | ServiceId, deviceId: number): ProtocolAddress;

@@ -54,0 +57,0 @@ name(): string;

@@ -32,3 +32,3 @@ "use strict";

static fromUuidBytesAndKind(uuidBytes, kind) {
const buffer = Buffer.alloc(SERVICE_ID_FIXED_WIDTH_BINARY_LEN);
const buffer = new Uint8Array(SERVICE_ID_FIXED_WIDTH_BINARY_LEN);
buffer[0] = kind;

@@ -42,3 +42,3 @@ buffer.set(uuidBytes, 1);

getServiceIdFixedWidthBinary() {
return Buffer.from(this.serviceIdFixedWidthBinary);
return Uint8Array.from(this.serviceIdFixedWidthBinary);
}

@@ -84,6 +84,6 @@ getServiceIdString() {

getRawUuidBytes() {
return Buffer.from(this.serviceIdFixedWidthBinary.buffer, 1);
return this.serviceIdFixedWidthBinary.subarray(1);
}
isEqual(other) {
return this.serviceIdFixedWidthBinary.equals(other.serviceIdFixedWidthBinary);
return ServiceId.comparator(this, other) == 0;
}

@@ -96,6 +96,6 @@ /**

static comparator(lhs, rhs) {
return lhs.serviceIdFixedWidthBinary.compare(rhs.serviceIdFixedWidthBinary);
return Buffer.compare(lhs.serviceIdFixedWidthBinary, rhs.serviceIdFixedWidthBinary);
}
static toConcatenatedFixedWidthBinary(serviceIds) {
const result = Buffer.alloc(serviceIds.length * SERVICE_ID_FIXED_WIDTH_BINARY_LEN);
const result = new Uint8Array(serviceIds.length * SERVICE_ID_FIXED_WIDTH_BINARY_LEN);
let offset = 0;

@@ -135,2 +135,6 @@ for (const serviceId of serviceIds) {

}
/**
* @param name the identifer for the recipient, usually a `ServiceId`
* @param deviceId the identifier for the device; must be in the range 1-127 inclusive
*/
static new(name, deviceId) {

@@ -137,0 +141,0 @@ if (typeof name !== 'string') {

@@ -1,2 +0,1 @@

/// <reference types="node" />
import * as Native from '../Native';

@@ -7,8 +6,8 @@ export declare class PublicKey {

static _fromNativeHandle(handle: Native.PublicKey): PublicKey;
static deserialize(buf: Buffer): PublicKey;
static deserialize(buf: Uint8Array): PublicKey;
compare(other: PublicKey): number;
serialize(): Buffer;
getPublicKeyBytes(): Buffer;
verify(msg: Buffer, sig: Buffer): boolean;
verifyAlternateIdentity(other: PublicKey, signature: Buffer): boolean;
serialize(): Uint8Array;
getPublicKeyBytes(): Uint8Array;
verify(msg: Uint8Array, sig: Uint8Array): boolean;
verifyAlternateIdentity(other: PublicKey, signature: Uint8Array): boolean;
}

@@ -20,6 +19,6 @@ export declare class PrivateKey {

static generate(): PrivateKey;
static deserialize(buf: Buffer): PrivateKey;
serialize(): Buffer;
sign(msg: Buffer): Buffer;
agree(other_key: PublicKey): Buffer;
static deserialize(buf: Uint8Array): PrivateKey;
serialize(): Uint8Array;
sign(msg: Uint8Array): Uint8Array;
agree(other_key: PublicKey): Uint8Array;
getPublicKey(): PublicKey;

@@ -32,5 +31,5 @@ }

static generate(): IdentityKeyPair;
static deserialize(buffer: Buffer): IdentityKeyPair;
serialize(): Buffer;
signAlternateIdentity(other: PublicKey): Buffer;
static deserialize(buffer: Uint8Array): IdentityKeyPair;
serialize(): Uint8Array;
signAlternateIdentity(other: PublicKey): Uint8Array;
}

@@ -9,38 +9,39 @@ import { ProtocolAddress } from './Address';

InvalidRegistrationId = 4,
VerificationFailed = 5,
InvalidSession = 6,
InvalidSenderKeySession = 7,
NicknameCannotBeEmpty = 8,
CannotStartWithDigit = 9,
MissingSeparator = 10,
BadNicknameCharacter = 11,
NicknameTooShort = 12,
NicknameTooLong = 13,
DiscriminatorCannotBeEmpty = 14,
DiscriminatorCannotBeZero = 15,
DiscriminatorCannotBeSingleDigit = 16,
DiscriminatorCannotHaveLeadingZeros = 17,
BadDiscriminatorCharacter = 18,
DiscriminatorTooLarge = 19,
IoError = 20,
CdsiInvalidToken = 21,
InvalidUri = 22,
InvalidMediaInput = 23,
UnsupportedMediaInput = 24,
InputDataTooLong = 25,
InvalidEntropyDataLength = 26,
InvalidUsernameLinkEncryptedData = 27,
RateLimitedError = 28,
SvrDataMissing = 29,
SvrRequestFailed = 30,
SvrRestoreFailed = 31,
ChatServiceInactive = 32,
AppExpired = 33,
DeviceDelinked = 34,
ConnectionInvalidated = 35,
ConnectedElsewhere = 36,
BackupValidation = 37,
Cancelled = 38,
KeyTransparencyError = 39,
KeyTransparencyVerificationFailed = 40
InvalidProtocolAddress = 5,
VerificationFailed = 6,
InvalidSession = 7,
InvalidSenderKeySession = 8,
NicknameCannotBeEmpty = 9,
CannotStartWithDigit = 10,
MissingSeparator = 11,
BadNicknameCharacter = 12,
NicknameTooShort = 13,
NicknameTooLong = 14,
DiscriminatorCannotBeEmpty = 15,
DiscriminatorCannotBeZero = 16,
DiscriminatorCannotBeSingleDigit = 17,
DiscriminatorCannotHaveLeadingZeros = 18,
BadDiscriminatorCharacter = 19,
DiscriminatorTooLarge = 20,
IoError = 21,
CdsiInvalidToken = 22,
InvalidUri = 23,
InvalidMediaInput = 24,
UnsupportedMediaInput = 25,
InputDataTooLong = 26,
InvalidEntropyDataLength = 27,
InvalidUsernameLinkEncryptedData = 28,
RateLimitedError = 29,
SvrDataMissing = 30,
SvrRequestFailed = 31,
SvrRestoreFailed = 32,
ChatServiceInactive = 33,
AppExpired = 34,
DeviceDelinked = 35,
ConnectionInvalidated = 36,
ConnectedElsewhere = 37,
BackupValidation = 38,
Cancelled = 39,
KeyTransparencyError = 40,
KeyTransparencyVerificationFailed = 41
}

@@ -79,2 +80,7 @@ export declare class LibSignalErrorBase extends Error {

};
export type InvalidProtocolAddress = LibSignalErrorCommon & {
code: ErrorCode.InvalidProtocolAddress;
name: string;
deviceId: number;
};
export type VerificationFailedError = LibSignalErrorCommon & {

@@ -192,2 +198,2 @@ code: ErrorCode.VerificationFailed;

};
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | CdsiInvalidTokenError | InvalidUriError | InvalidMediaInputError | SvrDataMissingError | SvrRestoreFailedError | SvrRequestFailedError | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | RateLimitedError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed;
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | InvalidProtocolAddress | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | CdsiInvalidTokenError | InvalidUriError | InvalidMediaInputError | SvrDataMissingError | SvrRestoreFailedError | SvrRequestFailedError | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | RateLimitedError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed;

@@ -16,38 +16,39 @@ "use strict";

ErrorCode[ErrorCode["InvalidRegistrationId"] = 4] = "InvalidRegistrationId";
ErrorCode[ErrorCode["VerificationFailed"] = 5] = "VerificationFailed";
ErrorCode[ErrorCode["InvalidSession"] = 6] = "InvalidSession";
ErrorCode[ErrorCode["InvalidSenderKeySession"] = 7] = "InvalidSenderKeySession";
ErrorCode[ErrorCode["NicknameCannotBeEmpty"] = 8] = "NicknameCannotBeEmpty";
ErrorCode[ErrorCode["CannotStartWithDigit"] = 9] = "CannotStartWithDigit";
ErrorCode[ErrorCode["MissingSeparator"] = 10] = "MissingSeparator";
ErrorCode[ErrorCode["BadNicknameCharacter"] = 11] = "BadNicknameCharacter";
ErrorCode[ErrorCode["NicknameTooShort"] = 12] = "NicknameTooShort";
ErrorCode[ErrorCode["NicknameTooLong"] = 13] = "NicknameTooLong";
ErrorCode[ErrorCode["DiscriminatorCannotBeEmpty"] = 14] = "DiscriminatorCannotBeEmpty";
ErrorCode[ErrorCode["DiscriminatorCannotBeZero"] = 15] = "DiscriminatorCannotBeZero";
ErrorCode[ErrorCode["DiscriminatorCannotBeSingleDigit"] = 16] = "DiscriminatorCannotBeSingleDigit";
ErrorCode[ErrorCode["DiscriminatorCannotHaveLeadingZeros"] = 17] = "DiscriminatorCannotHaveLeadingZeros";
ErrorCode[ErrorCode["BadDiscriminatorCharacter"] = 18] = "BadDiscriminatorCharacter";
ErrorCode[ErrorCode["DiscriminatorTooLarge"] = 19] = "DiscriminatorTooLarge";
ErrorCode[ErrorCode["IoError"] = 20] = "IoError";
ErrorCode[ErrorCode["CdsiInvalidToken"] = 21] = "CdsiInvalidToken";
ErrorCode[ErrorCode["InvalidUri"] = 22] = "InvalidUri";
ErrorCode[ErrorCode["InvalidMediaInput"] = 23] = "InvalidMediaInput";
ErrorCode[ErrorCode["UnsupportedMediaInput"] = 24] = "UnsupportedMediaInput";
ErrorCode[ErrorCode["InputDataTooLong"] = 25] = "InputDataTooLong";
ErrorCode[ErrorCode["InvalidEntropyDataLength"] = 26] = "InvalidEntropyDataLength";
ErrorCode[ErrorCode["InvalidUsernameLinkEncryptedData"] = 27] = "InvalidUsernameLinkEncryptedData";
ErrorCode[ErrorCode["RateLimitedError"] = 28] = "RateLimitedError";
ErrorCode[ErrorCode["SvrDataMissing"] = 29] = "SvrDataMissing";
ErrorCode[ErrorCode["SvrRequestFailed"] = 30] = "SvrRequestFailed";
ErrorCode[ErrorCode["SvrRestoreFailed"] = 31] = "SvrRestoreFailed";
ErrorCode[ErrorCode["ChatServiceInactive"] = 32] = "ChatServiceInactive";
ErrorCode[ErrorCode["AppExpired"] = 33] = "AppExpired";
ErrorCode[ErrorCode["DeviceDelinked"] = 34] = "DeviceDelinked";
ErrorCode[ErrorCode["ConnectionInvalidated"] = 35] = "ConnectionInvalidated";
ErrorCode[ErrorCode["ConnectedElsewhere"] = 36] = "ConnectedElsewhere";
ErrorCode[ErrorCode["BackupValidation"] = 37] = "BackupValidation";
ErrorCode[ErrorCode["Cancelled"] = 38] = "Cancelled";
ErrorCode[ErrorCode["KeyTransparencyError"] = 39] = "KeyTransparencyError";
ErrorCode[ErrorCode["KeyTransparencyVerificationFailed"] = 40] = "KeyTransparencyVerificationFailed";
ErrorCode[ErrorCode["InvalidProtocolAddress"] = 5] = "InvalidProtocolAddress";
ErrorCode[ErrorCode["VerificationFailed"] = 6] = "VerificationFailed";
ErrorCode[ErrorCode["InvalidSession"] = 7] = "InvalidSession";
ErrorCode[ErrorCode["InvalidSenderKeySession"] = 8] = "InvalidSenderKeySession";
ErrorCode[ErrorCode["NicknameCannotBeEmpty"] = 9] = "NicknameCannotBeEmpty";
ErrorCode[ErrorCode["CannotStartWithDigit"] = 10] = "CannotStartWithDigit";
ErrorCode[ErrorCode["MissingSeparator"] = 11] = "MissingSeparator";
ErrorCode[ErrorCode["BadNicknameCharacter"] = 12] = "BadNicknameCharacter";
ErrorCode[ErrorCode["NicknameTooShort"] = 13] = "NicknameTooShort";
ErrorCode[ErrorCode["NicknameTooLong"] = 14] = "NicknameTooLong";
ErrorCode[ErrorCode["DiscriminatorCannotBeEmpty"] = 15] = "DiscriminatorCannotBeEmpty";
ErrorCode[ErrorCode["DiscriminatorCannotBeZero"] = 16] = "DiscriminatorCannotBeZero";
ErrorCode[ErrorCode["DiscriminatorCannotBeSingleDigit"] = 17] = "DiscriminatorCannotBeSingleDigit";
ErrorCode[ErrorCode["DiscriminatorCannotHaveLeadingZeros"] = 18] = "DiscriminatorCannotHaveLeadingZeros";
ErrorCode[ErrorCode["BadDiscriminatorCharacter"] = 19] = "BadDiscriminatorCharacter";
ErrorCode[ErrorCode["DiscriminatorTooLarge"] = 20] = "DiscriminatorTooLarge";
ErrorCode[ErrorCode["IoError"] = 21] = "IoError";
ErrorCode[ErrorCode["CdsiInvalidToken"] = 22] = "CdsiInvalidToken";
ErrorCode[ErrorCode["InvalidUri"] = 23] = "InvalidUri";
ErrorCode[ErrorCode["InvalidMediaInput"] = 24] = "InvalidMediaInput";
ErrorCode[ErrorCode["UnsupportedMediaInput"] = 25] = "UnsupportedMediaInput";
ErrorCode[ErrorCode["InputDataTooLong"] = 26] = "InputDataTooLong";
ErrorCode[ErrorCode["InvalidEntropyDataLength"] = 27] = "InvalidEntropyDataLength";
ErrorCode[ErrorCode["InvalidUsernameLinkEncryptedData"] = 28] = "InvalidUsernameLinkEncryptedData";
ErrorCode[ErrorCode["RateLimitedError"] = 29] = "RateLimitedError";
ErrorCode[ErrorCode["SvrDataMissing"] = 30] = "SvrDataMissing";
ErrorCode[ErrorCode["SvrRequestFailed"] = 31] = "SvrRequestFailed";
ErrorCode[ErrorCode["SvrRestoreFailed"] = 32] = "SvrRestoreFailed";
ErrorCode[ErrorCode["ChatServiceInactive"] = 33] = "ChatServiceInactive";
ErrorCode[ErrorCode["AppExpired"] = 34] = "AppExpired";
ErrorCode[ErrorCode["DeviceDelinked"] = 35] = "DeviceDelinked";
ErrorCode[ErrorCode["ConnectionInvalidated"] = 36] = "ConnectionInvalidated";
ErrorCode[ErrorCode["ConnectedElsewhere"] = 37] = "ConnectedElsewhere";
ErrorCode[ErrorCode["BackupValidation"] = 38] = "BackupValidation";
ErrorCode[ErrorCode["Cancelled"] = 39] = "Cancelled";
ErrorCode[ErrorCode["KeyTransparencyError"] = 40] = "KeyTransparencyError";
ErrorCode[ErrorCode["KeyTransparencyVerificationFailed"] = 41] = "KeyTransparencyVerificationFailed";
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));

@@ -54,0 +55,0 @@ class LibSignalErrorBase extends Error {

@@ -16,5 +16,5 @@ /// <reference types="node" />

private digester;
constructor(key: Buffer, sizeChoice: ChunkSizeChoice);
getFinalDigest(): Buffer;
_transform(data: Buffer, enc: BufferEncoding, callback: CallbackType): void;
constructor(key: Uint8Array, sizeChoice: ChunkSizeChoice);
getFinalDigest(): Uint8Array;
_transform(data: Uint8Array, enc: BufferEncoding, callback: CallbackType): void;
_final(callback: CallbackType): void;

@@ -25,4 +25,4 @@ }

private buffer;
constructor(key: Buffer, sizeChoice: ChunkSizeChoice, digest: Buffer);
_transform(data: Buffer, enc: BufferEncoding, callback: CallbackType): void;
constructor(key: Uint8Array, sizeChoice: ChunkSizeChoice, digest: Uint8Array);
_transform(data: Uint8Array, enc: BufferEncoding, callback: CallbackType): void;
_final(callback: CallbackType): void;

@@ -29,0 +29,0 @@ }

@@ -26,3 +26,5 @@ "use strict";

getFinalDigest() {
return Buffer.concat(this._digests);
// Use Buffer.concat for convenience, but return a proper Uint8Array, both for the correct type
// and to make an independent copy of a possibly-reused buffer.
return new Uint8Array(Buffer.concat(this._digests));
}

@@ -29,0 +31,0 @@ _write(

@@ -1,2 +0,1 @@

/// <reference types="node" />
export * from './Errors';

@@ -33,9 +32,9 @@ import { Aci, ProtocolAddress, ServiceId } from './Address';

export type Uuid = string;
export declare function hkdf(outputLength: number, keyMaterial: Buffer, label: Buffer, salt: Buffer | null): Buffer;
export declare function hkdf(outputLength: number, keyMaterial: Uint8Array, label: Uint8Array, salt: Uint8Array | null): Uint8Array;
export declare class ScannableFingerprint {
private readonly scannable;
private constructor();
static _fromBuffer(scannable: Buffer): ScannableFingerprint;
static _fromBuffer(scannable: Uint8Array): ScannableFingerprint;
compare(other: ScannableFingerprint): boolean;
toBuffer(): Buffer;
toBuffer(): Uint8Array;
}

@@ -51,3 +50,3 @@ export declare class DisplayableFingerprint {

private constructor();
static new(iterations: number, version: number, localIdentifier: Buffer, localKey: PublicKey, remoteIdentifier: Buffer, remoteKey: PublicKey): Fingerprint;
static new(iterations: number, version: number, localIdentifier: Uint8Array, localKey: PublicKey, remoteIdentifier: Uint8Array, remoteKey: PublicKey): Fingerprint;
displayableFingerprint(): DisplayableFingerprint;

@@ -59,5 +58,5 @@ scannableFingerprint(): ScannableFingerprint;

private constructor();
static new(key: Buffer): Aes256GcmSiv;
encrypt(message: Buffer, nonce: Buffer, associated_data: Buffer): Buffer;
decrypt(message: Buffer, nonce: Buffer, associated_data: Buffer): Buffer;
static new(key: Uint8Array): Aes256GcmSiv;
encrypt(message: Uint8Array, nonce: Uint8Array, associated_data: Uint8Array): Uint8Array;
decrypt(message: Uint8Array, nonce: Uint8Array, associated_data: Uint8Array): Uint8Array;
}

@@ -68,4 +67,4 @@ export declare class KEMPublicKey {

static _fromNativeHandle(handle: Native.KyberPublicKey): KEMPublicKey;
static deserialize(buf: Buffer): KEMPublicKey;
serialize(): Buffer;
static deserialize(buf: Uint8Array): KEMPublicKey;
serialize(): Uint8Array;
}

@@ -76,4 +75,4 @@ export declare class KEMSecretKey {

static _fromNativeHandle(handle: Native.KyberSecretKey): KEMSecretKey;
static deserialize(buf: Buffer): KEMSecretKey;
serialize(): Buffer;
static deserialize(buf: Uint8Array): KEMSecretKey;
serialize(): Uint8Array;
}

@@ -92,3 +91,3 @@ export declare class KEMKeyPair {

publicKey(): PublicKey;
signature(): Buffer;
signature(): Uint8Array;
};

@@ -99,3 +98,3 @@ /** The public information contained in a {@link KyberPreKeyRecord} */

publicKey(): KEMPublicKey;
signature(): Buffer;
signature(): Uint8Array;
};

@@ -105,3 +104,3 @@ export declare class PreKeyBundle {

private constructor();
static new(registration_id: number, device_id: number, prekey_id: number | null, prekey: PublicKey | null, signed_prekey_id: number, signed_prekey: PublicKey, signed_prekey_signature: Buffer, identity_key: PublicKey, kyber_prekey_id: number, kyber_prekey: KEMPublicKey, kyber_prekey_signature: Buffer): PreKeyBundle;
static new(registration_id: number, device_id: number, prekey_id: number | null, prekey: PublicKey | null, signed_prekey_id: number, signed_prekey: PublicKey, signed_prekey_signature: Uint8Array, identity_key: PublicKey, kyber_prekey_id: number, kyber_prekey: KEMPublicKey, kyber_prekey_signature: Uint8Array): PreKeyBundle;
deviceId(): number;

@@ -114,6 +113,6 @@ identityKey(): PublicKey;

signedPreKeyPublic(): PublicKey;
signedPreKeySignature(): Buffer;
signedPreKeySignature(): Uint8Array;
kyberPreKeyId(): number;
kyberPreKeyPublic(): KEMPublicKey;
kyberPreKeySignature(): Buffer;
kyberPreKeySignature(): Uint8Array;
}

@@ -125,7 +124,7 @@ export declare class PreKeyRecord {

static new(id: number, pubKey: PublicKey, privKey: PrivateKey): PreKeyRecord;
static deserialize(buffer: Buffer): PreKeyRecord;
static deserialize(buffer: Uint8Array): PreKeyRecord;
id(): number;
privateKey(): PrivateKey;
publicKey(): PublicKey;
serialize(): Buffer;
serialize(): Uint8Array;
}

@@ -136,9 +135,9 @@ export declare class SignedPreKeyRecord implements SignedPublicPreKey {

static _fromNativeHandle(nativeHandle: Native.SignedPreKeyRecord): SignedPreKeyRecord;
static new(id: number, timestamp: number, pubKey: PublicKey, privKey: PrivateKey, signature: Buffer): SignedPreKeyRecord;
static deserialize(buffer: Buffer): SignedPreKeyRecord;
static new(id: number, timestamp: number, pubKey: PublicKey, privKey: PrivateKey, signature: Uint8Array): SignedPreKeyRecord;
static deserialize(buffer: Uint8Array): SignedPreKeyRecord;
id(): number;
privateKey(): PrivateKey;
publicKey(): PublicKey;
serialize(): Buffer;
signature(): Buffer;
serialize(): Uint8Array;
signature(): Uint8Array;
timestamp(): number;

@@ -150,5 +149,5 @@ }

static _fromNativeHandle(nativeHandle: Native.KyberPreKeyRecord): KyberPreKeyRecord;
static new(id: number, timestamp: number, keyPair: KEMKeyPair, signature: Buffer): KyberPreKeyRecord;
serialize(): Buffer;
static deserialize(buffer: Buffer): KyberPreKeyRecord;
static new(id: number, timestamp: number, keyPair: KEMKeyPair, signature: Uint8Array): KyberPreKeyRecord;
serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): KyberPreKeyRecord;
id(): number;

@@ -158,3 +157,3 @@ keyPair(): KEMKeyPair;

secretKey(): KEMSecretKey;
signature(): Buffer;
signature(): Uint8Array;
timestamp(): number;

@@ -165,10 +164,10 @@ }

private constructor();
static _new(messageVersion: number, macKey: Buffer, senderRatchetKey: PublicKey, counter: number, previousCounter: number, ciphertext: Buffer, senderIdentityKey: PublicKey, receiverIdentityKey: PublicKey, pqRatchet: Buffer): SignalMessage;
static deserialize(buffer: Buffer): SignalMessage;
body(): Buffer;
pqRatchet(): Buffer;
static _new(messageVersion: number, macKey: Uint8Array, senderRatchetKey: PublicKey, counter: number, previousCounter: number, ciphertext: Uint8Array, senderIdentityKey: PublicKey, receiverIdentityKey: PublicKey, pqRatchet: Uint8Array): SignalMessage;
static deserialize(buffer: Uint8Array): SignalMessage;
body(): Uint8Array;
pqRatchet(): Uint8Array;
counter(): number;
messageVersion(): number;
serialize(): Buffer;
verifyMac(senderIdentityKey: PublicKey, recevierIdentityKey: PublicKey, macKey: Buffer): boolean;
serialize(): Uint8Array;
verifyMac(senderIdentityKey: PublicKey, recevierIdentityKey: PublicKey, macKey: Uint8Array): boolean;
}

@@ -179,3 +178,3 @@ export declare class PreKeySignalMessage {

static _new(messageVersion: number, registrationId: number, preKeyId: number | null, signedPreKeyId: number, baseKey: PublicKey, identityKey: PublicKey, signalMessage: SignalMessage): PreKeySignalMessage;
static deserialize(buffer: Buffer): PreKeySignalMessage;
static deserialize(buffer: Uint8Array): PreKeySignalMessage;
preKeyId(): number | null;

@@ -185,3 +184,3 @@ registrationId(): number;

version(): number;
serialize(): Buffer;
serialize(): Uint8Array;
}

@@ -192,4 +191,4 @@ export declare class SessionRecord {

static _fromNativeHandle(nativeHandle: Native.SessionRecord): SessionRecord;
static deserialize(buffer: Buffer): SessionRecord;
serialize(): Buffer;
static deserialize(buffer: Uint8Array): SessionRecord;
serialize(): Uint8Array;
archiveCurrentState(): void;

@@ -211,8 +210,8 @@ localRegistrationId(): number;

static new(keyId: number, serverKey: PublicKey, trustRoot: PrivateKey): ServerCertificate;
static deserialize(buffer: Buffer): ServerCertificate;
certificateData(): Buffer;
static deserialize(buffer: Uint8Array): ServerCertificate;
certificateData(): Uint8Array;
key(): PublicKey;
keyId(): number;
serialize(): Buffer;
signature(): Buffer;
serialize(): Uint8Array;
signature(): Uint8Array;
}

@@ -223,4 +222,4 @@ export declare class SenderKeyRecord {

private constructor();
static deserialize(buffer: Buffer): SenderKeyRecord;
serialize(): Buffer;
static deserialize(buffer: Uint8Array): SenderKeyRecord;
serialize(): Uint8Array;
}

@@ -232,5 +231,5 @@ export declare class SenderCertificate {

static new(senderUuid: string | Aci, senderE164: string | null, senderDeviceId: number, senderKey: PublicKey, expiration: number, signerCert: ServerCertificate, signerKey: PrivateKey): SenderCertificate;
static deserialize(buffer: Buffer): SenderCertificate;
serialize(): Buffer;
certificate(): Buffer;
static deserialize(buffer: Uint8Array): SenderCertificate;
serialize(): Uint8Array;
certificate(): Uint8Array;
expiration(): number;

@@ -248,3 +247,3 @@ key(): PublicKey;

serverCertificate(): ServerCertificate;
signature(): Buffer;
signature(): Uint8Array;
validate(trustRoot: PublicKey, time: number): boolean;

@@ -256,6 +255,6 @@ }

static create(sender: ProtocolAddress, distributionId: Uuid, store: SenderKeyStore): Promise<SenderKeyDistributionMessage>;
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainKey: Buffer, pk: PublicKey): SenderKeyDistributionMessage;
static deserialize(buffer: Buffer): SenderKeyDistributionMessage;
serialize(): Buffer;
chainKey(): Buffer;
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainKey: Uint8Array, pk: PublicKey): SenderKeyDistributionMessage;
static deserialize(buffer: Uint8Array): SenderKeyDistributionMessage;
serialize(): Uint8Array;
chainKey(): Uint8Array;
iteration(): number;

@@ -269,6 +268,6 @@ chainId(): number;

private constructor();
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Buffer, pk: PrivateKey): SenderKeyMessage;
static deserialize(buffer: Buffer): SenderKeyMessage;
serialize(): Buffer;
ciphertext(): Buffer;
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Uint8Array, pk: PrivateKey): SenderKeyMessage;
static deserialize(buffer: Uint8Array): SenderKeyMessage;
serialize(): Uint8Array;
ciphertext(): Uint8Array;
iteration(): number;

@@ -283,10 +282,10 @@ chainId(): number;

static _fromNativeHandle(nativeHandle: Native.UnidentifiedSenderMessageContent): UnidentifiedSenderMessageContent;
static new(message: CiphertextMessage, sender: SenderCertificate, contentHint: number, groupId: Buffer | null): UnidentifiedSenderMessageContent;
static deserialize(buffer: Buffer): UnidentifiedSenderMessageContent;
serialize(): Buffer;
contents(): Buffer;
static new(message: CiphertextMessage, sender: SenderCertificate, contentHint: number, groupId: Uint8Array | null): UnidentifiedSenderMessageContent;
static deserialize(buffer: Uint8Array): UnidentifiedSenderMessageContent;
serialize(): Uint8Array;
contents(): Uint8Array;
msgType(): number;
senderCertificate(): SenderCertificate;
contentHint(): number;
groupId(): Buffer | null;
groupId(): Uint8Array | null;
}

@@ -344,4 +343,4 @@ export declare abstract class SessionStore implements Native.SessionStore {

}
export declare function groupEncrypt(sender: ProtocolAddress, distributionId: Uuid, store: SenderKeyStore, message: Buffer): Promise<CiphertextMessage>;
export declare function groupDecrypt(sender: ProtocolAddress, store: SenderKeyStore, message: Buffer): Promise<Buffer>;
export declare function groupEncrypt(sender: ProtocolAddress, distributionId: Uuid, store: SenderKeyStore, message: Uint8Array): Promise<CiphertextMessage>;
export declare function groupDecrypt(sender: ProtocolAddress, store: SenderKeyStore, message: Uint8Array): Promise<Uint8Array>;
export declare class SealedSenderDecryptionResult {

@@ -351,3 +350,3 @@ readonly _nativeHandle: Native.SealedSenderDecryptionResult;

static _fromNativeHandle(nativeHandle: Native.SealedSenderDecryptionResult): SealedSenderDecryptionResult;
message(): Buffer;
message(): Uint8Array;
senderE164(): string | null;

@@ -371,3 +370,3 @@ senderUuid(): string;

static from(message: CiphertextMessageConvertible): CiphertextMessage;
serialize(): Buffer;
serialize(): Uint8Array;
type(): number;

@@ -378,6 +377,6 @@ }

private constructor();
static deserialize(buffer: Buffer): PlaintextContent;
static deserialize(buffer: Uint8Array): PlaintextContent;
static from(message: DecryptionErrorMessage): PlaintextContent;
serialize(): Buffer;
body(): Buffer;
serialize(): Uint8Array;
body(): Uint8Array;
asCiphertextMessage(): CiphertextMessage;

@@ -389,6 +388,6 @@ }

static _fromNativeHandle(nativeHandle: Native.DecryptionErrorMessage): DecryptionErrorMessage;
static forOriginal(bytes: Buffer, type: CiphertextMessageType, timestamp: number, originalSenderDeviceId: number): DecryptionErrorMessage;
static deserialize(buffer: Buffer): DecryptionErrorMessage;
static extractFromSerializedBody(buffer: Buffer): DecryptionErrorMessage;
serialize(): Buffer;
static forOriginal(bytes: Uint8Array, type: CiphertextMessageType, timestamp: number, originalSenderDeviceId: number): DecryptionErrorMessage;
static deserialize(buffer: Uint8Array): DecryptionErrorMessage;
static extractFromSerializedBody(buffer: Uint8Array): DecryptionErrorMessage;
serialize(): Uint8Array;
timestamp(): number;

@@ -399,7 +398,7 @@ deviceId(): number;

export declare function processPreKeyBundle(bundle: PreKeyBundle, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, usePqRatchet: UsePQRatchet, now?: Date): Promise<void>;
export declare function signalEncrypt(message: Buffer, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, now?: Date): Promise<CiphertextMessage>;
export declare function signalDecrypt(message: SignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Buffer>;
export declare function signalDecryptPreKey(message: PreKeySignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<Buffer>;
export declare function sealedSenderEncryptMessage(message: Buffer, address: ProtocolAddress, senderCert: SenderCertificate, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Buffer>;
export declare function sealedSenderEncrypt(content: UnidentifiedSenderMessageContent, address: ProtocolAddress, identityStore: IdentityKeyStore): Promise<Buffer>;
export declare function signalEncrypt(message: Uint8Array, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, now?: Date): Promise<CiphertextMessage>;
export declare function signalDecrypt(message: SignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Uint8Array>;
export declare function signalDecryptPreKey(message: PreKeySignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<Uint8Array>;
export declare function sealedSenderEncryptMessage(message: Uint8Array, address: ProtocolAddress, senderCert: SenderCertificate, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Uint8Array>;
export declare function sealedSenderEncrypt(content: UnidentifiedSenderMessageContent, address: ProtocolAddress, identityStore: IdentityKeyStore): Promise<Uint8Array>;
export type SealedSenderMultiRecipientEncryptOptions = {

@@ -412,15 +411,15 @@ content: UnidentifiedSenderMessageContent;

};
export declare function sealedSenderMultiRecipientEncrypt(options: SealedSenderMultiRecipientEncryptOptions): Promise<Buffer>;
export declare function sealedSenderMultiRecipientEncrypt(content: UnidentifiedSenderMessageContent, recipients: ProtocolAddress[], identityStore: IdentityKeyStore, sessionStore: SessionStore): Promise<Buffer>;
export declare function sealedSenderMultiRecipientMessageForSingleRecipient(message: Buffer): Buffer;
export declare function sealedSenderDecryptMessage(message: Buffer, trustRoot: PublicKey, timestamp: number, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<SealedSenderDecryptionResult>;
export declare function sealedSenderDecryptToUsmc(message: Buffer, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
export declare function sealedSenderMultiRecipientEncrypt(options: SealedSenderMultiRecipientEncryptOptions): Promise<Uint8Array>;
export declare function sealedSenderMultiRecipientEncrypt(content: UnidentifiedSenderMessageContent, recipients: ProtocolAddress[], identityStore: IdentityKeyStore, sessionStore: SessionStore): Promise<Uint8Array>;
export declare function sealedSenderMultiRecipientMessageForSingleRecipient(message: Uint8Array): Uint8Array;
export declare function sealedSenderDecryptMessage(message: Uint8Array, trustRoot: PublicKey, timestamp: number, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<SealedSenderDecryptionResult>;
export declare function sealedSenderDecryptToUsmc(message: Uint8Array, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
export declare class Cds2Client {
readonly _nativeHandle: Native.SgxClientState;
private constructor();
static new(mrenclave: Buffer, attestationMsg: Buffer, currentTimestamp: Date): Cds2Client;
initialRequest(): Buffer;
completeHandshake(buffer: Buffer): void;
establishedSend(buffer: Buffer): Buffer;
establishedRecv(buffer: Buffer): Buffer;
static new(mrenclave: Uint8Array, attestationMsg: Uint8Array, currentTimestamp: Date): Cds2Client;
initialRequest(): Uint8Array;
completeHandshake(buffer: Uint8Array): void;
establishedSend(buffer: Uint8Array): Uint8Array;
establishedRecv(buffer: Uint8Array): Uint8Array;
}

@@ -430,7 +429,7 @@ export declare class HsmEnclaveClient {

private constructor();
static new(public_key: Buffer, code_hashes: Buffer[]): HsmEnclaveClient;
initialRequest(): Buffer;
completeHandshake(buffer: Buffer): void;
establishedSend(buffer: Buffer): Buffer;
establishedRecv(buffer: Buffer): Buffer;
static new(public_key: Uint8Array, code_hashes: Uint8Array[]): HsmEnclaveClient;
initialRequest(): Uint8Array;
completeHandshake(buffer: Uint8Array): void;
establishedSend(buffer: Uint8Array): Uint8Array;
establishedRecv(buffer: Uint8Array): Uint8Array;
}

@@ -437,0 +436,0 @@ export declare enum LogLevel {

@@ -518,7 +518,7 @@ "use strict";

static async create(sender, distributionId, store) {
const handle = await Native.SenderKeyDistributionMessage_Create(sender, Buffer.from(uuid.parse(distributionId)), store);
const handle = await Native.SenderKeyDistributionMessage_Create(sender, uuid.parse(distributionId), store);
return new SenderKeyDistributionMessage(handle);
}
static _new(messageVersion, distributionId, chainId, iteration, chainKey, pk) {
return new SenderKeyDistributionMessage(Native.SenderKeyDistributionMessage_New(messageVersion, Buffer.from(uuid.parse(distributionId)), chainId, iteration, chainKey, pk));
return new SenderKeyDistributionMessage(Native.SenderKeyDistributionMessage_New(messageVersion, uuid.parse(distributionId), chainId, iteration, chainKey, pk));
}

@@ -554,3 +554,3 @@ static deserialize(buffer) {

static _new(messageVersion, distributionId, chainId, iteration, ciphertext, pk) {
return new SenderKeyMessage(Native.SenderKeyMessage_New(messageVersion, Buffer.from(uuid.parse(distributionId)), chainId, iteration, ciphertext, pk));
return new SenderKeyMessage(Native.SenderKeyMessage_New(messageVersion, uuid.parse(distributionId), chainId, iteration, ciphertext, pk));
}

@@ -712,3 +712,3 @@ static deserialize(buffer) {

async function groupEncrypt(sender, distributionId, store, message) {
return CiphertextMessage._fromNativeHandle(await Native.GroupCipher_EncryptMessage(sender, Buffer.from(uuid.parse(distributionId)), message, store));
return CiphertextMessage._fromNativeHandle(await Native.GroupCipher_EncryptMessage(sender, uuid.parse(distributionId), message, store));
}

@@ -715,0 +715,0 @@ exports.groupEncrypt = groupEncrypt;

@@ -1,4 +0,2 @@

/// <reference types="node" />
import * as Native from '../Native';
import type { Buffer } from 'node:buffer';
/**

@@ -8,3 +6,3 @@ * An abstract class representing an input stream of bytes.

export declare abstract class InputStream implements Native.InputStream {
_read(amount: number): Promise<Buffer>;
_read(amount: number): Promise<Uint8Array>;
_skip(amount: number): Promise<void>;

@@ -24,6 +22,6 @@ /**

* @param amount The amount of bytes to read.
* @returns A promise yielding a {@link Buffer} containing the read bytes.
* @returns A promise yielding a {@link Uint8Array} containing the read bytes.
* @throws {IoError} If an I/O error occurred while reading from the input.
*/
abstract read(amount: number): Promise<Buffer>;
abstract read(amount: number): Promise<Uint8Array>;
/**

@@ -30,0 +28,0 @@ * Skip an amount of bytes in the input stream.

@@ -1,2 +0,1 @@

/// <reference types="node" />
/**

@@ -37,4 +36,4 @@ * Message backup validation routines.

} | {
backupKey: BackupKey | Buffer;
backupId: Buffer;
backupKey: BackupKey | Uint8Array;
backupId: Uint8Array;
}>;

@@ -60,5 +59,5 @@ /**

/** An HMAC key used to sign a backup file. */
get hmacKey(): Buffer;
get hmacKey(): Uint8Array;
/** An AES-256-CBC key used to encrypt a backup file. */
get aesKey(): Buffer;
get aesKey(): Uint8Array;
}

@@ -113,3 +112,3 @@ export declare enum Purpose {

*/
constructor(backupInfo: Buffer, purpose: Purpose);
constructor(backupInfo: Uint8Array, purpose: Purpose);
/**

@@ -122,3 +121,3 @@ * Processes a single Frame protobuf message.

*/
addFrame(frame: Buffer): void;
addFrame(frame: Uint8Array): void;
/**

@@ -125,0 +124,0 @@ * Marks that a backup is complete, and does any final checks that require whole-file knowledge.

@@ -1,2 +0,1 @@

/// <reference types="node" />
export declare function toJSONString(buffer: Buffer): string;
export declare function toJSONString(buffer: Uint8Array): string;

@@ -1,2 +0,1 @@

/// <reference types="node" />
/**

@@ -39,3 +38,3 @@ * An MP4 format “sanitizer”.

*/
getMetadata(): Buffer | null;
getMetadata(): Uint8Array | null;
/**

@@ -42,0 +41,0 @@ * Get the offset of the media data in the processed input.

@@ -1,5 +0,3 @@

/// <reference types="node" />
import type { ReadonlyDeep } from 'type-fest';
import * as Native from '../Native';
import { Buffer } from 'node:buffer';
import { CDSRequestOptionsType, CDSResponseType } from './net/CDSI';

@@ -44,3 +42,3 @@ import { ConnectionEventsListener, UnauthenticatedChatConnection, AuthenticatedChatConnection, ChatServiceListener } from './net/Chat';

TESTING_localServer_svr2Port: number;
TESTING_localServer_rootCertificateDer: Buffer;
TESTING_localServer_rootCertificateDer: Uint8Array;
}>;

@@ -47,0 +45,0 @@ /** See {@link Net.setProxy()}. */

@@ -1,6 +0,4 @@

/// <reference types="node" />
import * as Native from '../../Native';
import { LibSignalError } from '../Errors';
import { Wrapper } from '../../Native';
import { Buffer } from 'node:buffer';
import { TokioAsyncContext, Environment } from '../net';

@@ -40,3 +38,3 @@ import * as KT from './KeyTransparency';

*/
onIncomingMessage(envelope: Buffer, timestamp: number, ack: ChatServerMessageAck): void;
onIncomingMessage(envelope: Uint8Array, timestamp: number, ack: ChatServerMessageAck): void;
/**

@@ -43,0 +41,0 @@ * Called when the server indicates that there are no further messages in the message queue.

@@ -9,3 +9,2 @@ "use strict";

const Native = require("../../Native");
const node_buffer_1 = require("node:buffer");
const KT = require("./KeyTransparency");

@@ -213,5 +212,4 @@ const internal_1 = require("../internal");

const { verb, path, body, headers } = chatRequest;
const bodyBuffer = body !== undefined ? node_buffer_1.Buffer.from(body) : null;
const httpRequest = {
_nativeHandle: Native.HttpRequest_new(verb, path, bodyBuffer),
_nativeHandle: Native.HttpRequest_new(verb, path, body ?? null),
};

@@ -218,0 +216,0 @@ headers.forEach((header) => {

@@ -1,2 +0,1 @@

/// <reference types="node" />
import * as Native from '../../Native';

@@ -13,6 +12,6 @@ import { Aci } from '../Address';

export interface Store {
getLastDistinguishedTreeHead(): Promise<Buffer | null>;
setLastDistinguishedTreeHead(bytes: Readonly<Buffer> | null): Promise<void>;
getAccountData(aci: Aci): Promise<Buffer | null>;
setAccountData(aci: Aci, bytes: Readonly<Buffer>): Promise<void>;
getLastDistinguishedTreeHead(): Promise<Uint8Array | null>;
setLastDistinguishedTreeHead(bytes: Readonly<Uint8Array> | null): Promise<void>;
getAccountData(aci: Aci): Promise<Uint8Array | null>;
setAccountData(aci: Aci, bytes: Readonly<Uint8Array>): Promise<void>;
}

@@ -39,3 +38,3 @@ /**

e164: string;
unidentifiedAccessKey: Readonly<Buffer>;
unidentifiedAccessKey: Readonly<Uint8Array>;
};

@@ -51,3 +50,3 @@ /**

e164Info?: E164Info;
usernameHash?: Readonly<Buffer>;
usernameHash?: Readonly<Uint8Array>;
};

@@ -54,0 +53,0 @@ /**

@@ -1,2 +0,1 @@

/// <reference types="node" />
import type { ReadonlyDeep } from 'type-fest';

@@ -148,4 +147,4 @@ import * as Native from '../../Native';

get number(): string;
get usernameHash(): Buffer | null;
get usernameLinkHandle(): Buffer | null;
get usernameHash(): Uint8Array | null;
get usernameLinkHandle(): Uint8Array | null;
get backupEntitlement(): {

@@ -152,0 +151,0 @@ backupLevel: bigint;

@@ -144,3 +144,3 @@ "use strict";

const capabilitiesArray = Array.from(capabilities);
this._nativeHandle = Native.RegistrationAccountAttributes_Create(Buffer.from(recoveryPassword), aciRegistrationId, pniRegistrationId, registrationLock, Buffer.from(unidentifiedAccessKey), unrestrictedUnidentifiedAccess, capabilitiesArray, discoverableByPhoneNumber);
this._nativeHandle = Native.RegistrationAccountAttributes_Create(recoveryPassword, aciRegistrationId, pniRegistrationId, registrationLock, unidentifiedAccessKey, unrestrictedUnidentifiedAccess, capabilitiesArray, discoverableByPhoneNumber);
}

@@ -147,0 +147,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
import * as Native from '../Native';

@@ -20,3 +19,3 @@ /**

export default class SealedSenderMultiRecipientMessage {
readonly _buffer: Buffer;
readonly _buffer: Uint8Array;
readonly _recipientMap: {

@@ -27,3 +26,3 @@ [serviceId: string]: Native.SealedSenderMultiRecipientMessageRecipient;

readonly _offsetOfSharedData: number;
constructor(buffer: Buffer);
constructor(buffer: Uint8Array);
/**

@@ -52,3 +51,3 @@ * Returns the recipients parsed from the message, keyed by service ID string.

*/
messageForRecipient(recipient: Recipient): Buffer;
messageForRecipient(recipient: Recipient): Uint8Array;
}

@@ -49,7 +49,9 @@ "use strict";

const nativeRecipient = recipient;
return Buffer.concat([
// Use Buffer.concat for convenience, but return a proper Uint8Array, both for the correct type
// and to make an independent copy of a possibly-reused buffer.
return new Uint8Array(Buffer.concat([
Buffer.of(0x22), // The "original" Sealed Sender V2 version
this._buffer.subarray(nativeRecipient.rangeOffset, nativeRecipient.rangeOffset + nativeRecipient.rangeLen),
this._buffer.subarray(this._offsetOfSharedData),
]);
]));
}

@@ -56,0 +58,0 @@ }

@@ -1,5 +0,4 @@

/// <reference types="node" />
export type UsernameLink = {
entropy: Buffer;
encryptedUsername: Buffer;
entropy: Uint8Array;
encryptedUsername: Uint8Array;
};

@@ -9,9 +8,9 @@ export declare function generateCandidates(nickname: string, minNicknameLength: number, maxNicknameLength: number): string[];

username: string;
hash: Buffer;
hash: Uint8Array;
};
export declare function hash(username: string): Buffer;
export declare function generateProof(username: string): Buffer;
export declare function generateProofWithRandom(username: string, random: Buffer): Buffer;
export declare function hash(username: string): Uint8Array;
export declare function generateProof(username: string): Uint8Array;
export declare function generateProofWithRandom(username: string, random: Uint8Array): Uint8Array;
export declare function decryptUsernameLink(usernameLink: UsernameLink): string;
export declare function createUsernameLink(username: string, previousEntropy?: Buffer): UsernameLink;
export declare function verifyProof(proof: Buffer, hash: Buffer): void;
export declare function createUsernameLink(username: string, previousEntropy?: Uint8Array): UsernameLink;
export declare function verifyProof(proof: Uint8Array, hash: Uint8Array): void;

@@ -42,4 +42,4 @@ "use strict";

const usernameLinkData = Native.UsernameLink_Create(username, previousEntropy ?? null);
const entropy = usernameLinkData.slice(0, 32);
const encryptedUsername = usernameLinkData.slice(32);
const entropy = usernameLinkData.subarray(0, 32);
const encryptedUsername = usernameLinkData.subarray(32);
return { entropy, encryptedUsername };

@@ -46,0 +46,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
/**

@@ -10,2 +9,2 @@ * Sanitize a WebP input.

*/
export declare function sanitize(input: Buffer): void;
export declare function sanitize(input: Uint8Array): void;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,3 +5,3 @@ import UuidCiphertext from '../groups/UuidCiphertext';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getUuidCiphertext(): UuidCiphertext;

@@ -9,0 +8,0 @@ getPniCiphertext(): UuidCiphertext;

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class AuthCredentialWithPni extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class AuthCredentialWithPniResponse extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ServerPublicParams from '../ServerPublicParams';

@@ -18,3 +17,3 @@ import AuthCredentialPresentation from './AuthCredentialPresentation';

createAuthCredentialWithPniPresentation(groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
createAuthCredentialWithPniPresentationWithRandom(random: Buffer, groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
createAuthCredentialWithPniPresentationWithRandom(random: Uint8Array, groupSecretParams: GroupSecretParams, authCredential: AuthCredentialWithPni): AuthCredentialPresentation;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ServerSecretParams from '../ServerSecretParams';

@@ -11,4 +10,4 @@ import AuthCredentialPresentation from './AuthCredentialPresentation';

issueAuthCredentialWithPniZkc(aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
issueAuthCredentialWithPniZkcWithRandom(random: Buffer, aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
issueAuthCredentialWithPniZkcWithRandom(random: Uint8Array, aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
verifyAuthCredentialPresentation(groupPublicParams: GroupPublicParams, authCredentialPresentation: AuthCredentialPresentation, now?: Date): void;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -9,8 +8,8 @@ import GenericServerPublicParams from '../GenericServerPublicParams';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
present(serverParams: GenericServerPublicParams): BackupAuthCredentialPresentation;
presentWithRandom(serverParams: GenericServerPublicParams, random: Buffer): BackupAuthCredentialPresentation;
getBackupId(): Buffer;
presentWithRandom(serverParams: GenericServerPublicParams, random: Uint8Array): BackupAuthCredentialPresentation;
getBackupId(): Uint8Array;
getBackupLevel(): BackupLevel;
getType(): BackupCredentialType;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -8,7 +7,7 @@ import GenericServerSecretParams from '../GenericServerSecretParams';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
verify(serverParams: GenericServerSecretParams, now?: Date): void;
getBackupId(): Buffer;
getBackupId(): Uint8Array;
getBackupLevel(): BackupLevel;
getType(): BackupCredentialType;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -9,5 +8,5 @@ import GenericServerSecretParams from '../GenericServerSecretParams';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
issueCredential(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams): BackupAuthCredentialResponse;
issueCredentialWithRandom(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams, random: Buffer): BackupAuthCredentialResponse;
issueCredentialWithRandom(timestamp: number, backupLevel: BackupLevel, type: BackupCredentialType, params: GenericServerSecretParams, random: Uint8Array): BackupAuthCredentialResponse;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -10,6 +9,6 @@ import BackupAuthCredentialRequest from './BackupAuthCredentialRequest';

private readonly __type?;
constructor(contents: Buffer);
static create(backupKey: Buffer, aci: Uuid): BackupAuthCredentialRequestContext;
constructor(contents: Uint8Array);
static create(backupKey: Uint8Array, aci: Uuid): BackupAuthCredentialRequestContext;
getRequest(): BackupAuthCredentialRequest;
receive(response: BackupAuthCredentialResponse, redemptionTime: number, params: GenericServerPublicParams): BackupAuthCredential;
}

@@ -17,3 +17,3 @@ "use strict";

static create(backupKey, aci) {
return new BackupAuthCredentialRequestContext(Native.BackupAuthCredentialRequestContext_New(backupKey, Buffer.from(uuid.parse(aci))));
return new BackupAuthCredentialRequestContext(Native.BackupAuthCredentialRequestContext_New(backupKey, uuid.parse(aci)));
}

@@ -20,0 +20,0 @@ getRequest() {

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class BackupAuthCredentialResponse extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -9,5 +8,5 @@ import CallLinkSecretParams from './CallLinkSecretParams';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
present(userId: Aci, redemptionTime: number, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams): CallLinkAuthCredentialPresentation;
presentWithRandom(userId: Aci, redemptionTime: number, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random: Buffer): CallLinkAuthCredentialPresentation;
presentWithRandom(userId: Aci, redemptionTime: number, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random: Uint8Array): CallLinkAuthCredentialPresentation;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -8,5 +7,5 @@ import CallLinkPublicParams from './CallLinkPublicParams';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
verify(serverParams: GenericServerSecretParams, callLinkParams: CallLinkPublicParams, now?: Date): void;
getUserId(): UuidCiphertext;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -9,6 +8,6 @@ import GenericServerSecretParams from '../GenericServerSecretParams';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
static issueCredential(userId: Aci, redemptionTime: number, params: GenericServerSecretParams): CallLinkAuthCredentialResponse;
static issueCredentialWithRandom(userId: Aci, redemptionTime: number, params: GenericServerSecretParams, random: Buffer): CallLinkAuthCredentialResponse;
static issueCredentialWithRandom(userId: Aci, redemptionTime: number, params: GenericServerSecretParams, random: Uint8Array): CallLinkAuthCredentialResponse;
receive(userId: Aci, redemptionTime: number, params: GenericServerPublicParams): CallLinkAuthCredential;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class CallLinkPublicParams extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -8,4 +7,4 @@ import CallLinkPublicParams from './CallLinkPublicParams';

private readonly __type?;
static deriveFromRootKey(callLinkRootKey: Buffer): CallLinkSecretParams;
constructor(contents: Buffer);
static deriveFromRootKey(callLinkRootKey: Uint8Array): CallLinkSecretParams;
constructor(contents: Uint8Array);
getPublicParams(): CallLinkPublicParams;

@@ -12,0 +11,0 @@ decryptUserId(userId: UuidCiphertext): Aci;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -9,5 +8,5 @@ import CallLinkSecretParams from './CallLinkSecretParams';

private readonly __type?;
constructor(contents: Buffer);
present(roomId: Buffer, userId: Aci, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams): CreateCallLinkCredentialPresentation;
presentWithRandom(roomId: Buffer, userId: Aci, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random: Buffer): CreateCallLinkCredentialPresentation;
constructor(contents: Uint8Array);
present(roomId: Uint8Array, userId: Aci, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams): CreateCallLinkCredentialPresentation;
presentWithRandom(roomId: Uint8Array, userId: Aci, serverParams: GenericServerPublicParams, callLinkParams: CallLinkSecretParams, random: Uint8Array): CreateCallLinkCredentialPresentation;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -7,4 +6,4 @@ import CallLinkPublicParams from './CallLinkPublicParams';

private readonly __type?;
constructor(contents: Buffer);
verify(roomId: Buffer, serverParams: GenericServerSecretParams, callLinkParams: CallLinkPublicParams, now?: Date): void;
constructor(contents: Uint8Array);
verify(roomId: Uint8Array, serverParams: GenericServerSecretParams, callLinkParams: CallLinkPublicParams, now?: Date): void;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -8,5 +7,5 @@ import CreateCallLinkCredentialResponse from './CreateCallLinkCredentialResponse';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
issueCredential(userId: Aci, timestamp: number, params: GenericServerSecretParams): CreateCallLinkCredentialResponse;
issueCredentialWithRandom(userId: Aci, timestamp: number, params: GenericServerSecretParams, random: Buffer): CreateCallLinkCredentialResponse;
issueCredentialWithRandom(userId: Aci, timestamp: number, params: GenericServerSecretParams, random: Uint8Array): CreateCallLinkCredentialResponse;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -10,7 +9,7 @@ import CreateCallLinkCredentialRequest from './CreateCallLinkCredentialRequest';

private readonly __type?;
constructor(contents: Buffer);
static forRoomId(roomId: Buffer): CreateCallLinkCredentialRequestContext;
static forRoomIdWithRandom(roomId: Buffer, random: Buffer): CreateCallLinkCredentialRequestContext;
constructor(contents: Uint8Array);
static forRoomId(roomId: Uint8Array): CreateCallLinkCredentialRequestContext;
static forRoomIdWithRandom(roomId: Uint8Array, random: Uint8Array): CreateCallLinkCredentialRequestContext;
getRequest(): CreateCallLinkCredentialRequest;
receive(response: CreateCallLinkCredentialResponse, userId: Aci, params: GenericServerPublicParams): CreateCallLinkCredential;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class CreateCallLinkCredentialResponse extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from './internal/ByteArray';
export default class GenericServerPublicParams extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from './internal/ByteArray';

@@ -7,5 +6,5 @@ import GenericServerPublicParams from './GenericServerPublicParams';

static generate(): GenericServerSecretParams;
static generateWithRandom(random: Buffer): GenericServerSecretParams;
constructor(contents: Buffer);
static generateWithRandom(random: Uint8Array): GenericServerSecretParams;
constructor(contents: Uint8Array);
getPublicParams(): GenericServerPublicParams;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import UuidCiphertext from './UuidCiphertext';

@@ -14,5 +13,5 @@ import ProfileKeyCiphertext from './ProfileKeyCiphertext';

decryptProfileKey(profileKeyCiphertext: ProfileKeyCiphertext, userId: Aci): ProfileKey;
encryptBlob(plaintext: Buffer): Buffer;
encryptBlobWithRandom(random: Buffer, plaintext: Buffer): Buffer;
decryptBlob(blobCiphertext: Buffer): Buffer;
encryptBlob(plaintext: Uint8Array): Uint8Array;
encryptBlobWithRandom(random: Uint8Array, plaintext: Uint8Array): Uint8Array;
decryptBlob(blobCiphertext: Uint8Array): Uint8Array;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,5 +5,5 @@ export default class GroupIdentifier extends ByteArray {

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
/** Returns the group ID as a base64 string (with padding). */
toString(): string;
}

@@ -14,3 +14,3 @@ "use strict";

toString() {
return this.contents.toString('base64');
return Buffer.from(this.contents).toString('base64');
}

@@ -17,0 +17,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,3 +5,3 @@ export default class GroupMasterKey extends ByteArray {

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,4 +5,4 @@ import GroupIdentifier from './GroupIdentifier';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getGroupIdentifier(): GroupIdentifier;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -8,7 +7,7 @@ import GroupMasterKey from './GroupMasterKey';

static generate(): GroupSecretParams;
static generateWithRandom(random: Buffer): GroupSecretParams;
static generateWithRandom(random: Uint8Array): GroupSecretParams;
static deriveFromMasterKey(groupMasterKey: GroupMasterKey): GroupSecretParams;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getMasterKey(): GroupMasterKey;
getPublicParams(): GroupPublicParams;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ProfileKeyCiphertext extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,7 +0,6 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class UuidCiphertext extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
static serializeAndConcatenate(ciphertexts: UuidCiphertext[]): Buffer;
constructor(contents: Uint8Array);
static serializeAndConcatenate(ciphertexts: UuidCiphertext[]): Uint8Array;
}

@@ -15,6 +15,6 @@ "use strict";

if (ciphertexts.length == 0) {
return Buffer.of();
return Uint8Array.of();
}
const uuidCiphertextLen = ciphertexts[0].contents.length;
const concatenated = Buffer.alloc(ciphertexts.length * uuidCiphertextLen);
const concatenated = new Uint8Array(ciphertexts.length * uuidCiphertextLen);
let offset = 0;

@@ -21,0 +21,0 @@ for (const next of ciphertexts) {

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -16,3 +15,3 @@ import ServerSecretParams from '../ServerSecretParams';

export default class GroupSendDerivedKeyPair extends ByteArray {
constructor(contents: Buffer);
constructor(contents: Uint8Array);
/**

@@ -19,0 +18,0 @@ * Derives a new key for group send endorsements that expire at `expiration`.

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray, { UNCHECKED_AND_UNCLONED } from '../internal/ByteArray';

@@ -35,3 +34,3 @@ import GroupSecretParams from '../groups/GroupSecretParams';

export default class GroupSendEndorsement extends ByteArray {
constructor(contents: Buffer, marker?: typeof UNCHECKED_AND_UNCLONED);
constructor(contents: Uint8Array, marker?: typeof UNCHECKED_AND_UNCLONED);
/**

@@ -38,0 +37,0 @@ * Combines several endorsements into one.

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -29,3 +28,3 @@ import GroupSecretParams from '../groups/GroupSecretParams';

export default class GroupSendEndorsementsResponse extends ByteArray {
constructor(contents: Buffer);
constructor(contents: Uint8Array);
/**

@@ -45,3 +44,3 @@ * Issues a new set of endorsements for `groupMembers`.

*/
static issueWithRandom(groupMembers: UuidCiphertext[], keyPair: GroupSendDerivedKeyPair, random: Buffer): GroupSendEndorsementsResponse;
static issueWithRandom(groupMembers: UuidCiphertext[], keyPair: GroupSendDerivedKeyPair, random: Uint8Array): GroupSendEndorsementsResponse;
/** Returns the expiration for the contained endorsements. */

@@ -48,0 +47,0 @@ getExpiration(): Date;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -12,3 +11,3 @@ import { ServiceId } from '../../Address';

export default class GroupSendFullToken extends ByteArray {
constructor(contents: Buffer);
constructor(contents: Uint8Array);
/** Gets the expiration embedded in the token. */

@@ -15,0 +14,0 @@ getExpiration(): Date;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -14,3 +13,3 @@ import GroupSendFullToken from './GroupSendFullToken';

export default class GroupSendToken extends ByteArray {
constructor(contents: Buffer);
constructor(contents: Uint8Array);
/**

@@ -17,0 +16,0 @@ * Converts this token to a "full token", which can be sent to the chat server as authentication.

@@ -1,9 +0,8 @@

/// <reference types="node" />
export declare const UNCHECKED_AND_UNCLONED: unique symbol;
export default class ByteArray {
contents: Buffer;
protected constructor(contents: Buffer, checkValid: ((contents: Buffer) => void) | typeof UNCHECKED_AND_UNCLONED);
protected static checkLength(expectedLength: number): (contents: Buffer) => void;
getContents(): Buffer;
serialize(): Buffer;
contents: Uint8Array;
protected constructor(contents: Uint8Array, checkValid: ((contents: Uint8Array) => void) | typeof UNCHECKED_AND_UNCLONED);
protected static checkLength(expectedLength: number): (contents: Uint8Array) => void;
getContents(): Uint8Array;
serialize(): Uint8Array;
}

@@ -18,3 +18,3 @@ "use strict";

checkValid.call(Native, contents);
this.contents = Buffer.from(contents);
this.contents = Uint8Array.from(contents);
}

@@ -33,3 +33,3 @@ }

serialize() {
return Buffer.from(this.contents);
return Uint8Array.from(this.contents);
}

@@ -36,0 +36,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from './internal/ByteArray';

@@ -6,3 +5,3 @@ export default class NotarySignature extends ByteArray {

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ServerPublicParams from '../ServerPublicParams';

@@ -14,6 +13,6 @@ import GroupSecretParams from '../groups/GroupSecretParams';

createProfileKeyCredentialRequestContext(userId: Aci, profileKey: ProfileKey): ProfileKeyCredentialRequestContext;
createProfileKeyCredentialRequestContextWithRandom(random: Buffer, userId: Aci, profileKey: ProfileKey): ProfileKeyCredentialRequestContext;
createProfileKeyCredentialRequestContextWithRandom(random: Uint8Array, userId: Aci, profileKey: ProfileKey): ProfileKeyCredentialRequestContext;
receiveExpiringProfileKeyCredential(profileKeyCredentialRequestContext: ProfileKeyCredentialRequestContext, profileKeyCredentialResponse: ExpiringProfileKeyCredentialResponse, now?: Date): ExpiringProfileKeyCredential;
createExpiringProfileKeyCredentialPresentation(groupSecretParams: GroupSecretParams, profileKeyCredential: ExpiringProfileKeyCredential): ProfileKeyCredentialPresentation;
createExpiringProfileKeyCredentialPresentationWithRandom(random: Buffer, groupSecretParams: GroupSecretParams, profileKeyCredential: ExpiringProfileKeyCredential): ProfileKeyCredentialPresentation;
createExpiringProfileKeyCredentialPresentationWithRandom(random: Uint8Array, groupSecretParams: GroupSecretParams, profileKeyCredential: ExpiringProfileKeyCredential): ProfileKeyCredentialPresentation;
}

@@ -1,7 +0,6 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ExpiringProfileKeyCredential extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getExpirationTime(): Date;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ExpiringProfileKeyCredentialResponse extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -9,6 +8,6 @@ import ProfileKeyCommitment from './ProfileKeyCommitment';

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getCommitment(userId: Aci): ProfileKeyCommitment;
getProfileKeyVersion(userId: Aci): ProfileKeyVersion;
deriveAccessKey(): Buffer;
deriveAccessKey(): Uint8Array;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ProfileKeyCommitment extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -7,5 +6,5 @@ import UuidCiphertext from '../groups/UuidCiphertext';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getUuidCiphertext(): UuidCiphertext;
getProfileKeyCiphertext(): ProfileKeyCiphertext;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ProfileKeyCredentialRequest extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,4 +5,4 @@ import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest';

private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getRequest(): ProfileKeyCredentialRequest;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,4 +5,4 @@ export default class ProfileKeyVersion extends ByteArray {

static SIZE: number;
constructor(contents: Buffer | string);
constructor(contents: Uint8Array | string);
toString(): string;
}

@@ -10,6 +10,8 @@ "use strict";

constructor(contents) {
super(typeof contents === 'string' ? Buffer.from(contents) : contents, ProfileKeyVersion.checkLength(ProfileKeyVersion.SIZE));
super(typeof contents === 'string'
? new TextEncoder().encode(contents)
: contents, ProfileKeyVersion.checkLength(ProfileKeyVersion.SIZE));
}
toString() {
return this.contents.toString('utf8');
return new TextDecoder().decode(this.contents);
}

@@ -16,0 +18,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ServerSecretParams from '../ServerSecretParams';

@@ -13,4 +12,4 @@ import GroupPublicParams from '../groups/GroupPublicParams';

issueExpiringProfileKeyCredential(profileKeyCredentialRequest: ProfileKeyCredentialRequest, userId: Aci, profileKeyCommitment: ProfileKeyCommitment, expirationInSeconds: number): ExpiringProfileKeyCredentialResponse;
issueExpiringProfileKeyCredentialWithRandom(random: Buffer, profileKeyCredentialRequest: ProfileKeyCredentialRequest, userId: Aci, profileKeyCommitment: ProfileKeyCommitment, expirationInSeconds: number): ExpiringProfileKeyCredentialResponse;
issueExpiringProfileKeyCredentialWithRandom(random: Uint8Array, profileKeyCredentialRequest: ProfileKeyCredentialRequest, userId: Aci, profileKeyCommitment: ProfileKeyCommitment, expirationInSeconds: number): ExpiringProfileKeyCredentialResponse;
verifyProfileKeyCredentialPresentation(groupPublicParams: GroupPublicParams, profileKeyCredentialPresentation: ProfileKeyCredentialPresentation, now?: Date): void;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ServerPublicParams from '../ServerPublicParams';

@@ -12,6 +11,6 @@ import ReceiptCredential from './ReceiptCredential';

createReceiptCredentialRequestContext(receiptSerial: ReceiptSerial): ReceiptCredentialRequestContext;
createReceiptCredentialRequestContextWithRandom(random: Buffer, receiptSerial: ReceiptSerial): ReceiptCredentialRequestContext;
createReceiptCredentialRequestContextWithRandom(random: Uint8Array, receiptSerial: ReceiptSerial): ReceiptCredentialRequestContext;
receiveReceiptCredential(receiptCredentialRequestContext: ReceiptCredentialRequestContext, receiptCredentialResponse: ReceiptCredentialResponse): ReceiptCredential;
createReceiptCredentialPresentation(receiptCredential: ReceiptCredential): ReceiptCredentialPresentation;
createReceiptCredentialPresentationWithRandom(random: Buffer, receiptCredential: ReceiptCredential): ReceiptCredentialPresentation;
createReceiptCredentialPresentationWithRandom(random: Uint8Array, receiptCredential: ReceiptCredential): ReceiptCredentialPresentation;
}

@@ -1,8 +0,7 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ReceiptCredential extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getReceiptExpirationTime(): number;
getReceiptLevel(): bigint;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -7,3 +6,3 @@ import ReceiptSerial from './ReceiptSerial';

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getReceiptExpirationTime(): number;

@@ -10,0 +9,0 @@ getReceiptLevel(): bigint;

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ReceiptCredentialRequest extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -7,4 +6,4 @@ import ReceiptCredentialRequest from './ReceiptCredentialRequest';

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
getRequest(): ReceiptCredentialRequest;
}

@@ -1,6 +0,5 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';
export default class ReceiptCredentialResponse extends ByteArray {
private readonly __type?;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ByteArray from '../internal/ByteArray';

@@ -6,3 +5,3 @@ export default class ReceiptSerial extends ByteArray {

static SIZE: number;
constructor(contents: Buffer);
constructor(contents: Uint8Array);
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import ServerSecretParams from '../ServerSecretParams';

@@ -10,4 +9,4 @@ import ReceiptCredentialRequest from './ReceiptCredentialRequest';

issueReceiptCredential(receiptCredentialRequest: ReceiptCredentialRequest, receiptExpirationTime: number, receiptLevel: bigint): ReceiptCredentialResponse;
issueReceiptCredentialWithRandom(random: Buffer, receiptCredentialRequest: ReceiptCredentialRequest, receiptExpirationTime: number, receiptLevel: bigint): ReceiptCredentialResponse;
issueReceiptCredentialWithRandom(random: Uint8Array, receiptCredentialRequest: ReceiptCredentialRequest, receiptExpirationTime: number, receiptLevel: bigint): ReceiptCredentialResponse;
verifyReceiptCredentialPresentation(receiptCredentialPresentation: ReceiptCredentialPresentation): void;
}

@@ -1,2 +0,1 @@

/// <reference types="node" />
import * as Native from '../../Native';

@@ -6,3 +5,3 @@ import NotarySignature from './NotarySignature';

readonly _nativeHandle: Native.ServerPublicParams;
constructor(contents: Buffer | Native.ServerPublicParams);
constructor(contents: Uint8Array | Native.ServerPublicParams);
/**

@@ -13,5 +12,5 @@ * Get the serialized form of the params' endorsement key.

*/
getEndorsementPublicKey(): Buffer;
verifySignature(message: Buffer, notarySignature: NotarySignature): void;
serialize(): Buffer;
getEndorsementPublicKey(): Uint8Array;
verifySignature(message: Uint8Array, notarySignature: NotarySignature): void;
serialize(): Uint8Array;
}

@@ -10,3 +10,3 @@ "use strict";

constructor(contents) {
if (contents instanceof Buffer) {
if (contents instanceof Uint8Array) {
this._nativeHandle = Native.ServerPublicParams_Deserialize(contents);

@@ -13,0 +13,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
import * as Native from '../../Native';

@@ -7,9 +6,9 @@ import ServerPublicParams from './ServerPublicParams';

static generate(): ServerSecretParams;
static generateWithRandom(random: Buffer): ServerSecretParams;
static generateWithRandom(random: Uint8Array): ServerSecretParams;
readonly _nativeHandle: Native.ServerSecretParams;
constructor(contents: Buffer | Native.ServerSecretParams);
constructor(contents: Uint8Array | Native.ServerSecretParams);
getPublicParams(): ServerPublicParams;
sign(message: Buffer): NotarySignature;
signWithRandom(random: Buffer, message: Buffer): NotarySignature;
serialize(): Buffer;
sign(message: Uint8Array): NotarySignature;
signWithRandom(random: Uint8Array, message: Uint8Array): NotarySignature;
serialize(): Uint8Array;
}

@@ -21,3 +21,3 @@ "use strict";

constructor(contents) {
if (contents instanceof Buffer) {
if (contents instanceof Uint8Array) {
this._nativeHandle = Native.ServerSecretParams_Deserialize(contents);

@@ -24,0 +24,0 @@ }

{
"name": "@signalapp/libsignal-client",
"version": "0.74.1",
"version": "0.75.0",
"license": "AGPL-3.0-only",

@@ -31,3 +31,3 @@ "main": "dist/index.js",

"format-check": "p() { prettier ${@:- --check} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.d.ts.in; }; p",
"prepack": "cp ../acknowledgments/acknowledgments.md dist"
"prepack": "cp ../acknowledgments/acknowledgments-desktop.md dist/acknowledgments.md"
},

@@ -34,0 +34,0 @@ "dependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet