Update all Uint8Array/Buffer to use ArrayBuffer

Co-authored-by: Jordan Rose <jrose@signal.org>
This commit is contained in:
Jamie
2026-03-16 18:55:17 -07:00
committed by GitHub
parent 863219012f
commit 8bfbd12323
110 changed files with 838 additions and 762 deletions

10
Cargo.lock generated
View File

@@ -2542,7 +2542,7 @@ dependencies = [
[[package]]
name = "libsignal-ffi"
version = "0.88.4"
version = "0.89.0"
dependencies = [
"cpufeatures",
"hex",
@@ -2563,14 +2563,14 @@ dependencies = [
[[package]]
name = "libsignal-jni"
version = "0.88.4"
version = "0.89.0"
dependencies = [
"libsignal-jni-impl",
]
[[package]]
name = "libsignal-jni-impl"
version = "0.88.4"
version = "0.89.0"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -2587,7 +2587,7 @@ dependencies = [
[[package]]
name = "libsignal-jni-testing"
version = "0.88.4"
version = "0.89.0"
dependencies = [
"jni",
"libsignal-bridge-testing",
@@ -2902,7 +2902,7 @@ dependencies = [
[[package]]
name = "libsignal-node"
version = "0.88.4"
version = "0.89.0"
dependencies = [
"futures",
"libsignal-bridge",

View File

@@ -37,7 +37,7 @@ default-members = [
resolver = "2" # so that our dev-dependency features don't leak into products
[workspace.package]
version = "0.88.4"
version = "0.89.0"
authors = ["Signal Messenger LLC"]
license = "AGPL-3.0-only"
rust-version = "1.88"

View File

@@ -5,7 +5,7 @@
Pod::Spec.new do |s|
s.name = 'LibSignalClient'
s.version = '0.88.4'
s.version = '0.89.0'
s.summary = 'A Swift wrapper library for communicating with the Signal messaging service.'
s.homepage = 'https://github.com/signalapp/libsignal'

View File

@@ -1,3 +1,4 @@
v0.88.4
v0.89.0
- Node: Implementing `IdentityKeyStore.getIdentityKeyPair()` can avoid rederivation of the public key from the existing `IdentityKeyStore.getIdentityKey()` requirement. In the future, the PrivateKey-only `getIdentityKey()` will be removed.
- Node: Update all uses of `Uint8Array` and `Buffer` to use `ArrayBuffer`

View File

@@ -23,7 +23,7 @@ repositories {
}
allprojects {
version = "0.88.4"
version = "0.89.0"
group = "org.signal"
tasks.withType(JavaCompile) {

42
node/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@signalapp/libsignal-client",
"version": "0.88.4",
"version": "0.89.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@signalapp/libsignal-client",
"version": "0.88.4",
"version": "0.89.0",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
"dependencies": {
@@ -23,7 +23,7 @@
"@types/chai-as-promised": "^8.0.2",
"@types/chance": "^1.1.3",
"@types/mocha": "^10.0.10",
"@types/node": "~20.11.0",
"@types/node": "^24.12.0",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^4.0.0",
"@typescript-eslint/parser": "^8.44.0",
@@ -48,7 +48,7 @@
"sinon": "^21.0.0",
"sinon-chai": "^4.0.1",
"source-map-support": "^0.5.19",
"typescript": "5.3.3",
"typescript": "5.9.3",
"typescript-eslint": "^8.44.0"
}
},
@@ -797,12 +797,13 @@
"dev": true
},
"node_modules/@types/node": {
"version": "20.11.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
"integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"version": "24.12.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
"integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~5.26.4"
"undici-types": "~7.16.0"
}
},
"node_modules/@types/sinon": {
@@ -873,7 +874,6 @@
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.44.0.tgz",
"integrity": "sha512-VGMpFQGUQWYT9LfnPcX8ouFojyrZ/2w3K5BucvxL/spdNehccKhB4jUyB1yBCXpr2XFm0jkECxgrpXBW2ipoAw==",
"dev": true,
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.44.0",
"@typescript-eslint/types": "8.44.0",
@@ -1071,7 +1071,6 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -1474,7 +1473,6 @@
"resolved": "https://registry.npmjs.org/chai/-/chai-6.0.1.tgz",
"integrity": "sha512-/JOoU2//6p5vCXh00FpNgtlw0LjvhGttaWc+y7wpW9yjBm3ys0dI8tSKZxIOgNruz5J0RleccatSIC3uxEZP0g==",
"dev": true,
"peer": true,
"engines": {
"node": ">=18"
}
@@ -2070,7 +2068,6 @@
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.35.0.tgz",
"integrity": "sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg==",
"dev": true,
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -2230,7 +2227,6 @@
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz",
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
"dev": true,
"peer": true,
"dependencies": {
"@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.9",
@@ -4401,7 +4397,6 @@
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"peer": true,
"bin": {
"prettier": "bin-prettier.js"
},
@@ -5125,7 +5120,6 @@
"resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.0.tgz",
"integrity": "sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==",
"dev": true,
"peer": true,
"dependencies": {
"@sinonjs/commons": "^3.0.1",
"@sinonjs/fake-timers": "^13.0.5",
@@ -5549,7 +5543,6 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"peer": true,
"engines": {
"node": ">=12"
},
@@ -5728,11 +5721,11 @@
}
},
"node_modules/typescript": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"peer": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -5792,10 +5785,11 @@
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"dev": true,
"license": "MIT"
},
"node_modules/unique-stream": {
"version": "2.3.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@signalapp/libsignal-client",
"version": "0.88.4",
"version": "0.89.0",
"repository": "github:signalapp/libsignal",
"license": "AGPL-3.0-only",
"type": "module",
@@ -46,7 +46,7 @@
"@types/chai-as-promised": "^8.0.2",
"@types/chance": "^1.1.3",
"@types/mocha": "^10.0.10",
"@types/node": "~20.11.0",
"@types/node": "^24.12.0",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^4.0.0",
"@typescript-eslint/parser": "^8.44.0",
@@ -71,7 +71,7 @@
"sinon": "^21.0.0",
"sinon-chai": "^4.0.1",
"source-map-support": "^0.5.19",
"typescript": "5.3.3",
"typescript": "5.9.3",
"typescript-eslint": "^8.44.0"
}
}

View File

@@ -49,7 +49,9 @@ export class AccountEntropyPool {
* `accountEntropyPool` must be a **validated** account entropy pool;
* passing an arbitrary string here is considered a programmer error.
*/
public static deriveSvrKey(accountEntropyPool: string): Uint8Array {
public static deriveSvrKey(
accountEntropyPool: string
): Uint8Array<ArrayBuffer> {
return Native.AccountEntropyPool_DeriveSvrKey(accountEntropyPool);
}
@@ -79,7 +81,7 @@ export class BackupKey extends ByteArray {
private readonly __type?: never;
static SIZE = 32;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, BackupKey.checkLength(BackupKey.SIZE));
}
@@ -100,7 +102,7 @@ export class BackupKey extends ByteArray {
*
* Used for both message and media backups.
*/
public deriveBackupId(aci: Aci): Uint8Array {
public deriveBackupId(aci: Aci): Uint8Array<ArrayBuffer> {
return Native.BackupKey_DeriveBackupId(
this.contents,
aci.getServiceIdFixedWidthBinary()
@@ -126,7 +128,7 @@ export class BackupKey extends ByteArray {
*
* Only relevant for message backup keys.
*/
public deriveLocalBackupMetadataKey(): Uint8Array {
public deriveLocalBackupMetadataKey(): Uint8Array<ArrayBuffer> {
return Native.BackupKey_DeriveLocalBackupMetadataKey(this.contents);
}
@@ -135,7 +137,7 @@ export class BackupKey extends ByteArray {
*
* Only relevant for media backup keys.
*/
public deriveMediaId(mediaName: string): Uint8Array {
public deriveMediaId(mediaName: string): Uint8Array<ArrayBuffer> {
return Native.BackupKey_DeriveMediaId(this.contents, mediaName);
}
@@ -146,7 +148,9 @@ export class BackupKey extends ByteArray {
*
* Only relevant for media backup keys.
*/
public deriveMediaEncryptionKey(mediaId: Uint8Array): Uint8Array {
public deriveMediaEncryptionKey(
mediaId: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.BackupKey_DeriveMediaEncryptionKey(this.contents, mediaId);
}
@@ -158,7 +162,9 @@ export class BackupKey extends ByteArray {
*
* Only relevant for media backup keys.
*/
public deriveThumbnailTransitEncryptionKey(mediaId: Uint8Array): Uint8Array {
public deriveThumbnailTransitEncryptionKey(
mediaId: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.BackupKey_DeriveThumbnailTransitEncryptionKey(
this.contents,
mediaId
@@ -176,7 +182,7 @@ export class BackupForwardSecrecyToken extends ByteArray {
private readonly __type?: never;
static SIZE = 32;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
BackupForwardSecrecyToken.checkLength(BackupForwardSecrecyToken.SIZE)

View File

@@ -7,6 +7,7 @@ import * as Native from './Native.js';
import * as uuid from 'uuid';
import { Buffer } from 'node:buffer';
import { parseUuid } from './uuid.js';
export enum ServiceIdKind {
Aci = 0,
@@ -22,10 +23,10 @@ const SERVICE_ID_FIXED_WIDTH_BINARY_LEN = 17;
* user on the Signal service.
*/
export abstract class ServiceId extends Object {
private readonly serviceIdFixedWidthBinary: Uint8Array;
private readonly serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>;
// This has to be public for `InstanceType<T>`, which we use below.
constructor(serviceIdFixedWidthBinary: Uint8Array) {
constructor(serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>) {
super();
if (serviceIdFixedWidthBinary.length != SERVICE_ID_FIXED_WIDTH_BINARY_LEN) {
throw new TypeError('invalid Service-Id-FixedWidthBinary');
@@ -38,7 +39,9 @@ export abstract class ServiceId extends Object {
// Because ServiceId is abstract, and TypeScript won't let us construct an abstract class.
// Strictly speaking we don't need the 'typeof' and 'InstanceType',
// but it's more consistent with the factory methods below.
this: new (serviceIdFixedWidthBinary: Uint8Array) => InstanceType<T>,
this: new (
serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>
) => InstanceType<T>,
uuidBytes: ArrayLike<number>,
kind: ServiceIdKind
): InstanceType<T> {
@@ -48,11 +51,11 @@ export abstract class ServiceId extends Object {
return new this(buffer);
}
getServiceIdBinary(): Uint8Array {
getServiceIdBinary(): Uint8Array<ArrayBuffer> {
return Native.ServiceId_ServiceIdBinary(this.serviceIdFixedWidthBinary);
}
getServiceIdFixedWidthBinary(): Uint8Array {
getServiceIdFixedWidthBinary(): Uint8Array<ArrayBuffer> {
return Uint8Array.from(this.serviceIdFixedWidthBinary);
}
@@ -76,7 +79,7 @@ export abstract class ServiceId extends Object {
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(
this: T,
serviceIdFixedWidthBinary: Uint8Array
serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>
): InstanceType<T> {
let result: ServiceId;
switch (serviceIdFixedWidthBinary[0]) {
@@ -94,7 +97,7 @@ export abstract class ServiceId extends Object {
static parseFromServiceIdBinary<T extends typeof ServiceId>(
this: T,
serviceIdBinary: Uint8Array
serviceIdBinary: Uint8Array<ArrayBuffer>
): InstanceType<T> {
const result = ServiceId.parseFromServiceIdFixedWidthBinary(
Native.ServiceId_ParseFromServiceIdBinary(serviceIdBinary)
@@ -116,7 +119,7 @@ export abstract class ServiceId extends Object {
return uuid.stringify(this.serviceIdFixedWidthBinary, 1);
}
getRawUuidBytes(): Uint8Array {
getRawUuidBytes(): Uint8Array<ArrayBuffer> {
return this.serviceIdFixedWidthBinary.subarray(1);
}
@@ -136,7 +139,9 @@ export abstract class ServiceId extends Object {
);
}
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]): Uint8Array {
static toConcatenatedFixedWidthBinary(
serviceIds: ServiceId[]
): Uint8Array<ArrayBuffer> {
const result = new Uint8Array(
serviceIds.length * SERVICE_ID_FIXED_WIDTH_BINARY_LEN
);
@@ -153,7 +158,7 @@ export class Aci extends ServiceId {
private readonly __type?: never;
static fromUuid(uuidString: string): Aci {
return this.fromUuidBytes(uuid.parse(uuidString));
return this.fromUuidBytes(parseUuid(uuidString));
}
static fromUuidBytes(uuidBytes: ArrayLike<number>): Aci {
@@ -165,7 +170,7 @@ export class Pni extends ServiceId {
private readonly __type?: never;
static fromUuid(uuidString: string): Pni {
return this.fromUuidBytes(uuid.parse(uuidString));
return this.fromUuidBytes(parseUuid(uuidString));
}
static fromUuidBytes(uuidBytes: ArrayLike<number>): Pni {

View File

@@ -16,7 +16,7 @@ export class PublicKey {
return new PublicKey(handle);
}
static deserialize(buf: Uint8Array): PublicKey {
static deserialize(buf: Uint8Array<ArrayBuffer>): PublicKey {
return new PublicKey(Native.PublicKey_Deserialize(buf));
}
@@ -24,19 +24,22 @@ export class PublicKey {
return Native.PublicKey_Equals(this, other);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.PublicKey_Serialize(this);
}
getPublicKeyBytes(): Uint8Array {
getPublicKeyBytes(): Uint8Array<ArrayBuffer> {
return Native.PublicKey_GetPublicKeyBytes(this);
}
verify(msg: Uint8Array, sig: Uint8Array): boolean {
verify(msg: Uint8Array<ArrayBuffer>, sig: Uint8Array<ArrayBuffer>): boolean {
return Native.PublicKey_Verify(this, msg, sig);
}
verifyAlternateIdentity(other: PublicKey, signature: Uint8Array): boolean {
verifyAlternateIdentity(
other: PublicKey,
signature: Uint8Array<ArrayBuffer>
): boolean {
return Native.IdentityKey_VerifyAlternateIdentity(this, other, signature);
}
@@ -53,10 +56,10 @@ export class PublicKey {
* @see PrivateKey#open
*/
seal(
msg: Uint8Array,
info: string | Uint8Array,
associatedData?: Uint8Array
): Uint8Array {
msg: Uint8Array<ArrayBuffer>,
info: string | Uint8Array<ArrayBuffer>,
associatedData?: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
const infoBuffer =
typeof info === 'string' ? new TextEncoder().encode(info) : info;
return Native.PublicKey_HpkeSeal(
@@ -83,19 +86,19 @@ export class PrivateKey {
return new PrivateKey(Native.PrivateKey_Generate());
}
static deserialize(buf: Uint8Array): PrivateKey {
static deserialize(buf: Uint8Array<ArrayBuffer>): PrivateKey {
return new PrivateKey(Native.PrivateKey_Deserialize(buf));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.PrivateKey_Serialize(this);
}
sign(msg: Uint8Array): Uint8Array {
sign(msg: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
return Native.PrivateKey_Sign(this, msg);
}
agree(other_key: PublicKey): Uint8Array {
agree(other_key: PublicKey): Uint8Array<ArrayBuffer> {
return Native.PrivateKey_Agree(this, other_key);
}
@@ -111,10 +114,10 @@ export class PrivateKey {
* `info` and `associatedData` must match those used during sealing.
*/
open(
ciphertext: Uint8Array,
info: string | Uint8Array,
associatedData?: Uint8Array
): Uint8Array {
ciphertext: Uint8Array<ArrayBuffer>,
info: string | Uint8Array<ArrayBuffer>,
associatedData?: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
const infoBuffer =
typeof info === 'string' ? new TextEncoder().encode(info) : info;
return Native.PrivateKey_HpkeOpen(
@@ -140,7 +143,7 @@ export class IdentityKeyPair {
return new IdentityKeyPair(privateKey.getPublicKey(), privateKey);
}
static deserialize(buffer: Uint8Array): IdentityKeyPair {
static deserialize(buffer: Uint8Array<ArrayBuffer>): IdentityKeyPair {
const [publicKey, privateKey] = Native.IdentityKeyPair_Deserialize(buffer);
return new IdentityKeyPair(
PublicKey._fromNativeHandle(publicKey),
@@ -148,11 +151,11 @@ export class IdentityKeyPair {
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.IdentityKeyPair_Serialize(this.publicKey, this.privateKey);
}
signAlternateIdentity(other: PublicKey): Uint8Array {
signAlternateIdentity(other: PublicKey): Uint8Array<ArrayBuffer> {
return Native.IdentityKeyPair_SignAlternateIdentity(
this.publicKey,
this.privateKey,

View File

@@ -72,7 +72,7 @@ export enum ErrorCode {
}
/** Called out as a separate type so it's not confused with a normal ServiceIdBinary. */
type ServiceIdFixedWidthBinary = Uint8Array;
type ServiceIdFixedWidthBinary = Uint8Array<ArrayBuffer>;
/**
* A failure sending to a recipient on account of not being up to date on their devices.

View File

@@ -55,8 +55,8 @@ export type MessageBackupKeyInput = Readonly<
forwardSecrecyToken?: BackupForwardSecrecyToken;
}
| {
backupKey: BackupKey | Uint8Array;
backupId: Uint8Array;
backupKey: BackupKey | Uint8Array<ArrayBuffer>;
backupId: Uint8Array<ArrayBuffer>;
forwardSecrecyToken?: BackupForwardSecrecyToken;
}
>;
@@ -101,12 +101,12 @@ export class MessageBackupKey {
}
/** An HMAC key used to sign a backup file. */
public get hmacKey(): Uint8Array {
public get hmacKey(): Uint8Array<ArrayBuffer> {
return Native.MessageBackupKey_GetHmacKey(this);
}
/** An AES-256-CBC key used to encrypt a backup file. */
public get aesKey(): Uint8Array {
public get aesKey(): Uint8Array<ArrayBuffer> {
return Native.MessageBackupKey_GetAesKey(this);
}
}
@@ -188,7 +188,7 @@ export class OnlineBackupValidator {
*
* @throws BackupValidationError on error
*/
constructor(backupInfo: Uint8Array, purpose: Purpose) {
constructor(backupInfo: Uint8Array<ArrayBuffer>, purpose: Purpose) {
this._nativeHandle = Native.OnlineBackupValidator_New(backupInfo, purpose);
}
@@ -199,7 +199,7 @@ export class OnlineBackupValidator {
*
* @throws BackupValidationError on error
*/
addFrame(frame: Uint8Array): void {
addFrame(frame: Uint8Array<ArrayBuffer>): void {
Native.OnlineBackupValidator_AddFrame(this, frame);
}
@@ -318,7 +318,7 @@ export class BackupJsonExporter {
* @throws Error if the input is invalid.
*/
public static start(
backupInfo: Uint8Array,
backupInfo: Uint8Array<ArrayBuffer>,
options?: { validate?: boolean }
): { exporter: BackupJsonExporter; chunk: string } {
const shouldValidate = options?.validate ?? true;
@@ -337,7 +337,9 @@ export class BackupJsonExporter {
* aborting.
* @throws Error if the input data cannot be parsed.
*/
public exportFrames(frames: Uint8Array): BackupJsonFrameResult[] {
public exportFrames(
frames: Uint8Array<ArrayBuffer>
): BackupJsonFrameResult[] {
return Native.BackupJsonExporter_ExportFrames(this, frames).map(
([line, errorMessage]) => ({
...(line !== null && { line }),

View File

@@ -5,6 +5,6 @@
import * as Native from './Native.js';
export function toJSONString(buffer: Uint8Array): string {
export function toJSONString(buffer: Uint8Array<ArrayBuffer>): string {
return Native.MinidumpToJSONString(buffer);
}

View File

@@ -56,7 +56,7 @@ export class SanitizedMetadata {
* Get the sanitized metadata, if any.
* @returns The sanitized metadata, or `null` if it didn't need to be sanitized.
*/
getMetadata(): Uint8Array | null {
getMetadata(): Uint8Array<ArrayBuffer> | null {
const metadata = Native.SanitizedMetadata_GetMetadata(this);
if (metadata.length == 0) {
return null;

View File

@@ -5,7 +5,7 @@
// WARNING: this file was automatically generated
export type Uuid = Uint8Array;
export type Uuid = Uint8Array<ArrayBuffer>;
/// A Native.Timestamp may be measured in seconds or in milliseconds;
/// what's important is that it's an integer less than Number.MAX_SAFE_INTEGER.
@@ -28,7 +28,7 @@ export type ChatResponse = {
status: number;
message: string | undefined;
headers: ReadonlyArray<[string, string]>;
body: Uint8Array | undefined;
body: Uint8Array<ArrayBuffer> | undefined;
};
export type ChatServiceDebugInfo = {
@@ -72,11 +72,11 @@ export type SessionStore = BridgeSessionStore;
export type SenderKeyStore = BridgeSenderKeyStore;
export type InputStream = {
_read: (amount: number) => Promise<Uint8Array>;
_read: (amount: number) => Promise<Uint8Array<ArrayBuffer>>;
_skip: (amount: number) => Promise<void>;
};
export type SyncInputStream = Uint8Array;
export type SyncInputStream = Uint8Array<ArrayBuffer>;
export type ChallengeOption = 'pushChallenge' | 'captcha';
@@ -103,8 +103,8 @@ export type CheckSvr2CredentialsResponse = Map<
export type SignedPublicPreKey = {
keyId: number;
publicKey: Uint8Array;
signature: Uint8Array;
publicKey: Uint8Array<ArrayBuffer>;
signature: Uint8Array<ArrayBuffer>;
};
export type Wrapper<T> = Readonly<{
@@ -128,7 +128,7 @@ export type CancellablePromise<T> = Promise<T> & {
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type Serialized<T> = Uint8Array;
export type Serialized<T> = Uint8Array<ArrayBuffer>;
type ConnectChatBridge = Wrapper<ConnectionManager>;
type TestingFutureCancellationGuard = Wrapper<TestingFutureCancellationCounter>;
@@ -138,94 +138,94 @@ import load from 'node-gyp-build';
type NativeFunctions = {
registerErrors: (errorsModule: Record<string, unknown>) => void;
initLogger: (maxLevel: LogLevel, callback: (level: LogLevel, target: string, file: string | null, line: number | null, message: string) => void) => void
SealedSenderMultiRecipientMessage_Parse: (buffer: Uint8Array) => SealedSenderMultiRecipientMessage;
MinidumpToJSONString: (buffer: Uint8Array) => string;
Aes256GcmSiv_New: (key: Uint8Array) => Aes256GcmSiv;
Aes256GcmSiv_Encrypt: (aesGcmSivObj: Wrapper<Aes256GcmSiv>, ptext: Uint8Array, nonce: Uint8Array, associatedData: Uint8Array) => Uint8Array;
Aes256GcmSiv_Decrypt: (aesGcmSiv: Wrapper<Aes256GcmSiv>, ctext: Uint8Array, nonce: Uint8Array, associatedData: Uint8Array) => Uint8Array;
PublicKey_HpkeSeal: (pk: Wrapper<PublicKey>, plaintext: Uint8Array, info: Uint8Array, associatedData: Uint8Array) => Uint8Array;
PrivateKey_HpkeOpen: (sk: Wrapper<PrivateKey>, ciphertext: Uint8Array, info: Uint8Array, associatedData: Uint8Array) => Uint8Array;
HKDF_DeriveSecrets: (outputLength: number, ikm: Uint8Array, label: Uint8Array | null, salt: Uint8Array | null) => Uint8Array;
ServiceId_ServiceIdBinary: (value: Uint8Array) => Uint8Array;
ServiceId_ServiceIdString: (value: Uint8Array) => string;
ServiceId_ServiceIdLog: (value: Uint8Array) => string;
ServiceId_ParseFromServiceIdBinary: (input: Uint8Array) => Uint8Array;
ServiceId_ParseFromServiceIdString: (input: string) => Uint8Array;
SealedSenderMultiRecipientMessage_Parse: (buffer: Uint8Array<ArrayBuffer>) => SealedSenderMultiRecipientMessage;
MinidumpToJSONString: (buffer: Uint8Array<ArrayBuffer>) => string;
Aes256GcmSiv_New: (key: Uint8Array<ArrayBuffer>) => Aes256GcmSiv;
Aes256GcmSiv_Encrypt: (aesGcmSivObj: Wrapper<Aes256GcmSiv>, ptext: Uint8Array<ArrayBuffer>, nonce: Uint8Array<ArrayBuffer>, associatedData: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
Aes256GcmSiv_Decrypt: (aesGcmSiv: Wrapper<Aes256GcmSiv>, ctext: Uint8Array<ArrayBuffer>, nonce: Uint8Array<ArrayBuffer>, associatedData: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
PublicKey_HpkeSeal: (pk: Wrapper<PublicKey>, plaintext: Uint8Array<ArrayBuffer>, info: Uint8Array<ArrayBuffer>, associatedData: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
PrivateKey_HpkeOpen: (sk: Wrapper<PrivateKey>, ciphertext: Uint8Array<ArrayBuffer>, info: Uint8Array<ArrayBuffer>, associatedData: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
HKDF_DeriveSecrets: (outputLength: number, ikm: Uint8Array<ArrayBuffer>, label: Uint8Array<ArrayBuffer> | null, salt: Uint8Array<ArrayBuffer> | null) => Uint8Array<ArrayBuffer>;
ServiceId_ServiceIdBinary: (value: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ServiceId_ServiceIdString: (value: Uint8Array<ArrayBuffer>) => string;
ServiceId_ServiceIdLog: (value: Uint8Array<ArrayBuffer>) => string;
ServiceId_ParseFromServiceIdBinary: (input: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ServiceId_ParseFromServiceIdString: (input: string) => Uint8Array<ArrayBuffer>;
ProtocolAddress_New: (name: string, deviceId: number) => ProtocolAddress;
PublicKey_Deserialize: (data: Uint8Array) => PublicKey;
PublicKey_Serialize: (obj: Wrapper<PublicKey>) => Uint8Array;
PublicKey_GetPublicKeyBytes: (obj: Wrapper<PublicKey>) => Uint8Array;
PublicKey_Deserialize: (data: Uint8Array<ArrayBuffer>) => PublicKey;
PublicKey_Serialize: (obj: Wrapper<PublicKey>) => Uint8Array<ArrayBuffer>;
PublicKey_GetPublicKeyBytes: (obj: Wrapper<PublicKey>) => Uint8Array<ArrayBuffer>;
ProtocolAddress_DeviceId: (obj: Wrapper<ProtocolAddress>) => number;
ProtocolAddress_Name: (obj: Wrapper<ProtocolAddress>) => string;
PublicKey_Equals: (lhs: Wrapper<PublicKey>, rhs: Wrapper<PublicKey>) => boolean;
PublicKey_Verify: (key: Wrapper<PublicKey>, message: Uint8Array, signature: Uint8Array) => boolean;
PrivateKey_Deserialize: (data: Uint8Array) => PrivateKey;
PrivateKey_Serialize: (obj: Wrapper<PrivateKey>) => Uint8Array;
PublicKey_Verify: (key: Wrapper<PublicKey>, message: Uint8Array<ArrayBuffer>, signature: Uint8Array<ArrayBuffer>) => boolean;
PrivateKey_Deserialize: (data: Uint8Array<ArrayBuffer>) => PrivateKey;
PrivateKey_Serialize: (obj: Wrapper<PrivateKey>) => Uint8Array<ArrayBuffer>;
PrivateKey_Generate: () => PrivateKey;
PrivateKey_GetPublicKey: (k: Wrapper<PrivateKey>) => PublicKey;
PrivateKey_Sign: (key: Wrapper<PrivateKey>, message: Uint8Array) => Uint8Array;
PrivateKey_Agree: (privateKey: Wrapper<PrivateKey>, publicKey: Wrapper<PublicKey>) => Uint8Array;
KyberPublicKey_Serialize: (obj: Wrapper<KyberPublicKey>) => Uint8Array;
KyberPublicKey_Deserialize: (data: Uint8Array) => KyberPublicKey;
KyberSecretKey_Serialize: (obj: Wrapper<KyberSecretKey>) => Uint8Array;
KyberSecretKey_Deserialize: (data: Uint8Array) => KyberSecretKey;
PrivateKey_Sign: (key: Wrapper<PrivateKey>, message: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
PrivateKey_Agree: (privateKey: Wrapper<PrivateKey>, publicKey: Wrapper<PublicKey>) => Uint8Array<ArrayBuffer>;
KyberPublicKey_Serialize: (obj: Wrapper<KyberPublicKey>) => Uint8Array<ArrayBuffer>;
KyberPublicKey_Deserialize: (data: Uint8Array<ArrayBuffer>) => KyberPublicKey;
KyberSecretKey_Serialize: (obj: Wrapper<KyberSecretKey>) => Uint8Array<ArrayBuffer>;
KyberSecretKey_Deserialize: (data: Uint8Array<ArrayBuffer>) => KyberSecretKey;
KyberPublicKey_Equals: (lhs: Wrapper<KyberPublicKey>, rhs: Wrapper<KyberPublicKey>) => boolean;
KyberKeyPair_Generate: () => KyberKeyPair;
KyberKeyPair_GetPublicKey: (keyPair: Wrapper<KyberKeyPair>) => KyberPublicKey;
KyberKeyPair_GetSecretKey: (keyPair: Wrapper<KyberKeyPair>) => KyberSecretKey;
IdentityKeyPair_Serialize: (publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>) => Uint8Array;
IdentityKeyPair_Deserialize: (input: Uint8Array) => [PublicKey, PrivateKey];
IdentityKeyPair_SignAlternateIdentity: (publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>, otherIdentity: Wrapper<PublicKey>) => Uint8Array;
IdentityKey_VerifyAlternateIdentity: (publicKey: Wrapper<PublicKey>, otherIdentity: Wrapper<PublicKey>, signature: Uint8Array) => boolean;
Fingerprint_New: (iterations: number, version: number, localIdentifier: Uint8Array, localKey: Wrapper<PublicKey>, remoteIdentifier: Uint8Array, remoteKey: Wrapper<PublicKey>) => Fingerprint;
Fingerprint_ScannableEncoding: (obj: Wrapper<Fingerprint>) => Uint8Array;
IdentityKeyPair_Serialize: (publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>) => Uint8Array<ArrayBuffer>;
IdentityKeyPair_Deserialize: (input: Uint8Array<ArrayBuffer>) => [PublicKey, PrivateKey];
IdentityKeyPair_SignAlternateIdentity: (publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>, otherIdentity: Wrapper<PublicKey>) => Uint8Array<ArrayBuffer>;
IdentityKey_VerifyAlternateIdentity: (publicKey: Wrapper<PublicKey>, otherIdentity: Wrapper<PublicKey>, signature: Uint8Array<ArrayBuffer>) => boolean;
Fingerprint_New: (iterations: number, version: number, localIdentifier: Uint8Array<ArrayBuffer>, localKey: Wrapper<PublicKey>, remoteIdentifier: Uint8Array<ArrayBuffer>, remoteKey: Wrapper<PublicKey>) => Fingerprint;
Fingerprint_ScannableEncoding: (obj: Wrapper<Fingerprint>) => Uint8Array<ArrayBuffer>;
Fingerprint_DisplayString: (obj: Wrapper<Fingerprint>) => string;
ScannableFingerprint_Compare: (fprint1: Uint8Array, fprint2: Uint8Array) => boolean;
SignalMessage_Deserialize: (data: Uint8Array) => SignalMessage;
SignalMessage_GetBody: (obj: Wrapper<SignalMessage>) => Uint8Array;
SignalMessage_GetSerialized: (obj: Wrapper<SignalMessage>) => Uint8Array;
ScannableFingerprint_Compare: (fprint1: Uint8Array<ArrayBuffer>, fprint2: Uint8Array<ArrayBuffer>) => boolean;
SignalMessage_Deserialize: (data: Uint8Array<ArrayBuffer>) => SignalMessage;
SignalMessage_GetBody: (obj: Wrapper<SignalMessage>) => Uint8Array<ArrayBuffer>;
SignalMessage_GetSerialized: (obj: Wrapper<SignalMessage>) => Uint8Array<ArrayBuffer>;
SignalMessage_GetCounter: (obj: Wrapper<SignalMessage>) => number;
SignalMessage_GetMessageVersion: (obj: Wrapper<SignalMessage>) => number;
SignalMessage_GetPqRatchet: (msg: Wrapper<SignalMessage>) => Uint8Array;
SignalMessage_New: (messageVersion: number, macKey: Uint8Array, senderRatchetKey: Wrapper<PublicKey>, counter: number, previousCounter: number, ciphertext: Uint8Array, senderIdentityKey: Wrapper<PublicKey>, receiverIdentityKey: Wrapper<PublicKey>, pqRatchet: Uint8Array) => SignalMessage;
SignalMessage_VerifyMac: (msg: Wrapper<SignalMessage>, senderIdentityKey: Wrapper<PublicKey>, receiverIdentityKey: Wrapper<PublicKey>, macKey: Uint8Array) => boolean;
SignalMessage_GetPqRatchet: (msg: Wrapper<SignalMessage>) => Uint8Array<ArrayBuffer>;
SignalMessage_New: (messageVersion: number, macKey: Uint8Array<ArrayBuffer>, senderRatchetKey: Wrapper<PublicKey>, counter: number, previousCounter: number, ciphertext: Uint8Array<ArrayBuffer>, senderIdentityKey: Wrapper<PublicKey>, receiverIdentityKey: Wrapper<PublicKey>, pqRatchet: Uint8Array<ArrayBuffer>) => SignalMessage;
SignalMessage_VerifyMac: (msg: Wrapper<SignalMessage>, senderIdentityKey: Wrapper<PublicKey>, receiverIdentityKey: Wrapper<PublicKey>, macKey: Uint8Array<ArrayBuffer>) => boolean;
PreKeySignalMessage_New: (messageVersion: number, registrationId: number, preKeyId: number | null, signedPreKeyId: number, baseKey: Wrapper<PublicKey>, identityKey: Wrapper<PublicKey>, signalMessage: Wrapper<SignalMessage>) => PreKeySignalMessage;
PreKeySignalMessage_Deserialize: (data: Uint8Array) => PreKeySignalMessage;
PreKeySignalMessage_Serialize: (obj: Wrapper<PreKeySignalMessage>) => Uint8Array;
PreKeySignalMessage_Deserialize: (data: Uint8Array<ArrayBuffer>) => PreKeySignalMessage;
PreKeySignalMessage_Serialize: (obj: Wrapper<PreKeySignalMessage>) => Uint8Array<ArrayBuffer>;
PreKeySignalMessage_GetRegistrationId: (obj: Wrapper<PreKeySignalMessage>) => number;
PreKeySignalMessage_GetSignedPreKeyId: (obj: Wrapper<PreKeySignalMessage>) => number;
PreKeySignalMessage_GetPreKeyId: (obj: Wrapper<PreKeySignalMessage>) => number | null;
PreKeySignalMessage_GetVersion: (obj: Wrapper<PreKeySignalMessage>) => number;
SenderKeyMessage_Deserialize: (data: Uint8Array) => SenderKeyMessage;
SenderKeyMessage_GetCipherText: (obj: Wrapper<SenderKeyMessage>) => Uint8Array;
SenderKeyMessage_Serialize: (obj: Wrapper<SenderKeyMessage>) => Uint8Array;
SenderKeyMessage_Deserialize: (data: Uint8Array<ArrayBuffer>) => SenderKeyMessage;
SenderKeyMessage_GetCipherText: (obj: Wrapper<SenderKeyMessage>) => Uint8Array<ArrayBuffer>;
SenderKeyMessage_Serialize: (obj: Wrapper<SenderKeyMessage>) => Uint8Array<ArrayBuffer>;
SenderKeyMessage_GetDistributionId: (obj: Wrapper<SenderKeyMessage>) => Uuid;
SenderKeyMessage_GetChainId: (obj: Wrapper<SenderKeyMessage>) => number;
SenderKeyMessage_GetIteration: (obj: Wrapper<SenderKeyMessage>) => number;
SenderKeyMessage_New: (messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Uint8Array, pk: Wrapper<PrivateKey>) => SenderKeyMessage;
SenderKeyMessage_New: (messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Uint8Array<ArrayBuffer>, pk: Wrapper<PrivateKey>) => SenderKeyMessage;
SenderKeyMessage_VerifySignature: (skm: Wrapper<SenderKeyMessage>, pubkey: Wrapper<PublicKey>) => boolean;
SenderKeyDistributionMessage_Deserialize: (data: Uint8Array) => SenderKeyDistributionMessage;
SenderKeyDistributionMessage_GetChainKey: (obj: Wrapper<SenderKeyDistributionMessage>) => Uint8Array;
SenderKeyDistributionMessage_Serialize: (obj: Wrapper<SenderKeyDistributionMessage>) => Uint8Array;
SenderKeyDistributionMessage_Deserialize: (data: Uint8Array<ArrayBuffer>) => SenderKeyDistributionMessage;
SenderKeyDistributionMessage_GetChainKey: (obj: Wrapper<SenderKeyDistributionMessage>) => Uint8Array<ArrayBuffer>;
SenderKeyDistributionMessage_Serialize: (obj: Wrapper<SenderKeyDistributionMessage>) => Uint8Array<ArrayBuffer>;
SenderKeyDistributionMessage_GetDistributionId: (obj: Wrapper<SenderKeyDistributionMessage>) => Uuid;
SenderKeyDistributionMessage_GetChainId: (obj: Wrapper<SenderKeyDistributionMessage>) => number;
SenderKeyDistributionMessage_GetIteration: (obj: Wrapper<SenderKeyDistributionMessage>) => number;
SenderKeyDistributionMessage_New: (messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainkey: Uint8Array, pk: Wrapper<PublicKey>) => SenderKeyDistributionMessage;
DecryptionErrorMessage_Deserialize: (data: Uint8Array) => DecryptionErrorMessage;
SenderKeyDistributionMessage_New: (messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainkey: Uint8Array<ArrayBuffer>, pk: Wrapper<PublicKey>) => SenderKeyDistributionMessage;
DecryptionErrorMessage_Deserialize: (data: Uint8Array<ArrayBuffer>) => DecryptionErrorMessage;
DecryptionErrorMessage_GetTimestamp: (obj: Wrapper<DecryptionErrorMessage>) => Timestamp;
DecryptionErrorMessage_GetDeviceId: (obj: Wrapper<DecryptionErrorMessage>) => number;
DecryptionErrorMessage_Serialize: (obj: Wrapper<DecryptionErrorMessage>) => Uint8Array;
DecryptionErrorMessage_Serialize: (obj: Wrapper<DecryptionErrorMessage>) => Uint8Array<ArrayBuffer>;
DecryptionErrorMessage_GetRatchetKey: (m: Wrapper<DecryptionErrorMessage>) => PublicKey | null;
DecryptionErrorMessage_ForOriginalMessage: (originalBytes: Uint8Array, originalType: number, originalTimestamp: Timestamp, originalSenderDeviceId: number) => DecryptionErrorMessage;
DecryptionErrorMessage_ExtractFromSerializedContent: (bytes: Uint8Array) => DecryptionErrorMessage;
PlaintextContent_Deserialize: (data: Uint8Array) => PlaintextContent;
PlaintextContent_Serialize: (obj: Wrapper<PlaintextContent>) => Uint8Array;
PlaintextContent_GetBody: (obj: Wrapper<PlaintextContent>) => Uint8Array;
DecryptionErrorMessage_ForOriginalMessage: (originalBytes: Uint8Array<ArrayBuffer>, originalType: number, originalTimestamp: Timestamp, originalSenderDeviceId: number) => DecryptionErrorMessage;
DecryptionErrorMessage_ExtractFromSerializedContent: (bytes: Uint8Array<ArrayBuffer>) => DecryptionErrorMessage;
PlaintextContent_Deserialize: (data: Uint8Array<ArrayBuffer>) => PlaintextContent;
PlaintextContent_Serialize: (obj: Wrapper<PlaintextContent>) => Uint8Array<ArrayBuffer>;
PlaintextContent_GetBody: (obj: Wrapper<PlaintextContent>) => Uint8Array<ArrayBuffer>;
PlaintextContent_FromDecryptionErrorMessage: (m: Wrapper<DecryptionErrorMessage>) => PlaintextContent;
PreKeyBundle_New: (registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper<PublicKey> | null, signedPrekeyId: number, signedPrekey: Wrapper<PublicKey>, signedPrekeySignature: Uint8Array, identityKey: Wrapper<PublicKey>, kyberPrekeyId: number, kyberPrekey: Wrapper<KyberPublicKey>, kyberPrekeySignature: Uint8Array) => PreKeyBundle;
PreKeyBundle_New: (registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper<PublicKey> | null, signedPrekeyId: number, signedPrekey: Wrapper<PublicKey>, signedPrekeySignature: Uint8Array<ArrayBuffer>, identityKey: Wrapper<PublicKey>, kyberPrekeyId: number, kyberPrekey: Wrapper<KyberPublicKey>, kyberPrekeySignature: Uint8Array<ArrayBuffer>) => PreKeyBundle;
PreKeyBundle_GetIdentityKey: (p: Wrapper<PreKeyBundle>) => PublicKey;
PreKeyBundle_GetSignedPreKeySignature: (obj: Wrapper<PreKeyBundle>) => Uint8Array;
PreKeyBundle_GetKyberPreKeySignature: (obj: Wrapper<PreKeyBundle>) => Uint8Array;
PreKeyBundle_GetSignedPreKeySignature: (obj: Wrapper<PreKeyBundle>) => Uint8Array<ArrayBuffer>;
PreKeyBundle_GetKyberPreKeySignature: (obj: Wrapper<PreKeyBundle>) => Uint8Array<ArrayBuffer>;
PreKeyBundle_GetRegistrationId: (obj: Wrapper<PreKeyBundle>) => number;
PreKeyBundle_GetDeviceId: (obj: Wrapper<PreKeyBundle>) => number;
PreKeyBundle_GetSignedPreKeyId: (obj: Wrapper<PreKeyBundle>) => number;
@@ -234,42 +234,42 @@ type NativeFunctions = {
PreKeyBundle_GetPreKeyPublic: (obj: Wrapper<PreKeyBundle>) => PublicKey | null;
PreKeyBundle_GetSignedPreKeyPublic: (obj: Wrapper<PreKeyBundle>) => PublicKey;
PreKeyBundle_GetKyberPreKeyPublic: (bundle: Wrapper<PreKeyBundle>) => KyberPublicKey;
SignedPreKeyRecord_Deserialize: (data: Uint8Array) => SignedPreKeyRecord;
SignedPreKeyRecord_GetSignature: (obj: Wrapper<SignedPreKeyRecord>) => Uint8Array;
SignedPreKeyRecord_Serialize: (obj: Wrapper<SignedPreKeyRecord>) => Uint8Array;
SignedPreKeyRecord_Deserialize: (data: Uint8Array<ArrayBuffer>) => SignedPreKeyRecord;
SignedPreKeyRecord_GetSignature: (obj: Wrapper<SignedPreKeyRecord>) => Uint8Array<ArrayBuffer>;
SignedPreKeyRecord_Serialize: (obj: Wrapper<SignedPreKeyRecord>) => Uint8Array<ArrayBuffer>;
SignedPreKeyRecord_GetId: (obj: Wrapper<SignedPreKeyRecord>) => number;
SignedPreKeyRecord_GetTimestamp: (obj: Wrapper<SignedPreKeyRecord>) => Timestamp;
SignedPreKeyRecord_GetPublicKey: (obj: Wrapper<SignedPreKeyRecord>) => PublicKey;
SignedPreKeyRecord_GetPrivateKey: (obj: Wrapper<SignedPreKeyRecord>) => PrivateKey;
KyberPreKeyRecord_Deserialize: (data: Uint8Array) => KyberPreKeyRecord;
KyberPreKeyRecord_GetSignature: (obj: Wrapper<KyberPreKeyRecord>) => Uint8Array;
KyberPreKeyRecord_Serialize: (obj: Wrapper<KyberPreKeyRecord>) => Uint8Array;
KyberPreKeyRecord_Deserialize: (data: Uint8Array<ArrayBuffer>) => KyberPreKeyRecord;
KyberPreKeyRecord_GetSignature: (obj: Wrapper<KyberPreKeyRecord>) => Uint8Array<ArrayBuffer>;
KyberPreKeyRecord_Serialize: (obj: Wrapper<KyberPreKeyRecord>) => Uint8Array<ArrayBuffer>;
KyberPreKeyRecord_GetId: (obj: Wrapper<KyberPreKeyRecord>) => number;
KyberPreKeyRecord_GetTimestamp: (obj: Wrapper<KyberPreKeyRecord>) => Timestamp;
KyberPreKeyRecord_GetPublicKey: (obj: Wrapper<KyberPreKeyRecord>) => KyberPublicKey;
KyberPreKeyRecord_GetSecretKey: (obj: Wrapper<KyberPreKeyRecord>) => KyberSecretKey;
KyberPreKeyRecord_GetKeyPair: (obj: Wrapper<KyberPreKeyRecord>) => KyberKeyPair;
SignedPreKeyRecord_New: (id: number, timestamp: Timestamp, pubKey: Wrapper<PublicKey>, privKey: Wrapper<PrivateKey>, signature: Uint8Array) => SignedPreKeyRecord;
KyberPreKeyRecord_New: (id: number, timestamp: Timestamp, keyPair: Wrapper<KyberKeyPair>, signature: Uint8Array) => KyberPreKeyRecord;
PreKeyRecord_Deserialize: (data: Uint8Array) => PreKeyRecord;
PreKeyRecord_Serialize: (obj: Wrapper<PreKeyRecord>) => Uint8Array;
SignedPreKeyRecord_New: (id: number, timestamp: Timestamp, pubKey: Wrapper<PublicKey>, privKey: Wrapper<PrivateKey>, signature: Uint8Array<ArrayBuffer>) => SignedPreKeyRecord;
KyberPreKeyRecord_New: (id: number, timestamp: Timestamp, keyPair: Wrapper<KyberKeyPair>, signature: Uint8Array<ArrayBuffer>) => KyberPreKeyRecord;
PreKeyRecord_Deserialize: (data: Uint8Array<ArrayBuffer>) => PreKeyRecord;
PreKeyRecord_Serialize: (obj: Wrapper<PreKeyRecord>) => Uint8Array<ArrayBuffer>;
PreKeyRecord_GetId: (obj: Wrapper<PreKeyRecord>) => number;
PreKeyRecord_GetPublicKey: (obj: Wrapper<PreKeyRecord>) => PublicKey;
PreKeyRecord_GetPrivateKey: (obj: Wrapper<PreKeyRecord>) => PrivateKey;
PreKeyRecord_New: (id: number, pubKey: Wrapper<PublicKey>, privKey: Wrapper<PrivateKey>) => PreKeyRecord;
SenderKeyRecord_Deserialize: (data: Uint8Array) => SenderKeyRecord;
SenderKeyRecord_Serialize: (obj: Wrapper<SenderKeyRecord>) => Uint8Array;
ServerCertificate_Deserialize: (data: Uint8Array) => ServerCertificate;
ServerCertificate_GetSerialized: (obj: Wrapper<ServerCertificate>) => Uint8Array;
ServerCertificate_GetCertificate: (obj: Wrapper<ServerCertificate>) => Uint8Array;
ServerCertificate_GetSignature: (obj: Wrapper<ServerCertificate>) => Uint8Array;
SenderKeyRecord_Deserialize: (data: Uint8Array<ArrayBuffer>) => SenderKeyRecord;
SenderKeyRecord_Serialize: (obj: Wrapper<SenderKeyRecord>) => Uint8Array<ArrayBuffer>;
ServerCertificate_Deserialize: (data: Uint8Array<ArrayBuffer>) => ServerCertificate;
ServerCertificate_GetSerialized: (obj: Wrapper<ServerCertificate>) => Uint8Array<ArrayBuffer>;
ServerCertificate_GetCertificate: (obj: Wrapper<ServerCertificate>) => Uint8Array<ArrayBuffer>;
ServerCertificate_GetSignature: (obj: Wrapper<ServerCertificate>) => Uint8Array<ArrayBuffer>;
ServerCertificate_GetKeyId: (obj: Wrapper<ServerCertificate>) => number;
ServerCertificate_GetKey: (obj: Wrapper<ServerCertificate>) => PublicKey;
ServerCertificate_New: (keyId: number, serverKey: Wrapper<PublicKey>, trustRoot: Wrapper<PrivateKey>) => ServerCertificate;
SenderCertificate_Deserialize: (data: Uint8Array) => SenderCertificate;
SenderCertificate_GetSerialized: (obj: Wrapper<SenderCertificate>) => Uint8Array;
SenderCertificate_GetCertificate: (obj: Wrapper<SenderCertificate>) => Uint8Array;
SenderCertificate_GetSignature: (obj: Wrapper<SenderCertificate>) => Uint8Array;
SenderCertificate_Deserialize: (data: Uint8Array<ArrayBuffer>) => SenderCertificate;
SenderCertificate_GetSerialized: (obj: Wrapper<SenderCertificate>) => Uint8Array<ArrayBuffer>;
SenderCertificate_GetCertificate: (obj: Wrapper<SenderCertificate>) => Uint8Array<ArrayBuffer>;
SenderCertificate_GetSignature: (obj: Wrapper<SenderCertificate>) => Uint8Array<ArrayBuffer>;
SenderCertificate_GetSenderUuid: (obj: Wrapper<SenderCertificate>) => string;
SenderCertificate_GetSenderE164: (obj: Wrapper<SenderCertificate>) => string | null;
SenderCertificate_GetExpiration: (obj: Wrapper<SenderCertificate>) => Timestamp;
@@ -278,193 +278,193 @@ type NativeFunctions = {
SenderCertificate_Validate: (cert: Wrapper<SenderCertificate>, trustRoots: Wrapper<PublicKey>[], time: Timestamp) => boolean;
SenderCertificate_GetServerCertificate: (cert: Wrapper<SenderCertificate>) => ServerCertificate;
SenderCertificate_New: (senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: Wrapper<PublicKey>, expiration: Timestamp, signerCert: Wrapper<ServerCertificate>, signerKey: Wrapper<PrivateKey>) => SenderCertificate;
UnidentifiedSenderMessageContent_Deserialize: (data: Uint8Array) => UnidentifiedSenderMessageContent;
UnidentifiedSenderMessageContent_Serialize: (obj: Wrapper<UnidentifiedSenderMessageContent>) => Uint8Array;
UnidentifiedSenderMessageContent_GetContents: (obj: Wrapper<UnidentifiedSenderMessageContent>) => Uint8Array;
UnidentifiedSenderMessageContent_GetGroupId: (obj: Wrapper<UnidentifiedSenderMessageContent>) => Uint8Array | null;
UnidentifiedSenderMessageContent_Deserialize: (data: Uint8Array<ArrayBuffer>) => UnidentifiedSenderMessageContent;
UnidentifiedSenderMessageContent_Serialize: (obj: Wrapper<UnidentifiedSenderMessageContent>) => Uint8Array<ArrayBuffer>;
UnidentifiedSenderMessageContent_GetContents: (obj: Wrapper<UnidentifiedSenderMessageContent>) => Uint8Array<ArrayBuffer>;
UnidentifiedSenderMessageContent_GetGroupId: (obj: Wrapper<UnidentifiedSenderMessageContent>) => Uint8Array<ArrayBuffer> | null;
UnidentifiedSenderMessageContent_GetSenderCert: (m: Wrapper<UnidentifiedSenderMessageContent>) => SenderCertificate;
UnidentifiedSenderMessageContent_GetMsgType: (m: Wrapper<UnidentifiedSenderMessageContent>) => number;
UnidentifiedSenderMessageContent_GetContentHint: (m: Wrapper<UnidentifiedSenderMessageContent>) => number;
UnidentifiedSenderMessageContent_New: (message: Wrapper<CiphertextMessage>, sender: Wrapper<SenderCertificate>, contentHint: number, groupId: Uint8Array | null) => UnidentifiedSenderMessageContent;
UnidentifiedSenderMessageContent_New: (message: Wrapper<CiphertextMessage>, sender: Wrapper<SenderCertificate>, contentHint: number, groupId: Uint8Array<ArrayBuffer> | null) => UnidentifiedSenderMessageContent;
CiphertextMessage_Type: (msg: Wrapper<CiphertextMessage>) => number;
CiphertextMessage_Serialize: (obj: Wrapper<CiphertextMessage>) => Uint8Array;
CiphertextMessage_Serialize: (obj: Wrapper<CiphertextMessage>) => Uint8Array<ArrayBuffer>;
CiphertextMessage_FromPlaintextContent: (m: Wrapper<PlaintextContent>) => CiphertextMessage;
SessionRecord_ArchiveCurrentState: (sessionRecord: Wrapper<SessionRecord>) => void;
SessionRecord_HasUsableSenderChain: (s: Wrapper<SessionRecord>, now: Timestamp) => boolean;
SessionRecord_CurrentRatchetKeyMatches: (s: Wrapper<SessionRecord>, key: Wrapper<PublicKey>) => boolean;
SessionRecord_Deserialize: (data: Uint8Array) => SessionRecord;
SessionRecord_Serialize: (obj: Wrapper<SessionRecord>) => Uint8Array;
SessionRecord_Deserialize: (data: Uint8Array<ArrayBuffer>) => SessionRecord;
SessionRecord_Serialize: (obj: Wrapper<SessionRecord>) => Uint8Array<ArrayBuffer>;
SessionRecord_GetLocalRegistrationId: (obj: Wrapper<SessionRecord>) => number;
SessionRecord_GetRemoteRegistrationId: (obj: Wrapper<SessionRecord>) => number;
SealedSenderDecryptionResult_GetSenderUuid: (obj: Wrapper<SealedSenderDecryptionResult>) => string;
SealedSenderDecryptionResult_GetSenderE164: (obj: Wrapper<SealedSenderDecryptionResult>) => string | null;
SealedSenderDecryptionResult_GetDeviceId: (obj: Wrapper<SealedSenderDecryptionResult>) => number;
SealedSenderDecryptionResult_Message: (obj: Wrapper<SealedSenderDecryptionResult>) => Uint8Array;
SealedSenderDecryptionResult_Message: (obj: Wrapper<SealedSenderDecryptionResult>) => Uint8Array<ArrayBuffer>;
SessionBuilder_ProcessPreKeyBundle: (bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp) => Promise<void>;
SessionCipher_EncryptMessage: (ptext: Uint8Array, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp) => Promise<CiphertextMessage>;
SessionCipher_DecryptSignalMessage: (message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore) => Promise<Uint8Array>;
SessionCipher_DecryptPreKeySignalMessage: (message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore) => Promise<Uint8Array>;
SealedSender_Encrypt: (destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore) => Promise<Uint8Array>;
SealedSender_MultiRecipientEncrypt: (recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], excludedRecipients: Uint8Array, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore) => Promise<Uint8Array>;
SealedSender_MultiRecipientMessageForSingleRecipient: (encodedMultiRecipientMessage: Uint8Array) => Uint8Array;
SealedSender_DecryptToUsmc: (ctext: Uint8Array, identityStore: IdentityKeyStore) => Promise<UnidentifiedSenderMessageContent>;
SealedSender_DecryptMessage: (message: Uint8Array, trustRoot: Wrapper<PublicKey>, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore) => Promise<SealedSenderDecryptionResult>;
SessionCipher_EncryptMessage: (ptext: Uint8Array<ArrayBuffer>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp) => Promise<CiphertextMessage>;
SessionCipher_DecryptSignalMessage: (message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore) => Promise<Uint8Array<ArrayBuffer>>;
SessionCipher_DecryptPreKeySignalMessage: (message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore) => Promise<Uint8Array<ArrayBuffer>>;
SealedSender_Encrypt: (destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore) => Promise<Uint8Array<ArrayBuffer>>;
SealedSender_MultiRecipientEncrypt: (recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], excludedRecipients: Uint8Array<ArrayBuffer>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore) => Promise<Uint8Array<ArrayBuffer>>;
SealedSender_MultiRecipientMessageForSingleRecipient: (encodedMultiRecipientMessage: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
SealedSender_DecryptToUsmc: (ctext: Uint8Array<ArrayBuffer>, identityStore: IdentityKeyStore) => Promise<UnidentifiedSenderMessageContent>;
SealedSender_DecryptMessage: (message: Uint8Array<ArrayBuffer>, trustRoot: Wrapper<PublicKey>, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore) => Promise<SealedSenderDecryptionResult>;
SenderKeyDistributionMessage_Create: (sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore) => Promise<SenderKeyDistributionMessage>;
SenderKeyDistributionMessage_Process: (sender: Wrapper<ProtocolAddress>, senderKeyDistributionMessage: Wrapper<SenderKeyDistributionMessage>, store: SenderKeyStore) => Promise<void>;
GroupCipher_EncryptMessage: (sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Uint8Array, store: SenderKeyStore) => Promise<CiphertextMessage>;
GroupCipher_DecryptMessage: (sender: Wrapper<ProtocolAddress>, message: Uint8Array, store: SenderKeyStore) => Promise<Uint8Array>;
Cds2ClientState_New: (mrenclave: Uint8Array, attestationMsg: Uint8Array, currentTimestamp: Timestamp) => SgxClientState;
HsmEnclaveClient_New: (trustedPublicKey: Uint8Array, trustedCodeHashes: Uint8Array) => HsmEnclaveClient;
HsmEnclaveClient_CompleteHandshake: (cli: Wrapper<HsmEnclaveClient>, handshakeReceived: Uint8Array) => void;
HsmEnclaveClient_EstablishedSend: (cli: Wrapper<HsmEnclaveClient>, plaintextToSend: Uint8Array) => Uint8Array;
HsmEnclaveClient_EstablishedRecv: (cli: Wrapper<HsmEnclaveClient>, receivedCiphertext: Uint8Array) => Uint8Array;
HsmEnclaveClient_InitialRequest: (obj: Wrapper<HsmEnclaveClient>) => Uint8Array;
SgxClientState_InitialRequest: (obj: Wrapper<SgxClientState>) => Uint8Array;
SgxClientState_CompleteHandshake: (cli: Wrapper<SgxClientState>, handshakeReceived: Uint8Array) => void;
SgxClientState_EstablishedSend: (cli: Wrapper<SgxClientState>, plaintextToSend: Uint8Array) => Uint8Array;
SgxClientState_EstablishedRecv: (cli: Wrapper<SgxClientState>, receivedCiphertext: Uint8Array) => Uint8Array;
ExpiringProfileKeyCredential_CheckValidContents: (buffer: Uint8Array) => void;
ExpiringProfileKeyCredentialResponse_CheckValidContents: (buffer: Uint8Array) => void;
GroupMasterKey_CheckValidContents: (buffer: Uint8Array) => void;
GroupPublicParams_CheckValidContents: (buffer: Uint8Array) => void;
GroupSecretParams_CheckValidContents: (buffer: Uint8Array) => void;
ProfileKey_CheckValidContents: (buffer: Uint8Array) => void;
ProfileKeyCiphertext_CheckValidContents: (buffer: Uint8Array) => void;
ProfileKeyCommitment_CheckValidContents: (buffer: Uint8Array) => void;
ProfileKeyCredentialRequest_CheckValidContents: (buffer: Uint8Array) => void;
ProfileKeyCredentialRequestContext_CheckValidContents: (buffer: Uint8Array) => void;
ReceiptCredential_CheckValidContents: (buffer: Uint8Array) => void;
ReceiptCredentialPresentation_CheckValidContents: (buffer: Uint8Array) => void;
ReceiptCredentialRequest_CheckValidContents: (buffer: Uint8Array) => void;
ReceiptCredentialRequestContext_CheckValidContents: (buffer: Uint8Array) => void;
ReceiptCredentialResponse_CheckValidContents: (buffer: Uint8Array) => void;
UuidCiphertext_CheckValidContents: (buffer: Uint8Array) => void;
ServerPublicParams_Deserialize: (buffer: Uint8Array) => ServerPublicParams;
ServerPublicParams_Serialize: (handle: Wrapper<ServerPublicParams>) => Uint8Array;
ServerSecretParams_Deserialize: (buffer: Uint8Array) => ServerSecretParams;
ServerSecretParams_Serialize: (handle: Wrapper<ServerSecretParams>) => Uint8Array;
ProfileKey_GetCommitment: (profileKey: Serialized<ProfileKey>, userId: Uint8Array) => Serialized<ProfileKeyCommitment>;
ProfileKey_GetProfileKeyVersion: (profileKey: Serialized<ProfileKey>, userId: Uint8Array) => Uint8Array;
ProfileKey_DeriveAccessKey: (profileKey: Serialized<ProfileKey>) => Uint8Array;
GroupSecretParams_GenerateDeterministic: (randomness: Uint8Array) => Serialized<GroupSecretParams>;
GroupCipher_EncryptMessage: (sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Uint8Array<ArrayBuffer>, store: SenderKeyStore) => Promise<CiphertextMessage>;
GroupCipher_DecryptMessage: (sender: Wrapper<ProtocolAddress>, message: Uint8Array<ArrayBuffer>, store: SenderKeyStore) => Promise<Uint8Array<ArrayBuffer>>;
Cds2ClientState_New: (mrenclave: Uint8Array<ArrayBuffer>, attestationMsg: Uint8Array<ArrayBuffer>, currentTimestamp: Timestamp) => SgxClientState;
HsmEnclaveClient_New: (trustedPublicKey: Uint8Array<ArrayBuffer>, trustedCodeHashes: Uint8Array<ArrayBuffer>) => HsmEnclaveClient;
HsmEnclaveClient_CompleteHandshake: (cli: Wrapper<HsmEnclaveClient>, handshakeReceived: Uint8Array<ArrayBuffer>) => void;
HsmEnclaveClient_EstablishedSend: (cli: Wrapper<HsmEnclaveClient>, plaintextToSend: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
HsmEnclaveClient_EstablishedRecv: (cli: Wrapper<HsmEnclaveClient>, receivedCiphertext: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
HsmEnclaveClient_InitialRequest: (obj: Wrapper<HsmEnclaveClient>) => Uint8Array<ArrayBuffer>;
SgxClientState_InitialRequest: (obj: Wrapper<SgxClientState>) => Uint8Array<ArrayBuffer>;
SgxClientState_CompleteHandshake: (cli: Wrapper<SgxClientState>, handshakeReceived: Uint8Array<ArrayBuffer>) => void;
SgxClientState_EstablishedSend: (cli: Wrapper<SgxClientState>, plaintextToSend: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
SgxClientState_EstablishedRecv: (cli: Wrapper<SgxClientState>, receivedCiphertext: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ExpiringProfileKeyCredential_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ExpiringProfileKeyCredentialResponse_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
GroupMasterKey_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
GroupPublicParams_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
GroupSecretParams_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ProfileKey_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ProfileKeyCiphertext_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ProfileKeyCommitment_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ProfileKeyCredentialRequest_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ProfileKeyCredentialRequestContext_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ReceiptCredential_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ReceiptCredentialPresentation_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ReceiptCredentialRequest_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ReceiptCredentialRequestContext_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ReceiptCredentialResponse_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
UuidCiphertext_CheckValidContents: (buffer: Uint8Array<ArrayBuffer>) => void;
ServerPublicParams_Deserialize: (buffer: Uint8Array<ArrayBuffer>) => ServerPublicParams;
ServerPublicParams_Serialize: (handle: Wrapper<ServerPublicParams>) => Uint8Array<ArrayBuffer>;
ServerSecretParams_Deserialize: (buffer: Uint8Array<ArrayBuffer>) => ServerSecretParams;
ServerSecretParams_Serialize: (handle: Wrapper<ServerSecretParams>) => Uint8Array<ArrayBuffer>;
ProfileKey_GetCommitment: (profileKey: Serialized<ProfileKey>, userId: Uint8Array<ArrayBuffer>) => Serialized<ProfileKeyCommitment>;
ProfileKey_GetProfileKeyVersion: (profileKey: Serialized<ProfileKey>, userId: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ProfileKey_DeriveAccessKey: (profileKey: Serialized<ProfileKey>) => Uint8Array<ArrayBuffer>;
GroupSecretParams_GenerateDeterministic: (randomness: Uint8Array<ArrayBuffer>) => Serialized<GroupSecretParams>;
GroupSecretParams_DeriveFromMasterKey: (masterKey: Serialized<GroupMasterKey>) => Serialized<GroupSecretParams>;
GroupSecretParams_GetMasterKey: (params: Serialized<GroupSecretParams>) => Serialized<GroupMasterKey>;
GroupSecretParams_GetPublicParams: (params: Serialized<GroupSecretParams>) => Serialized<GroupPublicParams>;
GroupSecretParams_EncryptServiceId: (params: Serialized<GroupSecretParams>, serviceId: Uint8Array) => Serialized<UuidCiphertext>;
GroupSecretParams_DecryptServiceId: (params: Serialized<GroupSecretParams>, ciphertext: Serialized<UuidCiphertext>) => Uint8Array;
GroupSecretParams_EncryptProfileKey: (params: Serialized<GroupSecretParams>, profileKey: Serialized<ProfileKey>, userId: Uint8Array) => Serialized<ProfileKeyCiphertext>;
GroupSecretParams_DecryptProfileKey: (params: Serialized<GroupSecretParams>, profileKey: Serialized<ProfileKeyCiphertext>, userId: Uint8Array) => Serialized<ProfileKey>;
GroupSecretParams_EncryptBlobWithPaddingDeterministic: (params: Serialized<GroupSecretParams>, randomness: Uint8Array, plaintext: Uint8Array, paddingLen: number) => Uint8Array;
GroupSecretParams_DecryptBlobWithPadding: (params: Serialized<GroupSecretParams>, ciphertext: Uint8Array) => Uint8Array;
ServerSecretParams_GenerateDeterministic: (randomness: Uint8Array) => ServerSecretParams;
GroupSecretParams_EncryptServiceId: (params: Serialized<GroupSecretParams>, serviceId: Uint8Array<ArrayBuffer>) => Serialized<UuidCiphertext>;
GroupSecretParams_DecryptServiceId: (params: Serialized<GroupSecretParams>, ciphertext: Serialized<UuidCiphertext>) => Uint8Array<ArrayBuffer>;
GroupSecretParams_EncryptProfileKey: (params: Serialized<GroupSecretParams>, profileKey: Serialized<ProfileKey>, userId: Uint8Array<ArrayBuffer>) => Serialized<ProfileKeyCiphertext>;
GroupSecretParams_DecryptProfileKey: (params: Serialized<GroupSecretParams>, profileKey: Serialized<ProfileKeyCiphertext>, userId: Uint8Array<ArrayBuffer>) => Serialized<ProfileKey>;
GroupSecretParams_EncryptBlobWithPaddingDeterministic: (params: Serialized<GroupSecretParams>, randomness: Uint8Array<ArrayBuffer>, plaintext: Uint8Array<ArrayBuffer>, paddingLen: number) => Uint8Array<ArrayBuffer>;
GroupSecretParams_DecryptBlobWithPadding: (params: Serialized<GroupSecretParams>, ciphertext: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ServerSecretParams_GenerateDeterministic: (randomness: Uint8Array<ArrayBuffer>) => ServerSecretParams;
ServerSecretParams_GetPublicParams: (params: Wrapper<ServerSecretParams>) => ServerPublicParams;
ServerSecretParams_SignDeterministic: (params: Wrapper<ServerSecretParams>, randomness: Uint8Array, message: Uint8Array) => Uint8Array;
ServerPublicParams_GetEndorsementPublicKey: (params: Wrapper<ServerPublicParams>) => Uint8Array;
ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId: (params: Wrapper<ServerPublicParams>, aci: Uint8Array, pni: Uint8Array, redemptionTime: Timestamp, authCredentialWithPniResponseBytes: Uint8Array) => Uint8Array;
ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array, groupSecretParams: Serialized<GroupSecretParams>, authCredentialWithPniBytes: Uint8Array) => Uint8Array;
ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array, userId: Uint8Array, profileKey: Serialized<ProfileKey>) => Serialized<ProfileKeyCredentialRequestContext>;
ServerSecretParams_SignDeterministic: (params: Wrapper<ServerSecretParams>, randomness: Uint8Array<ArrayBuffer>, message: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ServerPublicParams_GetEndorsementPublicKey: (params: Wrapper<ServerPublicParams>) => Uint8Array<ArrayBuffer>;
ServerPublicParams_ReceiveAuthCredentialWithPniAsServiceId: (params: Wrapper<ServerPublicParams>, aci: Uint8Array<ArrayBuffer>, pni: Uint8Array<ArrayBuffer>, redemptionTime: Timestamp, authCredentialWithPniResponseBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ServerPublicParams_CreateAuthCredentialWithPniPresentationDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array<ArrayBuffer>, groupSecretParams: Serialized<GroupSecretParams>, authCredentialWithPniBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
ServerPublicParams_CreateProfileKeyCredentialRequestContextDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>, profileKey: Serialized<ProfileKey>) => Serialized<ProfileKeyCredentialRequestContext>;
ServerPublicParams_ReceiveExpiringProfileKeyCredential: (serverPublicParams: Wrapper<ServerPublicParams>, requestContext: Serialized<ProfileKeyCredentialRequestContext>, response: Serialized<ExpiringProfileKeyCredentialResponse>, currentTimeInSeconds: Timestamp) => Serialized<ExpiringProfileKeyCredential>;
ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array, groupSecretParams: Serialized<GroupSecretParams>, profileKeyCredential: Serialized<ExpiringProfileKeyCredential>) => Uint8Array;
ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array, receiptSerial: Uint8Array) => Serialized<ReceiptCredentialRequestContext>;
ServerPublicParams_CreateExpiringProfileKeyCredentialPresentationDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array<ArrayBuffer>, groupSecretParams: Serialized<GroupSecretParams>, profileKeyCredential: Serialized<ExpiringProfileKeyCredential>) => Uint8Array<ArrayBuffer>;
ServerPublicParams_CreateReceiptCredentialRequestContextDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array<ArrayBuffer>, receiptSerial: Uint8Array<ArrayBuffer>) => Serialized<ReceiptCredentialRequestContext>;
ServerPublicParams_ReceiveReceiptCredential: (serverPublicParams: Wrapper<ServerPublicParams>, requestContext: Serialized<ReceiptCredentialRequestContext>, response: Serialized<ReceiptCredentialResponse>) => Serialized<ReceiptCredential>;
ServerPublicParams_CreateReceiptCredentialPresentationDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array, receiptCredential: Serialized<ReceiptCredential>) => Serialized<ReceiptCredentialPresentation>;
ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic: (serverSecretParams: Wrapper<ServerSecretParams>, randomness: Uint8Array, aci: Uint8Array, pni: Uint8Array, redemptionTime: Timestamp) => Uint8Array;
AuthCredentialWithPni_CheckValidContents: (bytes: Uint8Array) => void;
AuthCredentialWithPniResponse_CheckValidContents: (bytes: Uint8Array) => void;
ServerSecretParams_VerifyAuthCredentialPresentation: (serverSecretParams: Wrapper<ServerSecretParams>, groupPublicParams: Serialized<GroupPublicParams>, presentationBytes: Uint8Array, currentTimeInSeconds: Timestamp) => void;
ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic: (serverSecretParams: Wrapper<ServerSecretParams>, randomness: Uint8Array, request: Serialized<ProfileKeyCredentialRequest>, userId: Uint8Array, commitment: Serialized<ProfileKeyCommitment>, expirationInSeconds: Timestamp) => Serialized<ExpiringProfileKeyCredentialResponse>;
ServerSecretParams_VerifyProfileKeyCredentialPresentation: (serverSecretParams: Wrapper<ServerSecretParams>, groupPublicParams: Serialized<GroupPublicParams>, presentationBytes: Uint8Array, currentTimeInSeconds: Timestamp) => void;
ServerSecretParams_IssueReceiptCredentialDeterministic: (serverSecretParams: Wrapper<ServerSecretParams>, randomness: Uint8Array, request: Serialized<ReceiptCredentialRequest>, receiptExpirationTime: Timestamp, receiptLevel: bigint) => Serialized<ReceiptCredentialResponse>;
ServerPublicParams_CreateReceiptCredentialPresentationDeterministic: (serverPublicParams: Wrapper<ServerPublicParams>, randomness: Uint8Array<ArrayBuffer>, receiptCredential: Serialized<ReceiptCredential>) => Serialized<ReceiptCredentialPresentation>;
ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic: (serverSecretParams: Wrapper<ServerSecretParams>, randomness: Uint8Array<ArrayBuffer>, aci: Uint8Array<ArrayBuffer>, pni: Uint8Array<ArrayBuffer>, redemptionTime: Timestamp) => Uint8Array<ArrayBuffer>;
AuthCredentialWithPni_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
AuthCredentialWithPniResponse_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
ServerSecretParams_VerifyAuthCredentialPresentation: (serverSecretParams: Wrapper<ServerSecretParams>, groupPublicParams: Serialized<GroupPublicParams>, presentationBytes: Uint8Array<ArrayBuffer>, currentTimeInSeconds: Timestamp) => void;
ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic: (serverSecretParams: Wrapper<ServerSecretParams>, randomness: Uint8Array<ArrayBuffer>, request: Serialized<ProfileKeyCredentialRequest>, userId: Uint8Array<ArrayBuffer>, commitment: Serialized<ProfileKeyCommitment>, expirationInSeconds: Timestamp) => Serialized<ExpiringProfileKeyCredentialResponse>;
ServerSecretParams_VerifyProfileKeyCredentialPresentation: (serverSecretParams: Wrapper<ServerSecretParams>, groupPublicParams: Serialized<GroupPublicParams>, presentationBytes: Uint8Array<ArrayBuffer>, currentTimeInSeconds: Timestamp) => void;
ServerSecretParams_IssueReceiptCredentialDeterministic: (serverSecretParams: Wrapper<ServerSecretParams>, randomness: Uint8Array<ArrayBuffer>, request: Serialized<ReceiptCredentialRequest>, receiptExpirationTime: Timestamp, receiptLevel: bigint) => Serialized<ReceiptCredentialResponse>;
ServerSecretParams_VerifyReceiptCredentialPresentation: (serverSecretParams: Wrapper<ServerSecretParams>, presentation: Serialized<ReceiptCredentialPresentation>) => void;
GroupPublicParams_GetGroupIdentifier: (groupPublicParams: Serialized<GroupPublicParams>) => Uint8Array;
ServerPublicParams_VerifySignature: (serverPublicParams: Wrapper<ServerPublicParams>, message: Uint8Array, notarySignature: Uint8Array) => void;
AuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void;
AuthCredentialPresentation_GetUuidCiphertext: (presentationBytes: Uint8Array) => Serialized<UuidCiphertext>;
AuthCredentialPresentation_GetPniCiphertext: (presentationBytes: Uint8Array) => Serialized<UuidCiphertext>;
AuthCredentialPresentation_GetRedemptionTime: (presentationBytes: Uint8Array) => Timestamp;
GroupPublicParams_GetGroupIdentifier: (groupPublicParams: Serialized<GroupPublicParams>) => Uint8Array<ArrayBuffer>;
ServerPublicParams_VerifySignature: (serverPublicParams: Wrapper<ServerPublicParams>, message: Uint8Array<ArrayBuffer>, notarySignature: Uint8Array<ArrayBuffer>) => void;
AuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array<ArrayBuffer>) => void;
AuthCredentialPresentation_GetUuidCiphertext: (presentationBytes: Uint8Array<ArrayBuffer>) => Serialized<UuidCiphertext>;
AuthCredentialPresentation_GetPniCiphertext: (presentationBytes: Uint8Array<ArrayBuffer>) => Serialized<UuidCiphertext>;
AuthCredentialPresentation_GetRedemptionTime: (presentationBytes: Uint8Array<ArrayBuffer>) => Timestamp;
ProfileKeyCredentialRequestContext_GetRequest: (context: Serialized<ProfileKeyCredentialRequestContext>) => Serialized<ProfileKeyCredentialRequest>;
ExpiringProfileKeyCredential_GetExpirationTime: (credential: Serialized<ExpiringProfileKeyCredential>) => Timestamp;
ProfileKeyCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void;
ProfileKeyCredentialPresentation_GetUuidCiphertext: (presentationBytes: Uint8Array) => Serialized<UuidCiphertext>;
ProfileKeyCredentialPresentation_GetProfileKeyCiphertext: (presentationBytes: Uint8Array) => Serialized<ProfileKeyCiphertext>;
ProfileKeyCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array<ArrayBuffer>) => void;
ProfileKeyCredentialPresentation_GetUuidCiphertext: (presentationBytes: Uint8Array<ArrayBuffer>) => Serialized<UuidCiphertext>;
ProfileKeyCredentialPresentation_GetProfileKeyCiphertext: (presentationBytes: Uint8Array<ArrayBuffer>) => Serialized<ProfileKeyCiphertext>;
ReceiptCredentialRequestContext_GetRequest: (requestContext: Serialized<ReceiptCredentialRequestContext>) => Serialized<ReceiptCredentialRequest>;
ReceiptCredential_GetReceiptExpirationTime: (receiptCredential: Serialized<ReceiptCredential>) => Timestamp;
ReceiptCredential_GetReceiptLevel: (receiptCredential: Serialized<ReceiptCredential>) => bigint;
ReceiptCredentialPresentation_GetReceiptExpirationTime: (presentation: Serialized<ReceiptCredentialPresentation>) => Timestamp;
ReceiptCredentialPresentation_GetReceiptLevel: (presentation: Serialized<ReceiptCredentialPresentation>) => bigint;
ReceiptCredentialPresentation_GetReceiptSerial: (presentation: Serialized<ReceiptCredentialPresentation>) => Uint8Array;
GenericServerSecretParams_CheckValidContents: (paramsBytes: Uint8Array) => void;
GenericServerSecretParams_GenerateDeterministic: (randomness: Uint8Array) => Uint8Array;
GenericServerSecretParams_GetPublicParams: (paramsBytes: Uint8Array) => Uint8Array;
GenericServerPublicParams_CheckValidContents: (paramsBytes: Uint8Array) => void;
CallLinkSecretParams_CheckValidContents: (paramsBytes: Uint8Array) => void;
CallLinkSecretParams_DeriveFromRootKey: (rootKey: Uint8Array) => Uint8Array;
CallLinkSecretParams_GetPublicParams: (paramsBytes: Uint8Array) => Uint8Array;
CallLinkSecretParams_DecryptUserId: (paramsBytes: Uint8Array, userId: Serialized<UuidCiphertext>) => Uint8Array;
CallLinkSecretParams_EncryptUserId: (paramsBytes: Uint8Array, userId: Uint8Array) => Serialized<UuidCiphertext>;
CallLinkPublicParams_CheckValidContents: (paramsBytes: Uint8Array) => void;
CreateCallLinkCredentialRequestContext_CheckValidContents: (contextBytes: Uint8Array) => void;
CreateCallLinkCredentialRequestContext_NewDeterministic: (roomId: Uint8Array, randomness: Uint8Array) => Uint8Array;
CreateCallLinkCredentialRequestContext_GetRequest: (contextBytes: Uint8Array) => Uint8Array;
CreateCallLinkCredentialRequest_CheckValidContents: (requestBytes: Uint8Array) => void;
CreateCallLinkCredentialRequest_IssueDeterministic: (requestBytes: Uint8Array, userId: Uint8Array, timestamp: Timestamp, paramsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array;
CreateCallLinkCredentialResponse_CheckValidContents: (responseBytes: Uint8Array) => void;
CreateCallLinkCredentialRequestContext_ReceiveResponse: (contextBytes: Uint8Array, responseBytes: Uint8Array, userId: Uint8Array, paramsBytes: Uint8Array) => Uint8Array;
CreateCallLinkCredential_CheckValidContents: (paramsBytes: Uint8Array) => void;
CreateCallLinkCredential_PresentDeterministic: (credentialBytes: Uint8Array, roomId: Uint8Array, userId: Uint8Array, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array;
CreateCallLinkCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void;
CreateCallLinkCredentialPresentation_Verify: (presentationBytes: Uint8Array, roomId: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array) => void;
CallLinkAuthCredentialResponse_CheckValidContents: (responseBytes: Uint8Array) => void;
CallLinkAuthCredentialResponse_IssueDeterministic: (userId: Uint8Array, redemptionTime: Timestamp, paramsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array;
CallLinkAuthCredentialResponse_Receive: (responseBytes: Uint8Array, userId: Uint8Array, redemptionTime: Timestamp, paramsBytes: Uint8Array) => Uint8Array;
CallLinkAuthCredential_CheckValidContents: (credentialBytes: Uint8Array) => void;
CallLinkAuthCredential_PresentDeterministic: (credentialBytes: Uint8Array, userId: Uint8Array, redemptionTime: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array;
CallLinkAuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void;
CallLinkAuthCredentialPresentation_Verify: (presentationBytes: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array) => void;
CallLinkAuthCredentialPresentation_GetUserId: (presentationBytes: Uint8Array) => Serialized<UuidCiphertext>;
BackupAuthCredentialRequestContext_New: (backupKey: Uint8Array, uuid: Uuid) => Uint8Array;
BackupAuthCredentialRequestContext_CheckValidContents: (contextBytes: Uint8Array) => void;
BackupAuthCredentialRequestContext_GetRequest: (contextBytes: Uint8Array) => Uint8Array;
BackupAuthCredentialRequest_CheckValidContents: (requestBytes: Uint8Array) => void;
BackupAuthCredentialRequest_IssueDeterministic: (requestBytes: Uint8Array, redemptionTime: Timestamp, backupLevel: number, credentialType: number, paramsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array;
BackupAuthCredentialResponse_CheckValidContents: (responseBytes: Uint8Array) => void;
BackupAuthCredentialRequestContext_ReceiveResponse: (contextBytes: Uint8Array, responseBytes: Uint8Array, expectedRedemptionTime: Timestamp, paramsBytes: Uint8Array) => Uint8Array;
BackupAuthCredential_CheckValidContents: (paramsBytes: Uint8Array) => void;
BackupAuthCredential_GetBackupId: (credentialBytes: Uint8Array) => Uint8Array;
BackupAuthCredential_GetBackupLevel: (credentialBytes: Uint8Array) => number;
BackupAuthCredential_GetType: (credentialBytes: Uint8Array) => number;
BackupAuthCredential_PresentDeterministic: (credentialBytes: Uint8Array, serverParamsBytes: Uint8Array, randomness: Uint8Array) => Uint8Array;
BackupAuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array) => void;
BackupAuthCredentialPresentation_Verify: (presentationBytes: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array) => void;
BackupAuthCredentialPresentation_GetBackupId: (presentationBytes: Uint8Array) => Uint8Array;
BackupAuthCredentialPresentation_GetBackupLevel: (presentationBytes: Uint8Array) => number;
BackupAuthCredentialPresentation_GetType: (presentationBytes: Uint8Array) => number;
GroupSendDerivedKeyPair_CheckValidContents: (bytes: Uint8Array) => void;
GroupSendDerivedKeyPair_ForExpiration: (expiration: Timestamp, serverParams: Wrapper<ServerSecretParams>) => Uint8Array;
GroupSendEndorsementsResponse_CheckValidContents: (bytes: Uint8Array) => void;
GroupSendEndorsementsResponse_IssueDeterministic: (concatenatedGroupMemberCiphertexts: Uint8Array, keyPair: Uint8Array, randomness: Uint8Array) => Uint8Array;
GroupSendEndorsementsResponse_GetExpiration: (responseBytes: Uint8Array) => Timestamp;
GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds: (responseBytes: Uint8Array, groupMembers: Uint8Array, localUser: Uint8Array, now: Timestamp, groupParams: Serialized<GroupSecretParams>, serverParams: Wrapper<ServerPublicParams>) => Uint8Array[];
GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts: (responseBytes: Uint8Array, concatenatedGroupMemberCiphertexts: Uint8Array, localUserCiphertext: Uint8Array, now: Timestamp, serverParams: Wrapper<ServerPublicParams>) => Uint8Array[];
GroupSendEndorsement_CheckValidContents: (bytes: Uint8Array) => void;
GroupSendEndorsement_Combine: (endorsements: Uint8Array[]) => Uint8Array;
GroupSendEndorsement_Remove: (endorsement: Uint8Array, toRemove: Uint8Array) => Uint8Array;
GroupSendEndorsement_ToToken: (endorsement: Uint8Array, groupParams: Serialized<GroupSecretParams>) => Uint8Array;
GroupSendEndorsement_CallLinkParams_ToToken: (endorsement: Uint8Array, callLinkSecretParamsSerialized: Uint8Array) => Uint8Array;
GroupSendToken_CheckValidContents: (bytes: Uint8Array) => void;
GroupSendToken_ToFullToken: (token: Uint8Array, expiration: Timestamp) => Uint8Array;
GroupSendFullToken_CheckValidContents: (bytes: Uint8Array) => void;
GroupSendFullToken_GetExpiration: (token: Uint8Array) => Timestamp;
GroupSendFullToken_Verify: (token: Uint8Array, userIds: Uint8Array, now: Timestamp, keyPair: Uint8Array) => void;
ReceiptCredentialPresentation_GetReceiptSerial: (presentation: Serialized<ReceiptCredentialPresentation>) => Uint8Array<ArrayBuffer>;
GenericServerSecretParams_CheckValidContents: (paramsBytes: Uint8Array<ArrayBuffer>) => void;
GenericServerSecretParams_GenerateDeterministic: (randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
GenericServerSecretParams_GetPublicParams: (paramsBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
GenericServerPublicParams_CheckValidContents: (paramsBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkSecretParams_CheckValidContents: (paramsBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkSecretParams_DeriveFromRootKey: (rootKey: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CallLinkSecretParams_GetPublicParams: (paramsBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CallLinkSecretParams_DecryptUserId: (paramsBytes: Uint8Array<ArrayBuffer>, userId: Serialized<UuidCiphertext>) => Uint8Array<ArrayBuffer>;
CallLinkSecretParams_EncryptUserId: (paramsBytes: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>) => Serialized<UuidCiphertext>;
CallLinkPublicParams_CheckValidContents: (paramsBytes: Uint8Array<ArrayBuffer>) => void;
CreateCallLinkCredentialRequestContext_CheckValidContents: (contextBytes: Uint8Array<ArrayBuffer>) => void;
CreateCallLinkCredentialRequestContext_NewDeterministic: (roomId: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CreateCallLinkCredentialRequestContext_GetRequest: (contextBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CreateCallLinkCredentialRequest_CheckValidContents: (requestBytes: Uint8Array<ArrayBuffer>) => void;
CreateCallLinkCredentialRequest_IssueDeterministic: (requestBytes: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>, timestamp: Timestamp, paramsBytes: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CreateCallLinkCredentialResponse_CheckValidContents: (responseBytes: Uint8Array<ArrayBuffer>) => void;
CreateCallLinkCredentialRequestContext_ReceiveResponse: (contextBytes: Uint8Array<ArrayBuffer>, responseBytes: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>, paramsBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CreateCallLinkCredential_CheckValidContents: (paramsBytes: Uint8Array<ArrayBuffer>) => void;
CreateCallLinkCredential_PresentDeterministic: (credentialBytes: Uint8Array<ArrayBuffer>, roomId: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>, serverParamsBytes: Uint8Array<ArrayBuffer>, callLinkParamsBytes: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CreateCallLinkCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array<ArrayBuffer>) => void;
CreateCallLinkCredentialPresentation_Verify: (presentationBytes: Uint8Array<ArrayBuffer>, roomId: Uint8Array<ArrayBuffer>, now: Timestamp, serverParamsBytes: Uint8Array<ArrayBuffer>, callLinkParamsBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkAuthCredentialResponse_CheckValidContents: (responseBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkAuthCredentialResponse_IssueDeterministic: (userId: Uint8Array<ArrayBuffer>, redemptionTime: Timestamp, paramsBytes: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CallLinkAuthCredentialResponse_Receive: (responseBytes: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>, redemptionTime: Timestamp, paramsBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CallLinkAuthCredential_CheckValidContents: (credentialBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkAuthCredential_PresentDeterministic: (credentialBytes: Uint8Array<ArrayBuffer>, userId: Uint8Array<ArrayBuffer>, redemptionTime: Timestamp, serverParamsBytes: Uint8Array<ArrayBuffer>, callLinkParamsBytes: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
CallLinkAuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkAuthCredentialPresentation_Verify: (presentationBytes: Uint8Array<ArrayBuffer>, now: Timestamp, serverParamsBytes: Uint8Array<ArrayBuffer>, callLinkParamsBytes: Uint8Array<ArrayBuffer>) => void;
CallLinkAuthCredentialPresentation_GetUserId: (presentationBytes: Uint8Array<ArrayBuffer>) => Serialized<UuidCiphertext>;
BackupAuthCredentialRequestContext_New: (backupKey: Uint8Array<ArrayBuffer>, uuid: Uuid) => Uint8Array<ArrayBuffer>;
BackupAuthCredentialRequestContext_CheckValidContents: (contextBytes: Uint8Array<ArrayBuffer>) => void;
BackupAuthCredentialRequestContext_GetRequest: (contextBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupAuthCredentialRequest_CheckValidContents: (requestBytes: Uint8Array<ArrayBuffer>) => void;
BackupAuthCredentialRequest_IssueDeterministic: (requestBytes: Uint8Array<ArrayBuffer>, redemptionTime: Timestamp, backupLevel: number, credentialType: number, paramsBytes: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupAuthCredentialResponse_CheckValidContents: (responseBytes: Uint8Array<ArrayBuffer>) => void;
BackupAuthCredentialRequestContext_ReceiveResponse: (contextBytes: Uint8Array<ArrayBuffer>, responseBytes: Uint8Array<ArrayBuffer>, expectedRedemptionTime: Timestamp, paramsBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupAuthCredential_CheckValidContents: (paramsBytes: Uint8Array<ArrayBuffer>) => void;
BackupAuthCredential_GetBackupId: (credentialBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupAuthCredential_GetBackupLevel: (credentialBytes: Uint8Array<ArrayBuffer>) => number;
BackupAuthCredential_GetType: (credentialBytes: Uint8Array<ArrayBuffer>) => number;
BackupAuthCredential_PresentDeterministic: (credentialBytes: Uint8Array<ArrayBuffer>, serverParamsBytes: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupAuthCredentialPresentation_CheckValidContents: (presentationBytes: Uint8Array<ArrayBuffer>) => void;
BackupAuthCredentialPresentation_Verify: (presentationBytes: Uint8Array<ArrayBuffer>, now: Timestamp, serverParamsBytes: Uint8Array<ArrayBuffer>) => void;
BackupAuthCredentialPresentation_GetBackupId: (presentationBytes: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupAuthCredentialPresentation_GetBackupLevel: (presentationBytes: Uint8Array<ArrayBuffer>) => number;
BackupAuthCredentialPresentation_GetType: (presentationBytes: Uint8Array<ArrayBuffer>) => number;
GroupSendDerivedKeyPair_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
GroupSendDerivedKeyPair_ForExpiration: (expiration: Timestamp, serverParams: Wrapper<ServerSecretParams>) => Uint8Array<ArrayBuffer>;
GroupSendEndorsementsResponse_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
GroupSendEndorsementsResponse_IssueDeterministic: (concatenatedGroupMemberCiphertexts: Uint8Array<ArrayBuffer>, keyPair: Uint8Array<ArrayBuffer>, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
GroupSendEndorsementsResponse_GetExpiration: (responseBytes: Uint8Array<ArrayBuffer>) => Timestamp;
GroupSendEndorsementsResponse_ReceiveAndCombineWithServiceIds: (responseBytes: Uint8Array<ArrayBuffer>, groupMembers: Uint8Array<ArrayBuffer>, localUser: Uint8Array<ArrayBuffer>, now: Timestamp, groupParams: Serialized<GroupSecretParams>, serverParams: Wrapper<ServerPublicParams>) => Uint8Array<ArrayBuffer>[];
GroupSendEndorsementsResponse_ReceiveAndCombineWithCiphertexts: (responseBytes: Uint8Array<ArrayBuffer>, concatenatedGroupMemberCiphertexts: Uint8Array<ArrayBuffer>, localUserCiphertext: Uint8Array<ArrayBuffer>, now: Timestamp, serverParams: Wrapper<ServerPublicParams>) => Uint8Array<ArrayBuffer>[];
GroupSendEndorsement_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
GroupSendEndorsement_Combine: (endorsements: Uint8Array<ArrayBuffer>[]) => Uint8Array<ArrayBuffer>;
GroupSendEndorsement_Remove: (endorsement: Uint8Array<ArrayBuffer>, toRemove: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
GroupSendEndorsement_ToToken: (endorsement: Uint8Array<ArrayBuffer>, groupParams: Serialized<GroupSecretParams>) => Uint8Array<ArrayBuffer>;
GroupSendEndorsement_CallLinkParams_ToToken: (endorsement: Uint8Array<ArrayBuffer>, callLinkSecretParamsSerialized: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
GroupSendToken_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
GroupSendToken_ToFullToken: (token: Uint8Array<ArrayBuffer>, expiration: Timestamp) => Uint8Array<ArrayBuffer>;
GroupSendFullToken_CheckValidContents: (bytes: Uint8Array<ArrayBuffer>) => void;
GroupSendFullToken_GetExpiration: (token: Uint8Array<ArrayBuffer>) => Timestamp;
GroupSendFullToken_Verify: (token: Uint8Array<ArrayBuffer>, userIds: Uint8Array<ArrayBuffer>, now: Timestamp, keyPair: Uint8Array<ArrayBuffer>) => void;
LookupRequest_new: () => LookupRequest;
LookupRequest_addE164: (request: Wrapper<LookupRequest>, e164: string) => void;
LookupRequest_addPreviousE164: (request: Wrapper<LookupRequest>, e164: string) => void;
LookupRequest_setToken: (request: Wrapper<LookupRequest>, token: Uint8Array) => void;
LookupRequest_addAciAndAccessKey: (request: Wrapper<LookupRequest>, aci: Uint8Array, accessKey: Uint8Array) => void;
LookupRequest_setToken: (request: Wrapper<LookupRequest>, token: Uint8Array<ArrayBuffer>) => void;
LookupRequest_addAciAndAccessKey: (request: Wrapper<LookupRequest>, aci: Uint8Array<ArrayBuffer>, accessKey: Uint8Array<ArrayBuffer>) => void;
CdsiLookup_new: (asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, request: Wrapper<LookupRequest>) => CancellablePromise<CdsiLookup>;
CdsiLookup_token: (lookup: Wrapper<CdsiLookup>) => Uint8Array;
CdsiLookup_token: (lookup: Wrapper<CdsiLookup>) => Uint8Array<ArrayBuffer>;
CdsiLookup_complete: (asyncRuntime: Wrapper<TokioAsyncContext>, lookup: Wrapper<CdsiLookup>) => CancellablePromise<LookupResponse>;
HttpRequest_new: (method: string, path: string, bodyAsSlice: Uint8Array | null) => HttpRequest;
HttpRequest_new: (method: string, path: string, bodyAsSlice: Uint8Array<ArrayBuffer> | null) => HttpRequest;
HttpRequest_add_header: (request: Wrapper<HttpRequest>, name: string, value: string) => void;
ChatConnectionInfo_local_port: (connectionInfo: Wrapper<ChatConnectionInfo>) => number;
ChatConnectionInfo_ip_version: (connectionInfo: Wrapper<ChatConnectionInfo>) => number;
@@ -474,9 +474,9 @@ type NativeFunctions = {
UnauthenticatedChatConnection_send: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number) => CancellablePromise<ChatResponse>;
UnauthenticatedChatConnection_disconnect: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>) => CancellablePromise<void>;
UnauthenticatedChatConnection_info: (chat: Wrapper<UnauthenticatedChatConnection>) => ChatConnectionInfo;
UnauthenticatedChatConnection_look_up_username_hash: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, hash: Uint8Array) => CancellablePromise<Uuid | null>;
UnauthenticatedChatConnection_look_up_username_link: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, uuid: Uuid, entropy: Uint8Array) => CancellablePromise<[string, Uint8Array] | null>;
UnauthenticatedChatConnection_send_multi_recipient_message: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, payload: Uint8Array, timestamp: Timestamp, auth: Uint8Array|null, onlineOnly: boolean, isUrgent: boolean) => CancellablePromise<Uint8Array[]>;
UnauthenticatedChatConnection_look_up_username_hash: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, hash: Uint8Array<ArrayBuffer>) => CancellablePromise<Uuid | null>;
UnauthenticatedChatConnection_look_up_username_link: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, uuid: Uuid, entropy: Uint8Array<ArrayBuffer>) => CancellablePromise<[string, Uint8Array<ArrayBuffer>] | null>;
UnauthenticatedChatConnection_send_multi_recipient_message: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, payload: Uint8Array<ArrayBuffer>, timestamp: Timestamp, auth: Uint8Array<ArrayBuffer> | null, onlineOnly: boolean, isUrgent: boolean) => CancellablePromise<Uint8Array<ArrayBuffer>[]>;
AuthenticatedChatConnection_preconnect: (asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>) => CancellablePromise<void>;
AuthenticatedChatConnection_connect: (asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, receiveStories: boolean, languages: string[]) => CancellablePromise<AuthenticatedChatConnection>;
AuthenticatedChatConnection_init_listener: (chat: Wrapper<AuthenticatedChatConnection>, listener: ChatListener) => void;
@@ -488,13 +488,13 @@ type NativeFunctions = {
ProvisioningChatConnection_init_listener: (chat: Wrapper<ProvisioningChatConnection>, listener: ProvisioningListener) => void;
ProvisioningChatConnection_info: (chat: Wrapper<ProvisioningChatConnection>) => ChatConnectionInfo;
ProvisioningChatConnection_disconnect: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<ProvisioningChatConnection>) => CancellablePromise<void>;
KeyTransparency_AciSearchKey: (aci: Uint8Array) => Uint8Array;
KeyTransparency_E164SearchKey: (e164: string) => Uint8Array;
KeyTransparency_UsernameHashSearchKey: (hash: Uint8Array) => Uint8Array;
KeyTransparency_Search: (asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Uint8Array, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Uint8Array | null, usernameHash: Uint8Array | null, accountData: Uint8Array | null, lastDistinguishedTreeHead: Uint8Array) => CancellablePromise<Uint8Array>;
KeyTransparency_Monitor: (asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Uint8Array, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Uint8Array | null, usernameHash: Uint8Array | null, accountData: Uint8Array | null, lastDistinguishedTreeHead: Uint8Array, isSelfMonitor: boolean) => CancellablePromise<Uint8Array>;
KeyTransparency_Distinguished: (asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, lastDistinguishedTreeHead: Uint8Array | null) => CancellablePromise<Uint8Array>;
UnauthenticatedChatConnection_account_exists: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, account: Uint8Array) => CancellablePromise<boolean>;
KeyTransparency_AciSearchKey: (aci: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
KeyTransparency_E164SearchKey: (e164: string) => Uint8Array<ArrayBuffer>;
KeyTransparency_UsernameHashSearchKey: (hash: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
KeyTransparency_Search: (asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Uint8Array<ArrayBuffer>, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Uint8Array<ArrayBuffer> | null, usernameHash: Uint8Array<ArrayBuffer> | null, accountData: Uint8Array<ArrayBuffer> | null, lastDistinguishedTreeHead: Uint8Array<ArrayBuffer>) => CancellablePromise<Uint8Array<ArrayBuffer>>;
KeyTransparency_Monitor: (asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Uint8Array<ArrayBuffer>, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Uint8Array<ArrayBuffer> | null, usernameHash: Uint8Array<ArrayBuffer> | null, accountData: Uint8Array<ArrayBuffer> | null, lastDistinguishedTreeHead: Uint8Array<ArrayBuffer>, isSelfMonitor: boolean) => CancellablePromise<Uint8Array<ArrayBuffer>>;
KeyTransparency_Distinguished: (asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, lastDistinguishedTreeHead: Uint8Array<ArrayBuffer> | null) => CancellablePromise<Uint8Array<ArrayBuffer>>;
UnauthenticatedChatConnection_account_exists: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, account: Uint8Array<ArrayBuffer>) => CancellablePromise<boolean>;
RegistrationService_CreateSession: (asyncRuntime: Wrapper<TokioAsyncContext>, createSession: RegistrationCreateSessionRequest, connectChat: ConnectChatBridge) => CancellablePromise<RegistrationService>;
RegistrationService_ResumeSession: (asyncRuntime: Wrapper<TokioAsyncContext>, sessionId: string, number: string, connectChat: ConnectChatBridge) => CancellablePromise<RegistrationService>;
RegistrationService_RequestVerificationCode: (asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, transport: string, client: string, languages: string[]) => CancellablePromise<void>;
@@ -517,25 +517,25 @@ type NativeFunctions = {
RegisterAccountRequest_SetIdentityPublicKey: (registerAccount: Wrapper<RegisterAccountRequest>, identityType: number, identityKey: Wrapper<PublicKey>) => void;
RegisterAccountRequest_SetIdentitySignedPreKey: (registerAccount: Wrapper<RegisterAccountRequest>, identityType: number, signedPreKey: SignedPublicPreKey) => void;
RegisterAccountRequest_SetIdentityPqLastResortPreKey: (registerAccount: Wrapper<RegisterAccountRequest>, identityType: number, pqLastResortPreKey: SignedPublicPreKey) => void;
RegistrationAccountAttributes_Create: (recoveryPassword: Uint8Array, aciRegistrationId: number, pniRegistrationId: number, registrationLock: string | null, unidentifiedAccessKey: Uint8Array, unrestrictedUnidentifiedAccess: boolean, capabilities: string[], discoverableByPhoneNumber: boolean) => RegistrationAccountAttributes;
RegisterAccountResponse_GetIdentity: (response: Wrapper<RegisterAccountResponse>, identityType: number) => Uint8Array;
RegistrationAccountAttributes_Create: (recoveryPassword: Uint8Array<ArrayBuffer>, aciRegistrationId: number, pniRegistrationId: number, registrationLock: string | null, unidentifiedAccessKey: Uint8Array<ArrayBuffer>, unrestrictedUnidentifiedAccess: boolean, capabilities: string[], discoverableByPhoneNumber: boolean) => RegistrationAccountAttributes;
RegisterAccountResponse_GetIdentity: (response: Wrapper<RegisterAccountResponse>, identityType: number) => Uint8Array<ArrayBuffer>;
RegisterAccountResponse_GetNumber: (response: Wrapper<RegisterAccountResponse>) => string;
RegisterAccountResponse_GetUsernameHash: (response: Wrapper<RegisterAccountResponse>) => Uint8Array | null;
RegisterAccountResponse_GetUsernameHash: (response: Wrapper<RegisterAccountResponse>) => Uint8Array<ArrayBuffer> | null;
RegisterAccountResponse_GetUsernameLinkHandle: (response: Wrapper<RegisterAccountResponse>) => Uuid | null;
RegisterAccountResponse_GetStorageCapable: (response: Wrapper<RegisterAccountResponse>) => boolean;
RegisterAccountResponse_GetReregistration: (response: Wrapper<RegisterAccountResponse>) => boolean;
RegisterAccountResponse_GetEntitlementBadges: (response: Wrapper<RegisterAccountResponse>) => RegisterResponseBadge[];
RegisterAccountResponse_GetEntitlementBackupLevel: (response: Wrapper<RegisterAccountResponse>) => bigint | null;
RegisterAccountResponse_GetEntitlementBackupExpirationSeconds: (response: Wrapper<RegisterAccountResponse>) => bigint | null;
SecureValueRecoveryForBackups_CreateNewBackupChain: (environment: number, backupKey: Uint8Array) => Uint8Array;
SecureValueRecoveryForBackups_StoreBackup: (asyncRuntime: Wrapper<TokioAsyncContext>, backupKey: Uint8Array, previousSecretData: Uint8Array, connectionManager: Wrapper<ConnectionManager>, username: string, password: string) => CancellablePromise<BackupStoreResponse>;
SecureValueRecoveryForBackups_RestoreBackupFromServer: (asyncRuntime: Wrapper<TokioAsyncContext>, backupKey: Uint8Array, metadata: Uint8Array, connectionManager: Wrapper<ConnectionManager>, username: string, password: string) => CancellablePromise<BackupRestoreResponse>;
SecureValueRecoveryForBackups_CreateNewBackupChain: (environment: number, backupKey: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
SecureValueRecoveryForBackups_StoreBackup: (asyncRuntime: Wrapper<TokioAsyncContext>, backupKey: Uint8Array<ArrayBuffer>, previousSecretData: Uint8Array<ArrayBuffer>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string) => CancellablePromise<BackupStoreResponse>;
SecureValueRecoveryForBackups_RestoreBackupFromServer: (asyncRuntime: Wrapper<TokioAsyncContext>, backupKey: Uint8Array<ArrayBuffer>, metadata: Uint8Array<ArrayBuffer>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string) => CancellablePromise<BackupRestoreResponse>;
SecureValueRecoveryForBackups_RemoveBackup: (asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string) => CancellablePromise<void>;
BackupStoreResponse_GetForwardSecrecyToken: (response: Wrapper<BackupStoreResponse>) => Uint8Array;
BackupStoreResponse_GetOpaqueMetadata: (response: Wrapper<BackupStoreResponse>) => Uint8Array;
BackupStoreResponse_GetNextBackupSecretData: (response: Wrapper<BackupStoreResponse>) => Uint8Array;
BackupRestoreResponse_GetForwardSecrecyToken: (response: Wrapper<BackupRestoreResponse>) => Uint8Array;
BackupRestoreResponse_GetNextBackupSecretData: (response: Wrapper<BackupRestoreResponse>) => Uint8Array;
BackupStoreResponse_GetForwardSecrecyToken: (response: Wrapper<BackupStoreResponse>) => Uint8Array<ArrayBuffer>;
BackupStoreResponse_GetOpaqueMetadata: (response: Wrapper<BackupStoreResponse>) => Uint8Array<ArrayBuffer>;
BackupStoreResponse_GetNextBackupSecretData: (response: Wrapper<BackupStoreResponse>) => Uint8Array<ArrayBuffer>;
BackupRestoreResponse_GetForwardSecrecyToken: (response: Wrapper<BackupRestoreResponse>) => Uint8Array<ArrayBuffer>;
BackupRestoreResponse_GetNextBackupSecretData: (response: Wrapper<BackupRestoreResponse>) => Uint8Array<ArrayBuffer>;
TokioAsyncContext_new: () => TokioAsyncContext;
TokioAsyncContext_cancel: (context: Wrapper<TokioAsyncContext>, rawCancellationId: bigint) => void;
ConnectionProxyConfig_new: (scheme: string, host: string, port: number, username: string | null, password: string | null) => ConnectionProxyConfig;
@@ -549,51 +549,51 @@ type NativeFunctions = {
ConnectionManager_on_network_change: (connectionManager: Wrapper<ConnectionManager>) => void;
AccountEntropyPool_Generate: () => string;
AccountEntropyPool_IsValid: (accountEntropy: string) => boolean;
AccountEntropyPool_DeriveSvrKey: (accountEntropy: AccountEntropyPool) => Uint8Array;
AccountEntropyPool_DeriveBackupKey: (accountEntropy: AccountEntropyPool) => Uint8Array;
BackupKey_DeriveBackupId: (backupKey: Uint8Array, aci: Uint8Array) => Uint8Array;
BackupKey_DeriveEcKey: (backupKey: Uint8Array, aci: Uint8Array) => PrivateKey;
BackupKey_DeriveLocalBackupMetadataKey: (backupKey: Uint8Array) => Uint8Array;
BackupKey_DeriveMediaId: (backupKey: Uint8Array, mediaName: string) => Uint8Array;
BackupKey_DeriveMediaEncryptionKey: (backupKey: Uint8Array, mediaId: Uint8Array) => Uint8Array;
BackupKey_DeriveThumbnailTransitEncryptionKey: (backupKey: Uint8Array, mediaId: Uint8Array) => Uint8Array;
AccountEntropyPool_DeriveSvrKey: (accountEntropy: AccountEntropyPool) => Uint8Array<ArrayBuffer>;
AccountEntropyPool_DeriveBackupKey: (accountEntropy: AccountEntropyPool) => Uint8Array<ArrayBuffer>;
BackupKey_DeriveBackupId: (backupKey: Uint8Array<ArrayBuffer>, aci: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupKey_DeriveEcKey: (backupKey: Uint8Array<ArrayBuffer>, aci: Uint8Array<ArrayBuffer>) => PrivateKey;
BackupKey_DeriveLocalBackupMetadataKey: (backupKey: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupKey_DeriveMediaId: (backupKey: Uint8Array<ArrayBuffer>, mediaName: string) => Uint8Array<ArrayBuffer>;
BackupKey_DeriveMediaEncryptionKey: (backupKey: Uint8Array<ArrayBuffer>, mediaId: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
BackupKey_DeriveThumbnailTransitEncryptionKey: (backupKey: Uint8Array<ArrayBuffer>, mediaId: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
IncrementalMac_CalculateChunkSize: (dataSize: number) => number;
IncrementalMac_Initialize: (key: Uint8Array, chunkSize: number) => IncrementalMac;
IncrementalMac_Update: (mac: Wrapper<IncrementalMac>, bytes: Uint8Array, offset: number, length: number) => Uint8Array;
IncrementalMac_Finalize: (mac: Wrapper<IncrementalMac>) => Uint8Array;
ValidatingMac_Initialize: (key: Uint8Array, chunkSize: number, digests: Uint8Array) => ValidatingMac | null;
ValidatingMac_Update: (mac: Wrapper<ValidatingMac>, bytes: Uint8Array, offset: number, length: number) => number;
IncrementalMac_Initialize: (key: Uint8Array<ArrayBuffer>, chunkSize: number) => IncrementalMac;
IncrementalMac_Update: (mac: Wrapper<IncrementalMac>, bytes: Uint8Array<ArrayBuffer>, offset: number, length: number) => Uint8Array<ArrayBuffer>;
IncrementalMac_Finalize: (mac: Wrapper<IncrementalMac>) => Uint8Array<ArrayBuffer>;
ValidatingMac_Initialize: (key: Uint8Array<ArrayBuffer>, chunkSize: number, digests: Uint8Array<ArrayBuffer>) => ValidatingMac | null;
ValidatingMac_Update: (mac: Wrapper<ValidatingMac>, bytes: Uint8Array<ArrayBuffer>, offset: number, length: number) => number;
ValidatingMac_Finalize: (mac: Wrapper<ValidatingMac>) => number;
MessageBackupKey_FromAccountEntropyPool: (accountEntropy: AccountEntropyPool, aci: Uint8Array, forwardSecrecyToken: Uint8Array | null) => MessageBackupKey;
MessageBackupKey_FromBackupKeyAndBackupId: (backupKey: Uint8Array, backupId: Uint8Array, forwardSecrecyToken: Uint8Array | null) => MessageBackupKey;
MessageBackupKey_GetHmacKey: (key: Wrapper<MessageBackupKey>) => Uint8Array;
MessageBackupKey_GetAesKey: (key: Wrapper<MessageBackupKey>) => Uint8Array;
MessageBackupKey_FromAccountEntropyPool: (accountEntropy: AccountEntropyPool, aci: Uint8Array<ArrayBuffer>, forwardSecrecyToken: Uint8Array<ArrayBuffer> | null) => MessageBackupKey;
MessageBackupKey_FromBackupKeyAndBackupId: (backupKey: Uint8Array<ArrayBuffer>, backupId: Uint8Array<ArrayBuffer>, forwardSecrecyToken: Uint8Array<ArrayBuffer> | null) => MessageBackupKey;
MessageBackupKey_GetHmacKey: (key: Wrapper<MessageBackupKey>) => Uint8Array<ArrayBuffer>;
MessageBackupKey_GetAesKey: (key: Wrapper<MessageBackupKey>) => Uint8Array<ArrayBuffer>;
MessageBackupValidator_Validate: (key: Wrapper<MessageBackupKey>, firstStream: InputStream, secondStream: InputStream, len: bigint, purpose: number) => Promise<MessageBackupValidationOutcome>;
OnlineBackupValidator_New: (backupInfoFrame: Uint8Array, purpose: number) => OnlineBackupValidator;
OnlineBackupValidator_AddFrame: (backup: Wrapper<OnlineBackupValidator>, frame: Uint8Array) => void;
OnlineBackupValidator_New: (backupInfoFrame: Uint8Array<ArrayBuffer>, purpose: number) => OnlineBackupValidator;
OnlineBackupValidator_AddFrame: (backup: Wrapper<OnlineBackupValidator>, frame: Uint8Array<ArrayBuffer>) => void;
OnlineBackupValidator_Finalize: (backup: Wrapper<OnlineBackupValidator>) => void;
BackupJsonExporter_New: (backupInfo: Uint8Array, shouldValidate: boolean) => BackupJsonExporter;
BackupJsonExporter_New: (backupInfo: Uint8Array<ArrayBuffer>, shouldValidate: boolean) => BackupJsonExporter;
BackupJsonExporter_GetInitialChunk: (exporter: Wrapper<BackupJsonExporter>) => string;
BackupJsonExporter_ExportFrames: (exporter: Wrapper<BackupJsonExporter>, frames: Uint8Array) => JsonFrameExportResult[];
BackupJsonExporter_ExportFrames: (exporter: Wrapper<BackupJsonExporter>, frames: Uint8Array<ArrayBuffer>) => JsonFrameExportResult[];
BackupJsonExporter_Finish: (exporter: Wrapper<BackupJsonExporter>) => void;
Username_Hash: (username: string) => Uint8Array;
Username_Proof: (username: string, randomness: Uint8Array) => Uint8Array;
Username_Verify: (proof: Uint8Array, hash: Uint8Array) => void;
Username_Hash: (username: string) => Uint8Array<ArrayBuffer>;
Username_Proof: (username: string, randomness: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
Username_Verify: (proof: Uint8Array<ArrayBuffer>, hash: Uint8Array<ArrayBuffer>) => void;
Username_CandidatesFrom: (nickname: string, minLen: number, maxLen: number) => string[];
Username_HashFromParts: (nickname: string, discriminator: string, minLen: number, maxLen: number) => Uint8Array;
UsernameLink_Create: (username: string, entropy: Uint8Array | null) => Uint8Array;
UsernameLink_DecryptUsername: (entropy: Uint8Array, encryptedUsername: Uint8Array) => string;
Username_HashFromParts: (nickname: string, discriminator: string, minLen: number, maxLen: number) => Uint8Array<ArrayBuffer>;
UsernameLink_Create: (username: string, entropy: Uint8Array<ArrayBuffer> | null) => Uint8Array<ArrayBuffer>;
UsernameLink_DecryptUsername: (entropy: Uint8Array<ArrayBuffer>, encryptedUsername: Uint8Array<ArrayBuffer>) => string;
SignalMedia_CheckAvailable: () => void;
Mp4Sanitizer_Sanitize: (input: InputStream, len: bigint) => Promise<SanitizedMetadata>;
WebpSanitizer_Sanitize: (input: SyncInputStream) => void;
SanitizedMetadata_GetMetadata: (sanitized: Wrapper<SanitizedMetadata>) => Uint8Array;
SanitizedMetadata_GetMetadata: (sanitized: Wrapper<SanitizedMetadata>) => Uint8Array<ArrayBuffer>;
SanitizedMetadata_GetDataOffset: (sanitized: Wrapper<SanitizedMetadata>) => bigint;
SanitizedMetadata_GetDataLen: (sanitized: Wrapper<SanitizedMetadata>) => bigint;
BridgedStringMap_new: (initialCapacity: number) => BridgedStringMap;
BridgedStringMap_insert: (map: Wrapper<BridgedStringMap>, key: string, value: string) => void;
TESTING_NonSuspendingBackgroundThreadRuntime_New: () => NonSuspendingBackgroundThreadRuntime;
TESTING_FutureSuccess: (asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: number) => CancellablePromise<number>;
TESTING_TokioAsyncContext_FutureSuccessBytes: (asyncRuntime: Wrapper<TokioAsyncContext>, count: number) => CancellablePromise<Uint8Array>;
TESTING_TokioAsyncContext_FutureSuccessBytes: (asyncRuntime: Wrapper<TokioAsyncContext>, count: number) => CancellablePromise<Uint8Array<ArrayBuffer>>;
TESTING_FutureFailure: (asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: number) => CancellablePromise<number>;
TESTING_FutureCancellationCounter_Create: (initialValue: number) => TestingFutureCancellationCounter;
TESTING_FutureCancellationCounter_WaitForCount: (asyncRuntime: Wrapper<TokioAsyncContext>, count: Wrapper<TestingFutureCancellationCounter>, target: number) => CancellablePromise<void>;
@@ -623,14 +623,14 @@ type NativeFunctions = {
TESTING_ErrorOnReturnIo: (asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _needsCleanup: null) => CancellablePromise<null>;
TESTING_ReturnStringArray: () => string[];
TESTING_JoinStringArray: (array: string[], joinWith: string) => string;
TESTING_ProcessBytestringArray: (input: Uint8Array[]) => Uint8Array[];
TESTING_ProcessBytestringArray: (input: Uint8Array<ArrayBuffer>[]) => Uint8Array<ArrayBuffer>[];
TESTING_RoundTripU8: (input: number) => number;
TESTING_RoundTripU16: (input: number) => number;
TESTING_RoundTripU32: (input: number) => number;
TESTING_RoundTripI32: (input: number) => number;
TESTING_RoundTripU64: (input: bigint) => bigint;
TESTING_ConvertOptionalUuid: (present: boolean) => Uuid | null;
TESTING_InputStreamReadIntoZeroLengthSlice: (capsAlphabetInput: InputStream) => Promise<Uint8Array>;
TESTING_InputStreamReadIntoZeroLengthSlice: (capsAlphabetInput: InputStream) => Promise<Uint8Array<ArrayBuffer>>;
ComparableBackup_ReadUnencrypted: (stream: InputStream, len: bigint, purpose: number) => Promise<ComparableBackup>;
ComparableBackup_GetComparableString: (backup: Wrapper<ComparableBackup>) => string;
ComparableBackup_GetUnknownFields: (backup: Wrapper<ComparableBackup>) => string[];
@@ -642,8 +642,8 @@ type NativeFunctions = {
TESTING_FakeChatConnection_TakeUnauthenticatedChat: (chat: Wrapper<FakeChatConnection>) => UnauthenticatedChatConnection;
TESTING_FakeChatConnection_TakeProvisioningChat: (chat: Wrapper<FakeChatConnection>) => ProvisioningChatConnection;
TESTING_FakeChatConnection_TakeRemote: (chat: Wrapper<FakeChatConnection>) => FakeChatRemoteEnd;
TESTING_FakeChatRemoteEnd_SendRawServerRequest: (chat: Wrapper<FakeChatRemoteEnd>, bytes: Uint8Array) => void;
TESTING_FakeChatRemoteEnd_SendRawServerResponse: (chat: Wrapper<FakeChatRemoteEnd>, bytes: Uint8Array) => void;
TESTING_FakeChatRemoteEnd_SendRawServerRequest: (chat: Wrapper<FakeChatRemoteEnd>, bytes: Uint8Array<ArrayBuffer>) => void;
TESTING_FakeChatRemoteEnd_SendRawServerResponse: (chat: Wrapper<FakeChatRemoteEnd>, bytes: Uint8Array<ArrayBuffer>) => void;
TESTING_FakeChatRemoteEnd_SendServerResponse: (chat: Wrapper<FakeChatRemoteEnd>, response: Wrapper<FakeChatResponse>) => void;
TESTING_FakeChatRemoteEnd_InjectConnectionInterrupted: (chat: Wrapper<FakeChatRemoteEnd>) => void;
TESTING_FakeChatRemoteEnd_ReceiveIncomingRequest: (asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<FakeChatRemoteEnd>) => CancellablePromise<[HttpRequest, bigint] | null>;
@@ -652,8 +652,8 @@ type NativeFunctions = {
TESTING_ChatRequestGetPath: (request: Wrapper<HttpRequest>) => string;
TESTING_ChatRequestGetHeaderNames: (request: Wrapper<HttpRequest>) => string[];
TESTING_ChatRequestGetHeaderValue: (request: Wrapper<HttpRequest>, headerName: string) => string;
TESTING_ChatRequestGetBody: (request: Wrapper<HttpRequest>) => Uint8Array;
TESTING_FakeChatResponse_Create: (id: bigint, status: number, message: string, headers: string[], body: Uint8Array | null) => FakeChatResponse;
TESTING_ChatRequestGetBody: (request: Wrapper<HttpRequest>) => Uint8Array<ArrayBuffer>;
TESTING_FakeChatResponse_Create: (id: bigint, status: number, message: string, headers: string[], body: Uint8Array<ArrayBuffer> | null) => FakeChatResponse;
TESTING_ChatConnectErrorConvert: (errorDescription: string) => void;
TESTING_ChatSendErrorConvert: (errorDescription: string) => void;
TESTING_KeyTransFatalVerificationFailure: () => void;
@@ -673,9 +673,9 @@ type NativeFunctions = {
TESTING_CdsiLookupResponseConvert: (asyncRuntime: Wrapper<TokioAsyncContext>) => CancellablePromise<LookupResponse>;
TESTING_CdsiLookupErrorConvert: (errorDescription: string) => void;
TESTING_ServerMessageAck_Create: () => ServerMessageAck;
TESTING_ConnectionManager_newLocalOverride: (userAgent: string, chatPort: number, cdsiPort: number, svr2Port: number, svrBPort: number, rootCertificateDer: Uint8Array) => ConnectionManager;
TESTING_ConnectionManager_newLocalOverride: (userAgent: string, chatPort: number, cdsiPort: number, svr2Port: number, svrBPort: number, rootCertificateDer: Uint8Array<ArrayBuffer>) => ConnectionManager;
TESTING_ConnectionManager_isUsingProxy: (manager: Wrapper<ConnectionManager>) => number;
TESTING_CreateOTP: (username: string, secret: Uint8Array) => string;
TESTING_CreateOTP: (username: string, secret: Uint8Array<ArrayBuffer>) => string;
TESTING_CreateOTPFromBase64: (username: string, secret: string) => string;
TESTING_SignedPublicPreKey_CheckBridgesCorrectly: (sourcePublicKey: Wrapper<PublicKey>, signedPreKey: SignedPublicPreKey) => void;
TestingSemaphore_New: (initial: number) => TestingSemaphore;
@@ -1807,16 +1807,16 @@ export interface AuthenticatedChatConnection { readonly __type: unique symbol; }
export interface ProvisioningChatConnection { readonly __type: unique symbol; }
export interface HttpRequest { readonly __type: unique symbol; }
export /*trait*/ type ChatListener = {
receivedIncomingMessage: (envelope: Uint8Array, timestamp: Timestamp, ack: ServerMessageAck) => void;
receivedIncomingMessage: (envelope: Uint8Array<ArrayBuffer>, timestamp: Timestamp, ack: ServerMessageAck) => void;
receivedQueueEmpty: () => void;
receivedAlerts: (alerts: string[]) => void;
connectionInterrupted: (disconnectCause: Error|null) => void;
connectionInterrupted: (disconnectCause: Error | null) => void;
};
export interface ServerMessageAck { readonly __type: unique symbol; }
export /*trait*/ type ProvisioningListener = {
receivedAddress: (address: string, sendAck: ServerMessageAck) => void;
receivedEnvelope: (envelope: Uint8Array, sendAck: ServerMessageAck) => void;
connectionInterrupted: (disconnectCause: Error|null) => void;
receivedEnvelope: (envelope: Uint8Array<ArrayBuffer>, sendAck: ServerMessageAck) => void;
connectionInterrupted: (disconnectCause: Error | null) => void;
};
export interface RegistrationService { readonly __type: unique symbol; }
export interface RegistrationSession { readonly __type: unique symbol; }

View File

@@ -25,14 +25,14 @@ export interface Recipient {
* material.
*/
export default class SealedSenderMultiRecipientMessage {
readonly _buffer: Uint8Array;
readonly _buffer: Uint8Array<ArrayBuffer>;
readonly _recipientMap: {
[serviceId: string]: Native.SealedSenderMultiRecipientMessageRecipient;
};
readonly _excludedRecipients: string[];
readonly _offsetOfSharedData: number;
constructor(buffer: Uint8Array) {
constructor(buffer: Uint8Array<ArrayBuffer>) {
const { recipientMap, excludedRecipients, offsetOfSharedData } =
Native.SealedSenderMultiRecipientMessage_Parse(buffer);
this._buffer = buffer;
@@ -68,7 +68,7 @@ export default class SealedSenderMultiRecipientMessage {
* {@link #recipientsByServiceIdString}. The same payload should be sent to all of the recipient's
* devices.
*/
messageForRecipient(recipient: Recipient): Uint8Array {
messageForRecipient(recipient: Recipient): Uint8Array<ArrayBuffer> {
const nativeRecipient =
recipient as Native.SealedSenderMultiRecipientMessageRecipient;
// Use Buffer.concat for convenience, but return a proper Uint8Array, both for the correct type

View File

@@ -27,6 +27,6 @@ import type {
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
*/
export function sanitize(input: Uint8Array): void {
export function sanitize(input: Uint8Array<ArrayBuffer>): void {
Native.WebpSanitizer_Sanitize(input);
}

View File

@@ -29,9 +29,9 @@ export function inferChunkSize(dataSize: number): ChunkSizeChoice {
class DigestingWritable extends stream.Writable {
_nativeHandle: Native.IncrementalMac;
_digests: Uint8Array[] = [];
_digests: Uint8Array<ArrayBuffer>[] = [];
constructor(key: Uint8Array, sizeChoice: ChunkSizeChoice) {
constructor(key: Uint8Array<ArrayBuffer>, sizeChoice: ChunkSizeChoice) {
super();
this._nativeHandle = Native.IncrementalMac_Initialize(
key,
@@ -39,7 +39,7 @@ class DigestingWritable extends stream.Writable {
);
}
getFinalDigest(): Uint8Array {
getFinalDigest(): Uint8Array<ArrayBuffer> {
// 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));
@@ -74,7 +74,7 @@ class DigestingWritable extends stream.Writable {
export class DigestingPassThrough extends stream.Transform {
private digester: DigestingWritable;
constructor(key: Uint8Array, sizeChoice: ChunkSizeChoice) {
constructor(key: Uint8Array<ArrayBuffer>, sizeChoice: ChunkSizeChoice) {
super();
this.digester = new DigestingWritable(key, sizeChoice);
@@ -84,12 +84,12 @@ export class DigestingPassThrough extends stream.Transform {
});
}
getFinalDigest(): Uint8Array {
getFinalDigest(): Uint8Array<ArrayBuffer> {
return this.digester.getFinalDigest();
}
public override _transform(
data: Uint8Array,
data: Uint8Array<ArrayBuffer>,
enc: BufferEncoding,
callback: CallbackType
): void {
@@ -119,9 +119,9 @@ class ValidatingWritable extends stream.Writable {
_validatedBytes = 0;
constructor(
key: Uint8Array,
key: Uint8Array<ArrayBuffer>,
sizeChoice: ChunkSizeChoice,
digest: Uint8Array
digest: Uint8Array<ArrayBuffer>
) {
super();
const handle = Native.ValidatingMac_Initialize(
@@ -177,12 +177,12 @@ class ValidatingWritable extends stream.Writable {
export class ValidatingPassThrough extends stream.Transform {
private validator: ValidatingWritable;
private buffer = new Array<Uint8Array>();
private buffer = new Array<Uint8Array<ArrayBuffer>>();
constructor(
key: Uint8Array,
key: Uint8Array<ArrayBuffer>,
sizeChoice: ChunkSizeChoice,
digest: Uint8Array
digest: Uint8Array<ArrayBuffer>
) {
super();
this.validator = new ValidatingWritable(key, sizeChoice, digest);
@@ -194,7 +194,7 @@ export class ValidatingPassThrough extends stream.Transform {
}
public override _transform(
data: Uint8Array,
data: Uint8Array<ArrayBuffer>,
enc: BufferEncoding,
callback: CallbackType
): void {
@@ -263,10 +263,8 @@ export function chunkSizeInBytes(sizeChoice: ChunkSizeChoice): number {
switch (sizeChoice.kind) {
case 'everyN':
return sizeChoice.n;
break;
case 'chunksOf':
return Native.IncrementalMac_CalculateChunkSize(sizeChoice.dataSize);
break;
}
}

View File

@@ -14,7 +14,7 @@ import { Aci, ProtocolAddress, ServiceId } from './Address.js';
export * from './Address.js';
import { IdentityKeyPair, PrivateKey, PublicKey } from './EcKeys.js';
export * from './EcKeys.js';
import { Uuid } from './uuid.js';
import { parseUuid, Uuid } from './uuid.js';
export * from './uuid.js';
export * as usernames from './usernames.js';
@@ -53,21 +53,21 @@ export enum ContentHint {
export function hkdf(
outputLength: number,
keyMaterial: Uint8Array,
label: Uint8Array,
salt: Uint8Array | null
): Uint8Array {
keyMaterial: Uint8Array<ArrayBuffer>,
label: Uint8Array<ArrayBuffer>,
salt: Uint8Array<ArrayBuffer> | null
): Uint8Array<ArrayBuffer> {
return Native.HKDF_DeriveSecrets(outputLength, keyMaterial, label, salt);
}
export class ScannableFingerprint {
private readonly scannable: Uint8Array;
private readonly scannable: Uint8Array<ArrayBuffer>;
private constructor(scannable: Uint8Array) {
private constructor(scannable: Uint8Array<ArrayBuffer>) {
this.scannable = scannable;
}
static _fromBuffer(scannable: Uint8Array): ScannableFingerprint {
static _fromBuffer(scannable: Uint8Array<ArrayBuffer>): ScannableFingerprint {
return new ScannableFingerprint(scannable);
}
@@ -75,7 +75,7 @@ export class ScannableFingerprint {
return Native.ScannableFingerprint_Compare(this.scannable, other.scannable);
}
toBuffer(): Uint8Array {
toBuffer(): Uint8Array<ArrayBuffer> {
return this.scannable;
}
}
@@ -106,9 +106,9 @@ export class Fingerprint {
static new(
iterations: number,
version: number,
localIdentifier: Uint8Array,
localIdentifier: Uint8Array<ArrayBuffer>,
localKey: PublicKey,
remoteIdentifier: Uint8Array,
remoteIdentifier: Uint8Array<ArrayBuffer>,
remoteKey: PublicKey
): Fingerprint {
return new Fingerprint(
@@ -146,11 +146,11 @@ export class Fingerprint {
export class Aes256GcmSiv {
readonly _nativeHandle: Native.Aes256GcmSiv;
private constructor(key: Uint8Array) {
private constructor(key: Uint8Array<ArrayBuffer>) {
this._nativeHandle = Native.Aes256GcmSiv_New(key);
}
static new(key: Uint8Array): Aes256GcmSiv {
static new(key: Uint8Array<ArrayBuffer>): Aes256GcmSiv {
return new Aes256GcmSiv(key);
}
@@ -164,10 +164,10 @@ export class Aes256GcmSiv {
* @returns The encrypted data, including an appended 16-byte authentication tag.
*/
encrypt(
message: Uint8Array,
nonce: Uint8Array,
associatedData: Uint8Array
): Uint8Array {
message: Uint8Array<ArrayBuffer>,
nonce: Uint8Array<ArrayBuffer>,
associatedData: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.Aes256GcmSiv_Encrypt(this, message, nonce, associatedData);
}
@@ -181,10 +181,10 @@ export class Aes256GcmSiv {
* @returns The decrypted data
*/
decrypt(
message: Uint8Array,
nonce: Uint8Array,
associatedData: Uint8Array
): Uint8Array {
message: Uint8Array<ArrayBuffer>,
nonce: Uint8Array<ArrayBuffer>,
associatedData: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.Aes256GcmSiv_Decrypt(this, message, nonce, associatedData);
}
}
@@ -200,11 +200,11 @@ export class KEMPublicKey {
return new KEMPublicKey(handle);
}
static deserialize(buf: Uint8Array): KEMPublicKey {
static deserialize(buf: Uint8Array<ArrayBuffer>): KEMPublicKey {
return new KEMPublicKey(Native.KyberPublicKey_Deserialize(buf));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.KyberPublicKey_Serialize(this);
}
}
@@ -220,11 +220,11 @@ export class KEMSecretKey {
return new KEMSecretKey(handle);
}
static deserialize(buf: Uint8Array): KEMSecretKey {
static deserialize(buf: Uint8Array<ArrayBuffer>): KEMSecretKey {
return new KEMSecretKey(Native.KyberSecretKey_Deserialize(buf));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.KyberSecretKey_Serialize(this);
}
}
@@ -261,14 +261,14 @@ export class KEMKeyPair {
export type SignedPublicPreKey = {
id: () => number;
publicKey: () => PublicKey;
signature: () => Uint8Array;
signature: () => Uint8Array<ArrayBuffer>;
};
/** The public information contained in a {@link KyberPreKeyRecord} */
export type SignedKyberPublicPreKey = {
id: () => number;
publicKey: () => KEMPublicKey;
signature: () => Uint8Array;
signature: () => Uint8Array<ArrayBuffer>;
};
export class PreKeyBundle {
@@ -285,11 +285,11 @@ export class PreKeyBundle {
prekey: PublicKey | null,
signed_prekey_id: number,
signed_prekey: PublicKey,
signed_prekey_signature: Uint8Array,
signed_prekey_signature: Uint8Array<ArrayBuffer>,
identity_key: PublicKey,
kyber_prekey_id: number,
kyber_prekey: KEMPublicKey,
kyber_prekey_signature: Uint8Array
kyber_prekey_signature: Uint8Array<ArrayBuffer>
): PreKeyBundle {
return new PreKeyBundle(
Native.PreKeyBundle_New(
@@ -339,7 +339,7 @@ export class PreKeyBundle {
Native.PreKeyBundle_GetSignedPreKeyPublic(this)
);
}
signedPreKeySignature(): Uint8Array {
signedPreKeySignature(): Uint8Array<ArrayBuffer> {
return Native.PreKeyBundle_GetSignedPreKeySignature(this);
}
@@ -353,7 +353,7 @@ export class PreKeyBundle {
);
}
kyberPreKeySignature(): Uint8Array {
kyberPreKeySignature(): Uint8Array<ArrayBuffer> {
return Native.PreKeyBundle_GetKyberPreKeySignature(this);
}
}
@@ -373,7 +373,7 @@ export class PreKeyRecord {
return new PreKeyRecord(Native.PreKeyRecord_New(id, pubKey, privKey));
}
static deserialize(buffer: Uint8Array): PreKeyRecord {
static deserialize(buffer: Uint8Array<ArrayBuffer>): PreKeyRecord {
return new PreKeyRecord(Native.PreKeyRecord_Deserialize(buffer));
}
@@ -391,7 +391,7 @@ export class PreKeyRecord {
return PublicKey._fromNativeHandle(Native.PreKeyRecord_GetPublicKey(this));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.PreKeyRecord_Serialize(this);
}
}
@@ -414,14 +414,14 @@ export class SignedPreKeyRecord implements SignedPublicPreKey {
timestamp: number,
pubKey: PublicKey,
privKey: PrivateKey,
signature: Uint8Array
signature: Uint8Array<ArrayBuffer>
): SignedPreKeyRecord {
return new SignedPreKeyRecord(
Native.SignedPreKeyRecord_New(id, timestamp, pubKey, privKey, signature)
);
}
static deserialize(buffer: Uint8Array): SignedPreKeyRecord {
static deserialize(buffer: Uint8Array<ArrayBuffer>): SignedPreKeyRecord {
return new SignedPreKeyRecord(
Native.SignedPreKeyRecord_Deserialize(buffer)
);
@@ -443,11 +443,11 @@ export class SignedPreKeyRecord implements SignedPublicPreKey {
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SignedPreKeyRecord_Serialize(this);
}
signature(): Uint8Array {
signature(): Uint8Array<ArrayBuffer> {
return Native.SignedPreKeyRecord_GetSignature(this);
}
@@ -473,18 +473,18 @@ export class KyberPreKeyRecord implements SignedKyberPublicPreKey {
id: number,
timestamp: number,
keyPair: KEMKeyPair,
signature: Uint8Array
signature: Uint8Array<ArrayBuffer>
): KyberPreKeyRecord {
return new KyberPreKeyRecord(
Native.KyberPreKeyRecord_New(id, timestamp, keyPair, signature)
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.KyberPreKeyRecord_Serialize(this);
}
static deserialize(buffer: Uint8Array): KyberPreKeyRecord {
static deserialize(buffer: Uint8Array<ArrayBuffer>): KyberPreKeyRecord {
return new KyberPreKeyRecord(Native.KyberPreKeyRecord_Deserialize(buffer));
}
@@ -510,7 +510,7 @@ export class KyberPreKeyRecord implements SignedKyberPublicPreKey {
);
}
signature(): Uint8Array {
signature(): Uint8Array<ArrayBuffer> {
return Native.KyberPreKeyRecord_GetSignature(this);
}
@@ -528,14 +528,14 @@ export class SignalMessage {
static _new(
messageVersion: number,
macKey: Uint8Array,
macKey: Uint8Array<ArrayBuffer>,
senderRatchetKey: PublicKey,
counter: number,
previousCounter: number,
ciphertext: Uint8Array,
ciphertext: Uint8Array<ArrayBuffer>,
senderIdentityKey: PublicKey,
receiverIdentityKey: PublicKey,
pqRatchet: Uint8Array
pqRatchet: Uint8Array<ArrayBuffer>
): SignalMessage {
return new SignalMessage(
Native.SignalMessage_New(
@@ -552,15 +552,15 @@ export class SignalMessage {
);
}
static deserialize(buffer: Uint8Array): SignalMessage {
static deserialize(buffer: Uint8Array<ArrayBuffer>): SignalMessage {
return new SignalMessage(Native.SignalMessage_Deserialize(buffer));
}
body(): Uint8Array {
body(): Uint8Array<ArrayBuffer> {
return Native.SignalMessage_GetBody(this);
}
pqRatchet(): Uint8Array {
pqRatchet(): Uint8Array<ArrayBuffer> {
return Native.SignalMessage_GetPqRatchet(this);
}
@@ -572,14 +572,14 @@ export class SignalMessage {
return Native.SignalMessage_GetMessageVersion(this);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SignalMessage_GetSerialized(this);
}
verifyMac(
senderIdentityKey: PublicKey,
recevierIdentityKey: PublicKey,
macKey: Uint8Array
macKey: Uint8Array<ArrayBuffer>
): boolean {
return Native.SignalMessage_VerifyMac(
this,
@@ -619,7 +619,7 @@ export class PreKeySignalMessage {
);
}
static deserialize(buffer: Uint8Array): PreKeySignalMessage {
static deserialize(buffer: Uint8Array<ArrayBuffer>): PreKeySignalMessage {
return new PreKeySignalMessage(
Native.PreKeySignalMessage_Deserialize(buffer)
);
@@ -641,7 +641,7 @@ export class PreKeySignalMessage {
return Native.PreKeySignalMessage_GetVersion(this);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.PreKeySignalMessage_Serialize(this);
}
}
@@ -657,11 +657,11 @@ export class SessionRecord {
return new SessionRecord(nativeHandle);
}
static deserialize(buffer: Uint8Array): SessionRecord {
static deserialize(buffer: Uint8Array<ArrayBuffer>): SessionRecord {
return new SessionRecord(Native.SessionRecord_Deserialize(buffer));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SessionRecord_Serialize(this);
}
@@ -714,11 +714,11 @@ export class ServerCertificate {
);
}
static deserialize(buffer: Uint8Array): ServerCertificate {
static deserialize(buffer: Uint8Array<ArrayBuffer>): ServerCertificate {
return new ServerCertificate(Native.ServerCertificate_Deserialize(buffer));
}
certificateData(): Uint8Array {
certificateData(): Uint8Array<ArrayBuffer> {
return Native.ServerCertificate_GetCertificate(this);
}
@@ -730,11 +730,11 @@ export class ServerCertificate {
return Native.ServerCertificate_GetKeyId(this);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.ServerCertificate_GetSerialized(this);
}
signature(): Uint8Array {
signature(): Uint8Array<ArrayBuffer> {
return Native.ServerCertificate_GetSignature(this);
}
}
@@ -752,11 +752,11 @@ export class SenderKeyRecord {
this._nativeHandle = nativeHandle;
}
static deserialize(buffer: Uint8Array): SenderKeyRecord {
static deserialize(buffer: Uint8Array<ArrayBuffer>): SenderKeyRecord {
return new SenderKeyRecord(Native.SenderKeyRecord_Deserialize(buffer));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SenderKeyRecord_Serialize(this);
}
}
@@ -799,15 +799,15 @@ export class SenderCertificate {
);
}
static deserialize(buffer: Uint8Array): SenderCertificate {
static deserialize(buffer: Uint8Array<ArrayBuffer>): SenderCertificate {
return new SenderCertificate(Native.SenderCertificate_Deserialize(buffer));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SenderCertificate_GetSerialized(this);
}
certificate(): Uint8Array {
certificate(): Uint8Array<ArrayBuffer> {
return Native.SenderCertificate_GetCertificate(this);
}
expiration(): number {
@@ -842,7 +842,7 @@ export class SenderCertificate {
Native.SenderCertificate_GetServerCertificate(this)
);
}
signature(): Uint8Array {
signature(): Uint8Array<ArrayBuffer> {
return Native.SenderCertificate_GetSignature(this);
}
@@ -910,7 +910,7 @@ export class SenderKeyDistributionMessage {
): Promise<SenderKeyDistributionMessage> {
const handle = await Native.SenderKeyDistributionMessage_Create(
sender,
uuid.parse(distributionId),
parseUuid(distributionId),
bridgeSenderKeyStore(store)
);
return new SenderKeyDistributionMessage(handle);
@@ -921,13 +921,13 @@ export class SenderKeyDistributionMessage {
distributionId: Uuid,
chainId: number,
iteration: number,
chainKey: Uint8Array,
chainKey: Uint8Array<ArrayBuffer>,
pk: PublicKey
): SenderKeyDistributionMessage {
return new SenderKeyDistributionMessage(
Native.SenderKeyDistributionMessage_New(
messageVersion,
uuid.parse(distributionId),
parseUuid(distributionId),
chainId,
iteration,
chainKey,
@@ -936,17 +936,19 @@ export class SenderKeyDistributionMessage {
);
}
static deserialize(buffer: Uint8Array): SenderKeyDistributionMessage {
static deserialize(
buffer: Uint8Array<ArrayBuffer>
): SenderKeyDistributionMessage {
return new SenderKeyDistributionMessage(
Native.SenderKeyDistributionMessage_Deserialize(buffer)
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SenderKeyDistributionMessage_Serialize(this);
}
chainKey(): Uint8Array {
chainKey(): Uint8Array<ArrayBuffer> {
return Native.SenderKeyDistributionMessage_GetChainKey(this);
}
@@ -989,13 +991,13 @@ export class SenderKeyMessage {
distributionId: Uuid,
chainId: number,
iteration: number,
ciphertext: Uint8Array,
ciphertext: Uint8Array<ArrayBuffer>,
pk: PrivateKey
): SenderKeyMessage {
return new SenderKeyMessage(
Native.SenderKeyMessage_New(
messageVersion,
uuid.parse(distributionId),
parseUuid(distributionId),
chainId,
iteration,
ciphertext,
@@ -1004,15 +1006,15 @@ export class SenderKeyMessage {
);
}
static deserialize(buffer: Uint8Array): SenderKeyMessage {
static deserialize(buffer: Uint8Array<ArrayBuffer>): SenderKeyMessage {
return new SenderKeyMessage(Native.SenderKeyMessage_Deserialize(buffer));
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.SenderKeyMessage_Serialize(this);
}
ciphertext(): Uint8Array {
ciphertext(): Uint8Array<ArrayBuffer> {
return Native.SenderKeyMessage_GetCipherText(this);
}
@@ -1050,7 +1052,7 @@ export class UnidentifiedSenderMessageContent {
message: CiphertextMessage,
sender: SenderCertificate,
contentHint: number,
groupId: Uint8Array | null
groupId: Uint8Array<ArrayBuffer> | null
): UnidentifiedSenderMessageContent {
return new UnidentifiedSenderMessageContent(
Native.UnidentifiedSenderMessageContent_New(
@@ -1062,17 +1064,19 @@ export class UnidentifiedSenderMessageContent {
);
}
static deserialize(buffer: Uint8Array): UnidentifiedSenderMessageContent {
static deserialize(
buffer: Uint8Array<ArrayBuffer>
): UnidentifiedSenderMessageContent {
return new UnidentifiedSenderMessageContent(
Native.UnidentifiedSenderMessageContent_Deserialize(buffer)
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.UnidentifiedSenderMessageContent_Serialize(this);
}
contents(): Uint8Array {
contents(): Uint8Array<ArrayBuffer> {
return Native.UnidentifiedSenderMessageContent_GetContents(this);
}
@@ -1090,7 +1094,7 @@ export class UnidentifiedSenderMessageContent {
return Native.UnidentifiedSenderMessageContent_GetContentHint(this);
}
groupId(): Uint8Array | null {
groupId(): Uint8Array<ArrayBuffer> | null {
return Native.UnidentifiedSenderMessageContent_GetGroupId(this);
}
}
@@ -1174,12 +1178,12 @@ export async function groupEncrypt(
sender: ProtocolAddress,
distributionId: Uuid,
store: SenderKeyStore,
message: Uint8Array
message: Uint8Array<ArrayBuffer>
): Promise<CiphertextMessage> {
return CiphertextMessage._fromNativeHandle(
await Native.GroupCipher_EncryptMessage(
sender,
uuid.parse(distributionId),
parseUuid(distributionId),
message,
bridgeSenderKeyStore(store)
)
@@ -1189,8 +1193,8 @@ export async function groupEncrypt(
export async function groupDecrypt(
sender: ProtocolAddress,
store: SenderKeyStore,
message: Uint8Array
): Promise<Uint8Array> {
message: Uint8Array<ArrayBuffer>
): Promise<Uint8Array<ArrayBuffer>> {
return Native.GroupCipher_DecryptMessage(
sender,
message,
@@ -1211,7 +1215,7 @@ export class SealedSenderDecryptionResult {
return new SealedSenderDecryptionResult(nativeHandle);
}
message(): Uint8Array {
message(): Uint8Array<ArrayBuffer> {
return Native.SealedSenderDecryptionResult_Message(this);
}
@@ -1262,7 +1266,7 @@ export class CiphertextMessage {
return message.asCiphertextMessage();
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.CiphertextMessage_Serialize(this);
}
@@ -1278,7 +1282,7 @@ export class PlaintextContent implements CiphertextMessageConvertible {
this._nativeHandle = nativeHandle;
}
static deserialize(buffer: Uint8Array): PlaintextContent {
static deserialize(buffer: Uint8Array<ArrayBuffer>): PlaintextContent {
return new PlaintextContent(Native.PlaintextContent_Deserialize(buffer));
}
@@ -1288,11 +1292,11 @@ export class PlaintextContent implements CiphertextMessageConvertible {
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.PlaintextContent_Serialize(this);
}
body(): Uint8Array {
body(): Uint8Array<ArrayBuffer> {
return Native.PlaintextContent_GetBody(this);
}
@@ -1317,7 +1321,7 @@ export class DecryptionErrorMessage {
}
static forOriginal(
bytes: Uint8Array,
bytes: Uint8Array<ArrayBuffer>,
type: CiphertextMessageType,
timestamp: number,
originalSenderDeviceId: number
@@ -1332,19 +1336,21 @@ export class DecryptionErrorMessage {
);
}
static deserialize(buffer: Uint8Array): DecryptionErrorMessage {
static deserialize(buffer: Uint8Array<ArrayBuffer>): DecryptionErrorMessage {
return new DecryptionErrorMessage(
Native.DecryptionErrorMessage_Deserialize(buffer)
);
}
static extractFromSerializedBody(buffer: Uint8Array): DecryptionErrorMessage {
static extractFromSerializedBody(
buffer: Uint8Array<ArrayBuffer>
): DecryptionErrorMessage {
return new DecryptionErrorMessage(
Native.DecryptionErrorMessage_ExtractFromSerializedContent(buffer)
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.DecryptionErrorMessage_Serialize(this);
}
@@ -1452,7 +1458,7 @@ export function processPreKeyBundle(
}
export async function signalEncrypt(
message: Uint8Array,
message: Uint8Array<ArrayBuffer>,
address: ProtocolAddress,
sessionStore: SessionStore,
identityStore: IdentityKeyStore,
@@ -1474,7 +1480,7 @@ export function signalDecrypt(
address: ProtocolAddress,
sessionStore: SessionStore,
identityStore: IdentityKeyStore
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
return Native.SessionCipher_DecryptSignalMessage(
message,
address,
@@ -1557,7 +1563,7 @@ export function signalDecryptPreKey(
prekeyStore: PreKeyStore,
signedPrekeyStore: SignedPreKeyStore,
kyberPrekeyStore: KyberPreKeyStore
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
return Native.SessionCipher_DecryptPreKeySignalMessage(
message,
address,
@@ -1570,12 +1576,12 @@ export function signalDecryptPreKey(
}
export async function sealedSenderEncryptMessage(
message: Uint8Array,
message: Uint8Array<ArrayBuffer>,
address: ProtocolAddress,
senderCert: SenderCertificate,
sessionStore: SessionStore,
identityStore: IdentityKeyStore
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
const ciphertext = await signalEncrypt(
message,
address,
@@ -1595,7 +1601,7 @@ export function sealedSenderEncrypt(
content: UnidentifiedSenderMessageContent,
address: ProtocolAddress,
identityStore: IdentityKeyStore
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
return Native.SealedSender_Encrypt(
address,
content,
@@ -1613,13 +1619,13 @@ export type SealedSenderMultiRecipientEncryptOptions = {
export async function sealedSenderMultiRecipientEncrypt(
options: SealedSenderMultiRecipientEncryptOptions
): Promise<Uint8Array>;
): Promise<Uint8Array<ArrayBuffer>>;
export async function sealedSenderMultiRecipientEncrypt(
content: UnidentifiedSenderMessageContent,
recipients: ProtocolAddress[],
identityStore: IdentityKeyStore,
sessionStore: SessionStore
): Promise<Uint8Array>;
): Promise<Uint8Array<ArrayBuffer>>;
export async function sealedSenderMultiRecipientEncrypt(
contentOrOptions:
@@ -1628,7 +1634,7 @@ export async function sealedSenderMultiRecipientEncrypt(
recipients?: ProtocolAddress[],
identityStore?: IdentityKeyStore,
sessionStore?: SessionStore
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
let excludedRecipients: ServiceId[] | undefined = undefined;
if (contentOrOptions instanceof UnidentifiedSenderMessageContent) {
if (!recipients || !identityStore || !sessionStore) {
@@ -1656,13 +1662,13 @@ export async function sealedSenderMultiRecipientEncrypt(
// For testing only
export function sealedSenderMultiRecipientMessageForSingleRecipient(
message: Uint8Array
): Uint8Array {
message: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.SealedSender_MultiRecipientMessageForSingleRecipient(message);
}
export async function sealedSenderDecryptMessage(
message: Uint8Array,
message: Uint8Array<ArrayBuffer>,
trustRoot: PublicKey,
timestamp: number,
localE164: string | null,
@@ -1691,7 +1697,7 @@ export async function sealedSenderDecryptMessage(
}
export async function sealedSenderDecryptToUsmc(
message: Uint8Array,
message: Uint8Array<ArrayBuffer>,
identityStore: IdentityKeyStore
): Promise<UnidentifiedSenderMessageContent> {
const usmc = await Native.SealedSender_DecryptToUsmc(
@@ -1709,8 +1715,8 @@ export class Cds2Client {
}
static new(
mrenclave: Uint8Array,
attestationMsg: Uint8Array,
mrenclave: Uint8Array<ArrayBuffer>,
attestationMsg: Uint8Array<ArrayBuffer>,
currentTimestamp: Date
): Cds2Client {
return new Cds2Client(
@@ -1722,19 +1728,19 @@ export class Cds2Client {
);
}
initialRequest(): Uint8Array {
initialRequest(): Uint8Array<ArrayBuffer> {
return Native.SgxClientState_InitialRequest(this);
}
completeHandshake(buffer: Uint8Array): void {
completeHandshake(buffer: Uint8Array<ArrayBuffer>): void {
return Native.SgxClientState_CompleteHandshake(this, buffer);
}
establishedSend(buffer: Uint8Array): Uint8Array {
establishedSend(buffer: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
return Native.SgxClientState_EstablishedSend(this, buffer);
}
establishedRecv(buffer: Uint8Array): Uint8Array {
establishedRecv(buffer: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
return Native.SgxClientState_EstablishedRecv(this, buffer);
}
}
@@ -1747,8 +1753,8 @@ export class HsmEnclaveClient {
}
static new(
public_key: Uint8Array,
code_hashes: Uint8Array[]
public_key: Uint8Array<ArrayBuffer>,
code_hashes: Uint8Array<ArrayBuffer>[]
): HsmEnclaveClient {
code_hashes.forEach((hash) => {
if (hash.length != 32) {
@@ -1762,19 +1768,19 @@ export class HsmEnclaveClient {
);
}
initialRequest(): Uint8Array {
initialRequest(): Uint8Array<ArrayBuffer> {
return Native.HsmEnclaveClient_InitialRequest(this);
}
completeHandshake(buffer: Uint8Array): void {
completeHandshake(buffer: Uint8Array<ArrayBuffer>): void {
return Native.HsmEnclaveClient_CompleteHandshake(this, buffer);
}
establishedSend(buffer: Uint8Array): Uint8Array {
establishedSend(buffer: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
return Native.HsmEnclaveClient_EstablishedSend(this, buffer);
}
establishedRecv(buffer: Uint8Array): Uint8Array {
establishedRecv(buffer: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
return Native.HsmEnclaveClient_EstablishedRecv(this, buffer);
}
}

View File

@@ -10,7 +10,7 @@ import type { IoError } from './Errors.js';
* An abstract class representing an input stream of bytes.
*/
export abstract class InputStream implements Native.InputStream {
_read(amount: number): Promise<Uint8Array> {
_read(amount: number): Promise<Uint8Array<ArrayBuffer>> {
return this.read(amount);
}
@@ -37,7 +37,7 @@ export abstract class InputStream implements Native.InputStream {
* @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<Uint8Array>;
abstract read(amount: number): Promise<Uint8Array<ArrayBuffer>>;
/**
* Skip an amount of bytes in the input stream.

View File

@@ -59,7 +59,7 @@ export type ChatRequest = Readonly<{
verb: string;
path: string;
headers: ReadonlyArray<[string, string]>;
body?: Uint8Array;
body?: Uint8Array<ArrayBuffer>;
timeoutMillis?: number;
}>;
@@ -108,7 +108,7 @@ export type NetConstructorOptions = Readonly<
TESTING_localServer_cdsiPort: number;
TESTING_localServer_svr2Port: number;
TESTING_localServer_svrBPort: number;
TESTING_localServer_rootCertificateDer: Uint8Array;
TESTING_localServer_rootCertificateDer: Uint8Array<ArrayBuffer>;
}
>;

View File

@@ -16,7 +16,7 @@ export type ChatRequest = Readonly<{
verb: string;
path: string;
headers: ReadonlyArray<[string, string]>;
body?: Uint8Array;
body?: Uint8Array<ArrayBuffer>;
timeoutMillis?: number;
}>;
@@ -55,7 +55,7 @@ export interface ChatServiceListener extends ConnectionEventsListener {
* queue and attempt to deliver it again in the future.
*/
onIncomingMessage: (
envelope: Uint8Array,
envelope: Uint8Array<ArrayBuffer>,
timestamp: number,
ack: ChatServerMessageAck
) => void;
@@ -93,7 +93,10 @@ export interface ProvisioningConnectionListener
*
* Once the server receives the `ack` for this message, it will close this connection.
*/
onReceivedEnvelope: (envelope: Uint8Array, ack: ChatServerMessageAck) => void;
onReceivedEnvelope: (
envelope: Uint8Array<ArrayBuffer>,
ack: ChatServerMessageAck
) => void;
}
/**
@@ -452,7 +455,7 @@ export class ProvisioningConnection {
listener.onReceivedAddress(address, new ChatServerMessageAck(ack));
},
receivedEnvelope(
envelope: Uint8Array,
envelope: Uint8Array<ArrayBuffer>,
ack: Native.ServerMessageAck
): void {
listener.onReceivedEnvelope(envelope, new ChatServerMessageAck(ack));
@@ -511,7 +514,7 @@ class WeakListenerWrapper implements Native.ChatListener {
this.listener.deref()?.connectionInterrupted(reason);
}
receivedIncomingMessage(
envelope: Uint8Array,
envelope: Uint8Array<ArrayBuffer>,
timestamp: number,
ack: Native.ServerMessageAck
): void {
@@ -534,7 +537,10 @@ class WeakProvisioningListenerWrapper implements Native.ProvisioningListener {
receivedAddress(address: string, ack: Native.ServerMessageAck): void {
this.listener.deref()?.receivedAddress(address, ack);
}
receivedEnvelope(envelope: Uint8Array, ack: Native.ServerMessageAck): void {
receivedEnvelope(
envelope: Uint8Array<ArrayBuffer>,
ack: Native.ServerMessageAck
): void {
this.listener.deref()?.receivedEnvelope(envelope, ack);
}
connectionInterrupted(reason: Error | null): void {
@@ -549,7 +555,7 @@ function makeNativeChatListener(
if ('onQueueEmpty' in listener) {
return {
receivedIncomingMessage(
envelope: Uint8Array,
envelope: Uint8Array<ArrayBuffer>,
timestamp: number,
ack: Native.ServerMessageAck
): void {
@@ -573,7 +579,7 @@ function makeNativeChatListener(
return {
receivedIncomingMessage(
_envelope: Uint8Array,
_envelope: Uint8Array<ArrayBuffer>,
_timestamp: number,
_ack: Native.ServerMessageAck
): void {

View File

@@ -36,7 +36,7 @@ export class InternalRequest implements Native.Wrapper<Native.HttpRequest> {
);
}
public get body(): Uint8Array {
public get body(): Uint8Array<ArrayBuffer> {
return Native.TESTING_ChatRequestGetBody(this);
}
}
@@ -46,7 +46,7 @@ export type ServerResponse = {
status: number;
message?: string;
headers?: string[];
body?: Uint8Array;
body?: Uint8Array<ArrayBuffer>;
};
export class FakeChatRemote {
@@ -98,11 +98,11 @@ export class FakeChatRemote {
Native.TESTING_FakeChatRemoteEnd_SendServerResponse(this, nativeResponse);
}
public sendRawServerResponse(bytes: Uint8Array): void {
public sendRawServerResponse(bytes: Uint8Array<ArrayBuffer>): void {
Native.TESTING_FakeChatRemoteEnd_SendRawServerResponse(this, bytes);
}
public sendRawServerRequest(bytes: Uint8Array): void {
public sendRawServerRequest(bytes: Uint8Array<ArrayBuffer>): void {
Native.TESTING_FakeChatRemoteEnd_SendRawServerRequest(this, bytes);
}

View File

@@ -25,13 +25,16 @@ import {
* used by the {@link Client}.
*/
export interface Store {
getLastDistinguishedTreeHead: () => Promise<Uint8Array | null>;
getLastDistinguishedTreeHead: () => Promise<Uint8Array<ArrayBuffer> | null>;
setLastDistinguishedTreeHead: (
bytes: Readonly<Uint8Array> | null
bytes: Readonly<Uint8Array<ArrayBuffer>> | null
) => Promise<void>;
getAccountData: (aci: Aci) => Promise<Uint8Array | null>;
setAccountData: (aci: Aci, bytes: Readonly<Uint8Array>) => Promise<void>;
getAccountData: (aci: Aci) => Promise<Uint8Array<ArrayBuffer> | null>;
setAccountData: (
aci: Aci,
bytes: Readonly<Uint8Array<ArrayBuffer>>
) => Promise<void>;
}
/**
@@ -51,7 +54,7 @@ export type AciInfo = { aci: Aci; identityKey: PublicKey };
*/
export type E164Info = {
e164: string;
unidentifiedAccessKey: Readonly<Uint8Array>;
unidentifiedAccessKey: Readonly<Uint8Array<ArrayBuffer>>;
};
/**
@@ -64,7 +67,7 @@ export type Request = {
/** Unidentified access key associated with the account. Optional. */
e164Info?: E164Info;
/* Hash of the username associated with the account. Optional. */
usernameHash?: Readonly<Uint8Array>;
usernameHash?: Readonly<Uint8Array<ArrayBuffer>>;
};
/**
@@ -280,7 +283,7 @@ export class ClientImpl implements Client {
private async updateDistinguished(
store: Store,
{ abortSignal }: Readonly<Options>
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
const bytes = await this.asyncContext.makeCancellable(
abortSignal,
Native.KeyTransparency_Distinguished(
@@ -297,7 +300,7 @@ export class ClientImpl implements Client {
async _getLatestDistinguished(
store: Store,
options: Readonly<Options>
): Promise<Uint8Array> {
): Promise<Uint8Array<ArrayBuffer>> {
return (
(await store.getLastDistinguishedTreeHead()) ??
(await this.updateDistinguished(store, options))

View File

@@ -318,11 +318,11 @@ export class AccountAttributes {
capabilities,
discoverableByPhoneNumber,
}: {
recoveryPassword: Uint8Array;
recoveryPassword: Uint8Array<ArrayBuffer>;
aciRegistrationId: number;
pniRegistrationId: number;
registrationLock: string | null;
unidentifiedAccessKey: Uint8Array;
unidentifiedAccessKey: Uint8Array<ArrayBuffer>;
unrestrictedUnidentifiedAccess: boolean;
capabilities: Set<string>;
discoverableByPhoneNumber: boolean;
@@ -361,10 +361,10 @@ export class RegisterAccountResponse {
return Native.RegisterAccountResponse_GetNumber(this);
}
public get usernameHash(): Uint8Array | null {
public get usernameHash(): Uint8Array<ArrayBuffer> | null {
return Native.RegisterAccountResponse_GetUsernameHash(this);
}
public get usernameLinkHandle(): Uint8Array | null {
public get usernameLinkHandle(): Uint8Array<ArrayBuffer> | null {
return Native.RegisterAccountResponse_GetUsernameLinkHandle(this);
}

View File

@@ -45,7 +45,7 @@ export type StoreBackupResponse = {
* to fetch the forward secrecy token from SVR-B. This is currently stored in the header of
* the backup file.
*/
metadata: Uint8Array;
metadata: Uint8Array<ArrayBuffer>;
/**
* Opaque value that must be persisted and provided to the next call to {@link SvrB#store}.
@@ -53,7 +53,7 @@ export type StoreBackupResponse = {
* See the {@link SvrB} documentation for lifecycle and persistence handling
* for this value.
*/
nextBackupSecretData: Uint8Array;
nextBackupSecretData: Uint8Array<ArrayBuffer>;
};
class StoreBackupResponseImpl implements StoreBackupResponse {
@@ -66,11 +66,11 @@ class StoreBackupResponseImpl implements StoreBackupResponse {
return new BackupForwardSecrecyToken(tokenBytes);
}
get metadata(): Uint8Array {
get metadata(): Uint8Array<ArrayBuffer> {
return Native.BackupStoreResponse_GetOpaqueMetadata(this);
}
get nextBackupSecretData(): Uint8Array {
get nextBackupSecretData(): Uint8Array<ArrayBuffer> {
return Native.BackupStoreResponse_GetNextBackupSecretData(this);
}
}
@@ -100,7 +100,7 @@ export type RestoreBackupResponse = {
* See the {@link SvrB} documentation for lifecycle and persistence handling
* for this value.
*/
nextBackupSecretData: Uint8Array;
nextBackupSecretData: Uint8Array<ArrayBuffer>;
};
class RestoreBackupResponseImpl implements RestoreBackupResponse {
@@ -114,7 +114,7 @@ class RestoreBackupResponseImpl implements RestoreBackupResponse {
return new BackupForwardSecrecyToken(tokenBytes);
}
get nextBackupSecretData(): Uint8Array {
get nextBackupSecretData(): Uint8Array<ArrayBuffer> {
return Native.BackupRestoreResponse_GetNextBackupSecretData(this);
}
}
@@ -197,7 +197,7 @@ export class SvrB {
* Should not be used if any previous backups exist for this `backupKey`, whether uploaded or
* restored by the local device. See {@link SvrB} for more information.
*/
createNewBackupChain(backupKey: BackupKey): Uint8Array {
createNewBackupChain(backupKey: BackupKey): Uint8Array<ArrayBuffer> {
return Native.SecureValueRecoveryForBackups_CreateNewBackupChain(
this.environment,
backupKey.serialize()
@@ -235,7 +235,7 @@ export class SvrB {
*/
async store(
backupKey: BackupKey,
previousSecretData: Uint8Array,
previousSecretData: Uint8Array<ArrayBuffer>,
options?: { abortSignal?: AbortSignal }
): Promise<StoreBackupResponse> {
const promise = Native.SecureValueRecoveryForBackups_StoreBackup(
@@ -289,7 +289,7 @@ export class SvrB {
*/
async restore(
backupKey: BackupKey,
metadata: Uint8Array,
metadata: Uint8Array<ArrayBuffer>,
options?: { abortSignal?: AbortSignal }
): Promise<RestoreBackupResponse> {
const promise =

View File

@@ -25,7 +25,7 @@ declare module '../Chat' {
/** See {@link UnauthMessagesService#sendMultiRecipientMessage}. */
export type MultiRecipientMessageRequest = Readonly<{
payload: Uint8Array;
payload: Uint8Array<ArrayBuffer>;
timestamp: number;
auth: 'story' | GroupSendFullToken;
onlineOnly: boolean;

View File

@@ -8,7 +8,7 @@ import * as uuid from 'uuid';
import * as Native from '../../Native.js';
import { Aci } from '../../Address.js';
import { Uuid } from '../../uuid.js';
import { parseUuid, Uuid } from '../../uuid.js';
import { RequestOptions, UnauthenticatedChatConnection } from '../Chat.js';
// For documentation
@@ -35,7 +35,7 @@ export interface UnauthUsernamesService {
*/
lookUpUsernameHash: (
request: {
hash: Uint8Array;
hash: Uint8Array<ArrayBuffer>;
},
options?: RequestOptions
) => Promise<Aci | null>;
@@ -54,17 +54,17 @@ export interface UnauthUsernamesService {
lookUpUsernameLink: (
request: {
uuid: Uuid;
entropy: Uint8Array;
entropy: Uint8Array<ArrayBuffer>;
},
options?: RequestOptions
) => Promise<{ username: string; hash: Uint8Array } | null>;
) => Promise<{ username: string; hash: Uint8Array<ArrayBuffer> } | null>;
}
UnauthenticatedChatConnection.prototype.lookUpUsernameHash = async function (
{
hash,
}: {
hash: Uint8Array;
hash: Uint8Array<ArrayBuffer>;
},
options?: RequestOptions
): Promise<Aci | null> {
@@ -85,16 +85,16 @@ UnauthenticatedChatConnection.prototype.lookUpUsernameLink = async function (
entropy,
}: {
uuid: Uuid;
entropy: Uint8Array;
entropy: Uint8Array<ArrayBuffer>;
},
options?: RequestOptions
): Promise<{ username: string; hash: Uint8Array } | null> {
): Promise<{ username: string; hash: Uint8Array<ArrayBuffer> } | null> {
const response = await this._asyncContext.makeCancellable(
options?.abortSignal,
Native.UnauthenticatedChatConnection_look_up_username_link(
this._asyncContext,
this._chatService,
uuid.parse(linkUuid),
parseUuid(linkUuid),
entropy
)
);

View File

@@ -3,11 +3,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
//
import * as uuid from 'uuid';
import { assert, use } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import * as Native from '../Native.js';
import { BridgedStringMap } from '../internal.js';
import { parseUuid } from '../uuid.js';
use(chaiAsPromised);
@@ -195,7 +195,7 @@ describe('bridge_fn', () => {
const present = Native.TESTING_ConvertOptionalUuid(true);
assert.deepEqual(
present,
uuid.parse('abababab-1212-8989-baba-565656565656')
parseUuid('abababab-1212-8989-baba-565656565656')
);
const absent = Native.TESTING_ConvertOptionalUuid(false);

View File

@@ -72,7 +72,7 @@ class ChatServer {
let chatServer: ChatServer;
let network: Net;
function pemToDer(pem: string): Buffer {
function pemToDer(pem: string): Buffer<ArrayBuffer> {
const pemContent = pem
.replace(/-----BEGIN [^-]+-----/, '')
.replace(/-----END [^-]+-----/, '')
@@ -128,7 +128,7 @@ describe('chat connection to mock server', () => {
async (listener: ConnectionEventsListener | ChatServiceListener) => {
const serviceListener = {
onIncomingMessage: (
_envelope: Uint8Array,
_envelope: Uint8Array<ArrayBuffer>,
_timestamp: number,
_ack: ChatServerMessageAck
) => {},
@@ -188,7 +188,7 @@ describe('chat connection to mock server', () => {
void promisedAlerts.resolve(alerts);
},
onIncomingMessage: (
_envelope: Uint8Array,
_envelope: Uint8Array<ArrayBuffer>,
_timestamp: number,
_ack: ChatServerMessageAck
) => {},

View File

@@ -20,7 +20,7 @@ describe('HsmEnclaveClient', () => {
);
it('create client', () => {
const hashes: Buffer[] = [];
const hashes: Buffer<ArrayBuffer>[] = [];
hashes.push(
Buffer.from(
'0000000000000000000000000000000000000000000000000000000000000000',
@@ -41,7 +41,7 @@ describe('HsmEnclaveClient', () => {
assert.lengthOf(initialMessage, 112, 'initial message length');
});
it('invalid hashes', () => {
const hashes: Buffer[] = [];
const hashes: Buffer<ArrayBuffer>[] = [];
hashes.push(
Buffer.from(
'00000000000000000000000000000000000000000000000000000000',
@@ -62,7 +62,7 @@ describe('HsmEnclaveClient', () => {
}
});
it('create client fails with no hashes', () => {
const hashes: Buffer[] = [];
const hashes: Buffer<ArrayBuffer>[] = [];
try {
SignalClient.HsmEnclaveClient.new(validKey, hashes);
assert.fail();
@@ -74,7 +74,7 @@ describe('HsmEnclaveClient', () => {
}
});
it('complete handshake without initial request', () => {
const hashes: Buffer[] = [];
const hashes: Buffer<ArrayBuffer>[] = [];
hashes.push(
Buffer.from(
'0000000000000000000000000000000000000000000000000000000000000000',
@@ -97,7 +97,7 @@ describe('HsmEnclaveClient', () => {
}
});
it('established send fails prior to establishment', () => {
const hashes: Buffer[] = [];
const hashes: Buffer<ArrayBuffer>[] = [];
hashes.push(
Buffer.from(
'0000000000000000000000000000000000000000000000000000000000000000',
@@ -120,7 +120,7 @@ describe('HsmEnclaveClient', () => {
}
});
it('established recv fails prior to establishment', () => {
const hashes: Buffer[] = [];
const hashes: Buffer<ArrayBuffer>[] = [];
hashes.push(
Buffer.from(
'0000000000000000000000000000000000000000000000000000000000000000',

View File

@@ -132,8 +132,10 @@ describe('Incremental MAC', () => {
// Use uneven chunk size to trigger buffering
const CHUNK_SIZE = 13579;
function toChunkedReadable(buffer: Uint8Array): stream.Readable {
const chunked = new Array<Uint8Array>();
function toChunkedReadable(
buffer: Uint8Array<ArrayBuffer>
): stream.Readable {
const chunked = new Array<Uint8Array<ArrayBuffer>>();
for (let i = 0; i < buffer.byteLength; i += CHUNK_SIZE) {
chunked.push(buffer.subarray(i, i + CHUNK_SIZE));
}

View File

@@ -190,32 +190,34 @@ describe('KeyTransparency Integration', function (this: Mocha.Suite) {
});
class InMemoryKtStore implements KT.Store {
storage: Map<Readonly<Aci>, Array<Readonly<Uint8Array>>>;
distinguished: Readonly<Uint8Array> | null;
storage: Map<Readonly<Aci>, Array<Readonly<Uint8Array<ArrayBuffer>>>>;
distinguished: Readonly<Uint8Array<ArrayBuffer>> | null;
constructor() {
this.storage = new Map<Aci, Array<Readonly<Uint8Array>>>();
this.storage = new Map<Aci, Array<Readonly<Uint8Array<ArrayBuffer>>>>();
this.distinguished = null;
}
// eslint-disable-next-line @typescript-eslint/require-await
async getLastDistinguishedTreeHead(): Promise<Uint8Array | null> {
async getLastDistinguishedTreeHead(): Promise<Uint8Array<ArrayBuffer> | null> {
return this.distinguished;
}
// eslint-disable-next-line @typescript-eslint/require-await
async setLastDistinguishedTreeHead(bytes: Readonly<Uint8Array> | null) {
async setLastDistinguishedTreeHead(
bytes: Readonly<Uint8Array<ArrayBuffer>> | null
) {
this.distinguished = bytes;
}
// eslint-disable-next-line @typescript-eslint/require-await
async getAccountData(aci: Aci): Promise<Uint8Array | null> {
async getAccountData(aci: Aci): Promise<Uint8Array<ArrayBuffer> | null> {
const allVersions = this.storage.get(aci) ?? [];
return allVersions.at(-1) ?? null;
}
// eslint-disable-next-line @typescript-eslint/require-await
async setAccountData(aci: Aci, bytes: Readonly<Uint8Array>) {
async setAccountData(aci: Aci, bytes: Readonly<Uint8Array<ArrayBuffer>>) {
const allVersions = this.storage.get(aci) ?? [];
allVersions.push(bytes);
this.storage.set(aci, allVersions);

View File

@@ -193,7 +193,7 @@ function assertSanitizedMetadataEqual(
sanitized: SanitizedMetadata,
dataOffset: number | bigint,
dataLen: number | bigint,
metadata: Uint8Array | null
metadata: Uint8Array<ArrayBuffer> | null
) {
assert.deepEqual(sanitized.getMetadata(), metadata);
assert.equal(sanitized.getDataOffset(), BigInt(dataOffset));

View File

@@ -160,7 +160,7 @@ describe('MessageBackup', () => {
async close(): Promise<void> {
closeCount += 1;
}
async read(_amount: number): Promise<Uint8Array> {
async read(_amount: number): Promise<Uint8Array<ArrayBuffer>> {
return Uint8Array.of();
}
async skip(amount: number): Promise<void> {
@@ -192,9 +192,11 @@ const exampleBackup = fs.readFileSync(
path.join(import.meta.dirname, '../../ts/test/canonical-backup.binproto')
);
function chunkLengthDelimited(binproto: Uint8Array): Uint8Array[] {
function chunkLengthDelimited(
binproto: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer>[] {
const r = Reader.create(binproto);
const chunks: Uint8Array[] = [];
const chunks: Uint8Array<ArrayBuffer>[] = [];
while (r.pos < r.len) {
const headerStart = r.pos; // start of the varint length prefix
@@ -214,7 +216,9 @@ function chunkLengthDelimited(binproto: Uint8Array): Uint8Array[] {
return chunks;
}
function stripLengthPrefix(chunk: Uint8Array): Uint8Array {
function stripLengthPrefix(
chunk: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
const reader = Reader.create(chunk);
const length = reader.uint32();
const bodyStart = reader.pos;
@@ -228,7 +232,9 @@ function stripLengthPrefix(chunk: Uint8Array): Uint8Array {
return chunk.subarray(bodyStart, bodyEnd);
}
function insertLengthPrefix(chunk: Uint8Array): Uint8Array {
function insertLengthPrefix(
chunk: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
if (chunk.byteLength > 0x7f) {
throw new Error(
'not implemented: chunks with more than one varint byte of length'
@@ -245,7 +251,9 @@ const [exampleBackupInfoChunk, ...exampleFrameChunks] = exampleBackupChunks;
const exampleBackupInfo = stripLengthPrefix(exampleBackupInfoChunk);
const exampleFrames = exampleFrameChunks;
function concatFrames(chunks: ReadonlyArray<Uint8Array>): Uint8Array {
function concatFrames(
chunks: ReadonlyArray<Uint8Array<ArrayBuffer>>
): Uint8Array<ArrayBuffer> {
if (chunks.length === 0) {
return new Uint8Array();
}
@@ -298,11 +306,11 @@ const VIEW_ONCE_CHAT_ITEM_FRAME = Uint8Array.from(
Buffer.from('IhwIChALGAwyDQgKEAsYCZIBBAoCGAGSAQQKAhgB', 'base64')
);
function createDisappearingChatItemFrame(): Uint8Array {
function createDisappearingChatItemFrame(): Uint8Array<ArrayBuffer> {
return insertLengthPrefix(DISAPPEARING_CHAT_ITEM_FRAME);
}
function createViewOnceChatItemFrame(): Uint8Array {
function createViewOnceChatItemFrame(): Uint8Array<ArrayBuffer> {
return insertLengthPrefix(VIEW_ONCE_CHAT_ITEM_FRAME);
}
@@ -606,7 +614,7 @@ describe('OnlineBackupValidator', () => {
// Here we override that `read` member with one that always produces a Uint8Array,
// for more convenient use in the test. Note that this is unchecked.
type ReadableUsingUint8Array = Omit<Readable, 'read'> & {
read: (size: number) => Uint8Array;
read: (size: number) => Uint8Array<ArrayBuffer>;
};
const input: ReadableUsingUint8Array = new Readable();
input.push(exampleBackup);
@@ -656,7 +664,7 @@ describe('OnlineBackupValidator', () => {
// 1: 1
// 2: 1731715200000
// 3: {`00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff`}
const VALID_BACKUP_INFO: Buffer = Buffer.from(
const VALID_BACKUP_INFO: Buffer<ArrayBuffer> = Buffer.from(
'CAEQgOiTkrMyGiAAESIzRFVmd4iZqrvM3e7/ABEiM0RVZneImaq7zN3u/w==',
'base64'
);

View File

@@ -511,7 +511,7 @@ describe('chat service api', () => {
// a helper function to check that the message has been passed to the listener
async function check(
serverRequest: Uint8Array,
serverRequest: Uint8Array<ArrayBuffer>,
expectedMethod: sinon.SinonStub,
expectedArguments: unknown[]
) {
@@ -543,7 +543,7 @@ describe('chat service api', () => {
it('messages arrive in order', async () => {
const listener: ChatServiceListener = {
onIncomingMessage(
_envelope: Uint8Array,
_envelope: Uint8Array<ArrayBuffer>,
_timestamp: number,
_ack: ChatServerMessageAck
): void {
@@ -566,7 +566,7 @@ describe('chat service api', () => {
);
const completable = new CompletablePromise();
const callsToMake: Buffer[] = [
const callsToMake: Buffer<ArrayBuffer>[] = [
INCOMING_MESSAGE_1,
EMPTY_QUEUE,
INVALID_MESSAGE,
@@ -617,7 +617,7 @@ describe('chat service api', () => {
const connectionInterruptedReasons: (object | null)[] = [];
const listener: ChatServiceListener = {
onIncomingMessage(
_envelope: Uint8Array,
_envelope: Uint8Array<ArrayBuffer>,
_timestamp: number,
_ack: ChatServerMessageAck
): void {
@@ -761,7 +761,7 @@ describe('chat service api', () => {
ack.send(200);
},
onReceivedEnvelope(
envelope: Uint8Array,
envelope: Uint8Array<ArrayBuffer>,
ack: ChatServerMessageAck
): void {
recordCall('onReceivedEnvelope', envelope);
@@ -778,7 +778,7 @@ describe('chat service api', () => {
);
const completable = new CompletablePromise();
const callsToMake: Buffer[] = [
const callsToMake: Buffer<ArrayBuffer>[] = [
PUT_ADDRESS,
INVALID_MESSAGE,
PUT_ENVELOPE,

View File

@@ -15,7 +15,7 @@ import { assertArrayEquals } from './util.js';
util.initLogger();
function bufferFromHexStrings(...input: string[]): Buffer {
function bufferFromHexStrings(...input: string[]): Buffer<ArrayBuffer> {
return Buffer.concat(input.map((s) => Buffer.from(s, 'hex')));
}

View File

@@ -101,7 +101,7 @@ describe('ZKGroup', () => {
it('deserializationErrorType', () => {
function assertDeserializeInvalidThrows<T>(
constructor: new (serialized: Uint8Array) => T
constructor: new (serialized: Uint8Array<ArrayBuffer>) => T
) {
assert.throws(
() => {

View File

@@ -8,7 +8,7 @@ import { InputStream } from '../io.js';
export class ErrorInputStream extends InputStream {
public static Error = class extends Error {};
read(_amount: number): Promise<Uint8Array> {
read(_amount: number): Promise<Uint8Array<ArrayBuffer>> {
throw new ErrorInputStream.Error();
}
skip(_amount: number): Promise<void> {
@@ -17,14 +17,14 @@ export class ErrorInputStream extends InputStream {
}
export class Uint8ArrayInputStream extends InputStream {
data: Uint8Array;
data: Uint8Array<ArrayBuffer>;
constructor(data: Uint8Array) {
constructor(data: Uint8Array<ArrayBuffer>) {
super();
this.data = data;
}
read(amount: number): Promise<Uint8Array> {
read(amount: number): Promise<Uint8Array<ArrayBuffer>> {
const read_amount = Math.min(amount, this.data.length);
const read_data = this.data.subarray(0, read_amount);
this.data = this.data.subarray(read_amount);

View File

@@ -10,6 +10,7 @@ import { assert, use } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import * as uuid from 'uuid';
import { Buffer } from 'node:buffer';
import { parseUuid } from '../../uuid.js';
use(chaiAsPromised);
util.initLogger();
@@ -47,14 +48,14 @@ describe('ServiceId', () => {
const aci = SignalClient.Aci.fromUuid(testingUuid);
assert.instanceOf(aci, SignalClient.Aci);
assert.isTrue(
aci.isEqual(SignalClient.Aci.fromUuidBytes(uuid.parse(testingUuid)))
aci.isEqual(SignalClient.Aci.fromUuidBytes(parseUuid(testingUuid)))
);
assert.isFalse(aci.isEqual(SignalClient.Pni.fromUuid(testingUuid)));
assert.deepEqual(testingUuid, aci.getRawUuid());
assert.deepEqual(uuid.parse(testingUuid), aci.getRawUuidBytes());
assert.deepEqual(parseUuid(testingUuid), aci.getRawUuidBytes());
assert.deepEqual(testingUuid, aci.getServiceIdString());
assert.deepEqual(uuid.parse(testingUuid), aci.getServiceIdBinary());
assert.deepEqual(parseUuid(testingUuid), aci.getServiceIdBinary());
assert.deepEqual(`<ACI:${testingUuid}>`, `${aci}`);
{
@@ -85,12 +86,12 @@ describe('ServiceId', () => {
const pni = SignalClient.Pni.fromUuid(testingUuid);
assert.instanceOf(pni, SignalClient.Pni);
assert.isTrue(
pni.isEqual(SignalClient.Pni.fromUuidBytes(uuid.parse(testingUuid)))
pni.isEqual(SignalClient.Pni.fromUuidBytes(parseUuid(testingUuid)))
);
assert.isFalse(pni.isEqual(SignalClient.Aci.fromUuid(testingUuid)));
assert.deepEqual(testingUuid, pni.getRawUuid());
assert.deepEqual(uuid.parse(testingUuid), pni.getRawUuidBytes());
assert.deepEqual(parseUuid(testingUuid), pni.getRawUuidBytes());
assert.deepEqual(`PNI:${testingUuid}`, pni.getServiceIdString());
assert.deepEqual(
Buffer.concat([Buffer.of(0x01), pni.getRawUuidBytes()]),

View File

@@ -11,7 +11,7 @@ import * as util from '../util.js';
util.initLogger();
export class InMemorySessionStore extends SignalClient.SessionStore {
private state = new Map<string, Uint8Array>();
private state = new Map<string, Uint8Array<ArrayBuffer>>();
async saveSession(
name: SignalClient.ProtocolAddress,
record: SignalClient.SessionRecord
@@ -98,7 +98,7 @@ export class InMemoryIdentityKeyStore extends SignalClient.IdentityKeyStore {
}
export class InMemoryPreKeyStore extends SignalClient.PreKeyStore {
private state = new Map<number, Uint8Array>();
private state = new Map<number, Uint8Array<ArrayBuffer>>();
async savePreKey(
id: number,
record: SignalClient.PreKeyRecord
@@ -118,7 +118,7 @@ export class InMemoryPreKeyStore extends SignalClient.PreKeyStore {
}
export class InMemorySignedPreKeyStore extends SignalClient.SignedPreKeyStore {
private state = new Map<number, Uint8Array>();
private state = new Map<number, Uint8Array<ArrayBuffer>>();
async saveSignedPreKey(
id: number,
record: SignalClient.SignedPreKeyRecord
@@ -135,7 +135,7 @@ export class InMemorySignedPreKeyStore extends SignalClient.SignedPreKeyStore {
}
export class InMemoryKyberPreKeyStore extends SignalClient.KyberPreKeyStore {
private state = new Map<number, Uint8Array>();
private state = new Map<number, Uint8Array<ArrayBuffer>>();
private used = new Set<number>();
private baseKeysSeen = new Map<bigint, SignalClient.PublicKey[]>();
async saveKyberPreKey(

View File

@@ -62,14 +62,17 @@ export class CompletablePromise {
}
}
export function assertByteArray(hex: string, actual: Uint8Array): void {
export function assertByteArray(
hex: string,
actual: Uint8Array<ArrayBuffer>
): void {
const actualHex = Buffer.from(actual).toString('hex');
assert.strictEqual(hex, actualHex);
}
export function assertArrayEquals(
expected: Uint8Array,
actual: Uint8Array
expected: Uint8Array<ArrayBuffer>,
actual: Uint8Array<ArrayBuffer>
): void {
const expectedHex = Buffer.from(expected).toString('hex');
const actualHex = Buffer.from(actual).toString('hex');
@@ -77,8 +80,8 @@ export function assertArrayEquals(
assert.strictEqual(expectedHex, actualHex);
}
export function assertArrayNotEquals(
expected: Uint8Array,
actual: Uint8Array
expected: Uint8Array<ArrayBuffer>,
actual: Uint8Array<ArrayBuffer>
): void {
const expectedHex = Buffer.from(expected).toString('hex');
const actualHex = Buffer.from(actual).toString('hex');

View File

@@ -10,8 +10,8 @@ import { RANDOM_LENGTH } from './zkgroup/internal/Constants.js';
import * as Native from './Native.js';
export type UsernameLink = {
entropy: Uint8Array;
encryptedUsername: Uint8Array;
entropy: Uint8Array<ArrayBuffer>;
encryptedUsername: Uint8Array<ArrayBuffer>;
};
export function generateCandidates(
@@ -31,7 +31,7 @@ export function fromParts(
discriminator: string,
minNicknameLength: number,
maxNicknameLength: number
): { username: string; hash: Uint8Array } {
): { username: string; hash: Uint8Array<ArrayBuffer> } {
const hash = Native.Username_HashFromParts(
nickname,
discriminator,
@@ -43,19 +43,19 @@ export function fromParts(
return { username, hash };
}
export function hash(username: string): Uint8Array {
export function hash(username: string): Uint8Array<ArrayBuffer> {
return Native.Username_Hash(username);
}
export function generateProof(username: string): Uint8Array {
export function generateProof(username: string): Uint8Array<ArrayBuffer> {
const random = randomBytes(RANDOM_LENGTH);
return generateProofWithRandom(username, random);
}
export function generateProofWithRandom(
username: string,
random: Uint8Array
): Uint8Array {
random: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.Username_Proof(username, random);
}
@@ -68,7 +68,7 @@ export function decryptUsernameLink(usernameLink: UsernameLink): string {
export function createUsernameLink(
username: string,
previousEntropy?: Uint8Array
previousEntropy?: Uint8Array<ArrayBuffer>
): UsernameLink {
const usernameLinkData = Native.UsernameLink_Create(
username,
@@ -80,6 +80,9 @@ export function createUsernameLink(
}
// Only for testing. Will throw on failure.
export function verifyProof(proof: Uint8Array, hash: Uint8Array): void {
export function verifyProof(
proof: Uint8Array<ArrayBuffer>,
hash: Uint8Array<ArrayBuffer>
): void {
Native.Username_Verify(proof, hash);
}

View File

@@ -3,4 +3,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
//
import * as uuid from 'uuid';
export type Uuid = string;
export function parseUuid(input: string): Uint8Array<ArrayBuffer> {
// @ts-expect-error See https://github.com/uuidjs/uuid/pull/927
return uuid.parse(input);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../Native.js';
export default class GenericServerPublicParams extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GenericServerPublicParams_CheckValidContents);
}
}

View File

@@ -19,13 +19,15 @@ export default class GenericServerSecretParams extends ByteArray {
return GenericServerSecretParams.generateWithRandom(random);
}
static generateWithRandom(random: Uint8Array): GenericServerSecretParams {
static generateWithRandom(
random: Uint8Array<ArrayBuffer>
): GenericServerSecretParams {
return new GenericServerSecretParams(
Native.GenericServerSecretParams_GenerateDeterministic(random)
);
}
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GenericServerSecretParams_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ export default class NotarySignature extends ByteArray {
private readonly __type?: never;
static SIZE = 64;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, NotarySignature.checkLength(NotarySignature.SIZE));
}
}

View File

@@ -9,7 +9,7 @@ import NotarySignature from './NotarySignature.js';
export default class ServerPublicParams {
readonly _nativeHandle: Native.ServerPublicParams;
constructor(contents: Uint8Array | Native.ServerPublicParams) {
constructor(contents: Uint8Array<ArrayBuffer> | Native.ServerPublicParams) {
if (contents instanceof Uint8Array) {
this._nativeHandle = Native.ServerPublicParams_Deserialize(contents);
} else {
@@ -22,11 +22,14 @@ export default class ServerPublicParams {
*
* Allows decoupling RingRTC's use of endorsements from libsignal's.
*/
getEndorsementPublicKey(): Uint8Array {
getEndorsementPublicKey(): Uint8Array<ArrayBuffer> {
return Native.ServerPublicParams_GetEndorsementPublicKey(this);
}
verifySignature(message: Uint8Array, notarySignature: NotarySignature): void {
verifySignature(
message: Uint8Array<ArrayBuffer>,
notarySignature: NotarySignature
): void {
Native.ServerPublicParams_VerifySignature(
this,
message,
@@ -34,7 +37,7 @@ export default class ServerPublicParams {
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.ServerPublicParams_Serialize(this);
}
}

View File

@@ -17,7 +17,9 @@ export default class ServerSecretParams {
return ServerSecretParams.generateWithRandom(random);
}
static generateWithRandom(random: Uint8Array): ServerSecretParams {
static generateWithRandom(
random: Uint8Array<ArrayBuffer>
): ServerSecretParams {
return new ServerSecretParams(
Native.ServerSecretParams_GenerateDeterministic(random)
);
@@ -25,7 +27,7 @@ export default class ServerSecretParams {
readonly _nativeHandle: Native.ServerSecretParams;
constructor(contents: Uint8Array | Native.ServerSecretParams) {
constructor(contents: Uint8Array<ArrayBuffer> | Native.ServerSecretParams) {
if (contents instanceof Uint8Array) {
this._nativeHandle = Native.ServerSecretParams_Deserialize(contents);
} else {
@@ -39,19 +41,22 @@ export default class ServerSecretParams {
);
}
sign(message: Uint8Array): NotarySignature {
sign(message: Uint8Array<ArrayBuffer>): NotarySignature {
const random = randomBytes(RANDOM_LENGTH);
return this.signWithRandom(random, message);
}
signWithRandom(random: Uint8Array, message: Uint8Array): NotarySignature {
signWithRandom(
random: Uint8Array<ArrayBuffer>,
message: Uint8Array<ArrayBuffer>
): NotarySignature {
return new NotarySignature(
Native.ServerSecretParams_SignDeterministic(this, random, message)
);
}
serialize(): Uint8Array {
serialize(): Uint8Array<ArrayBuffer> {
return Native.ServerSecretParams_Serialize(this);
}
}

View File

@@ -10,7 +10,7 @@ import UuidCiphertext from '../groups/UuidCiphertext.js';
export default class AuthCredentialPresentation extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.AuthCredentialPresentation_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class AuthCredentialWithPni extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.AuthCredentialWithPni_CheckValidContents);
}
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class AuthCredentialWithPniResponse extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.AuthCredentialWithPniResponse_CheckValidContents);
}
}

View File

@@ -58,7 +58,7 @@ export default class ClientZkAuthOperations {
}
createAuthCredentialWithPniPresentationWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
groupSecretParams: GroupSecretParams,
authCredential: AuthCredentialWithPni
): AuthCredentialPresentation {

View File

@@ -36,7 +36,7 @@ export default class ServerZkAuthOperations {
}
issueAuthCredentialWithPniZkcWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
aci: Aci,
pni: Pni,
redemptionTime: number

View File

@@ -17,7 +17,7 @@ import BackupCredentialType from './BackupCredentialType.js';
export default class BackupAuthCredential extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.BackupAuthCredential_CheckValidContents);
}
@@ -30,7 +30,7 @@ export default class BackupAuthCredential extends ByteArray {
presentWithRandom(
serverParams: GenericServerPublicParams,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): BackupAuthCredentialPresentation {
return new BackupAuthCredentialPresentation(
Native.BackupAuthCredential_PresentDeterministic(
@@ -41,7 +41,7 @@ export default class BackupAuthCredential extends ByteArray {
);
}
getBackupId(): Uint8Array {
getBackupId(): Uint8Array<ArrayBuffer> {
return Native.BackupAuthCredential_GetBackupId(this.contents);
}

View File

@@ -13,7 +13,7 @@ import BackupCredentialType from './BackupCredentialType.js';
export default class BackupAuthCredentialPresentation extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.BackupAuthCredentialPresentation_CheckValidContents);
}
@@ -28,7 +28,7 @@ export default class BackupAuthCredentialPresentation extends ByteArray {
);
}
getBackupId(): Uint8Array {
getBackupId(): Uint8Array<ArrayBuffer> {
return Native.BackupAuthCredentialPresentation_GetBackupId(this.contents);
}

View File

@@ -17,7 +17,7 @@ import BackupCredentialType from './BackupCredentialType.js';
export default class BackupAuthCredentialRequest extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.BackupAuthCredentialRequest_CheckValidContents);
}
@@ -42,7 +42,7 @@ export default class BackupAuthCredentialRequest extends ByteArray {
backupLevel: BackupLevel,
type: BackupCredentialType,
params: GenericServerSecretParams,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): BackupAuthCredentialResponse {
return new BackupAuthCredentialResponse(
Native.BackupAuthCredentialRequest_IssueDeterministic(

View File

@@ -3,8 +3,6 @@
// SPDX-License-Identifier: AGPL-3.0-only
//
import * as uuid from 'uuid';
import ByteArray from '../internal/ByteArray.js';
import * as Native from '../../Native.js';
@@ -12,12 +10,12 @@ import BackupAuthCredentialRequest from './BackupAuthCredentialRequest.js';
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js';
import BackupAuthCredential from './BackupAuthCredential.js';
import GenericServerPublicParams from '../GenericServerPublicParams.js';
import type { Uuid } from '../../index.js';
import { parseUuid, type Uuid } from '../../index.js';
export default class BackupAuthCredentialRequestContext extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.BackupAuthCredentialRequestContext_CheckValidContents
@@ -25,11 +23,11 @@ export default class BackupAuthCredentialRequestContext extends ByteArray {
}
static create(
backupKey: Uint8Array,
backupKey: Uint8Array<ArrayBuffer>,
aci: Uuid
): BackupAuthCredentialRequestContext {
return new BackupAuthCredentialRequestContext(
Native.BackupAuthCredentialRequestContext_New(backupKey, uuid.parse(aci))
Native.BackupAuthCredentialRequestContext_New(backupKey, parseUuid(aci))
);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class BackupAuthCredentialResponse extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.BackupAuthCredentialResponse_CheckValidContents);
}
}

View File

@@ -17,7 +17,7 @@ import { Aci } from '../../Address.js';
export default class CallLinkAuthCredential extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CallLinkAuthCredential_CheckValidContents);
}
@@ -42,7 +42,7 @@ export default class CallLinkAuthCredential extends ByteArray {
redemptionTime: number,
serverParams: GenericServerPublicParams,
callLinkParams: CallLinkSecretParams,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): CallLinkAuthCredentialPresentation {
return new CallLinkAuthCredentialPresentation(
Native.CallLinkAuthCredential_PresentDeterministic(

View File

@@ -13,7 +13,7 @@ import UuidCiphertext from '../groups/UuidCiphertext.js';
export default class CallLinkAuthCredentialPresentation extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.CallLinkAuthCredentialPresentation_CheckValidContents

View File

@@ -17,7 +17,7 @@ import { Aci } from '../../Address.js';
export default class CallLinkAuthCredentialResponse extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CallLinkAuthCredentialResponse_CheckValidContents);
}
@@ -39,7 +39,7 @@ export default class CallLinkAuthCredentialResponse extends ByteArray {
userId: Aci,
redemptionTime: number,
params: GenericServerSecretParams,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): CallLinkAuthCredentialResponse {
return new CallLinkAuthCredentialResponse(
Native.CallLinkAuthCredentialResponse_IssueDeterministic(

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class CallLinkPublicParams extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CallLinkPublicParams_CheckValidContents);
}
}

View File

@@ -13,13 +13,15 @@ import { Aci } from '../../Address.js';
export default class CallLinkSecretParams extends ByteArray {
private readonly __type?: never;
static deriveFromRootKey(callLinkRootKey: Uint8Array): CallLinkSecretParams {
static deriveFromRootKey(
callLinkRootKey: Uint8Array<ArrayBuffer>
): CallLinkSecretParams {
return new CallLinkSecretParams(
Native.CallLinkSecretParams_DeriveFromRootKey(callLinkRootKey)
);
}
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CallLinkSecretParams_CheckValidContents);
}

View File

@@ -17,12 +17,12 @@ import { Aci } from '../../Address.js';
export default class CreateCallLinkCredential extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CreateCallLinkCredential_CheckValidContents);
}
present(
roomId: Uint8Array,
roomId: Uint8Array<ArrayBuffer>,
userId: Aci,
serverParams: GenericServerPublicParams,
callLinkParams: CallLinkSecretParams
@@ -38,11 +38,11 @@ export default class CreateCallLinkCredential extends ByteArray {
}
presentWithRandom(
roomId: Uint8Array,
roomId: Uint8Array<ArrayBuffer>,
userId: Aci,
serverParams: GenericServerPublicParams,
callLinkParams: CallLinkSecretParams,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): CreateCallLinkCredentialPresentation {
return new CreateCallLinkCredentialPresentation(
Native.CreateCallLinkCredential_PresentDeterministic(

View File

@@ -12,7 +12,7 @@ import GenericServerSecretParams from '../GenericServerSecretParams.js';
export default class CreateCallLinkCredentialPresentation extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.CreateCallLinkCredentialPresentation_CheckValidContents
@@ -20,7 +20,7 @@ export default class CreateCallLinkCredentialPresentation extends ByteArray {
}
verify(
roomId: Uint8Array,
roomId: Uint8Array<ArrayBuffer>,
serverParams: GenericServerSecretParams,
callLinkParams: CallLinkPublicParams,
now: Date = new Date()

View File

@@ -16,7 +16,7 @@ import { Aci } from '../../Address.js';
export default class CreateCallLinkCredentialRequest extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CreateCallLinkCredentialRequest_CheckValidContents);
}
@@ -33,7 +33,7 @@ export default class CreateCallLinkCredentialRequest extends ByteArray {
userId: Aci,
timestamp: number,
params: GenericServerSecretParams,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): CreateCallLinkCredentialResponse {
return new CreateCallLinkCredentialResponse(
Native.CreateCallLinkCredentialRequest_IssueDeterministic(

View File

@@ -18,21 +18,23 @@ import { Aci } from '../../Address.js';
export default class CreateCallLinkCredentialRequestContext extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.CreateCallLinkCredentialRequestContext_CheckValidContents
);
}
static forRoomId(roomId: Uint8Array): CreateCallLinkCredentialRequestContext {
static forRoomId(
roomId: Uint8Array<ArrayBuffer>
): CreateCallLinkCredentialRequestContext {
const random = randomBytes(RANDOM_LENGTH);
return this.forRoomIdWithRandom(roomId, random);
}
static forRoomIdWithRandom(
roomId: Uint8Array,
random: Uint8Array
roomId: Uint8Array<ArrayBuffer>,
random: Uint8Array<ArrayBuffer>
): CreateCallLinkCredentialRequestContext {
return new CreateCallLinkCredentialRequestContext(
Native.CreateCallLinkCredentialRequestContext_NewDeterministic(

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class CreateCallLinkCredentialResponse extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.CreateCallLinkCredentialResponse_CheckValidContents);
}
}

View File

@@ -62,13 +62,16 @@ export default class ClientZkGroupCipher {
);
}
encryptBlob(plaintext: Uint8Array): Uint8Array {
encryptBlob(plaintext: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
const random = randomBytes(RANDOM_LENGTH);
return this.encryptBlobWithRandom(random, plaintext);
}
encryptBlobWithRandom(random: Uint8Array, plaintext: Uint8Array): Uint8Array {
encryptBlobWithRandom(
random: Uint8Array<ArrayBuffer>,
plaintext: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.GroupSecretParams_EncryptBlobWithPaddingDeterministic(
this.groupSecretParams.getContents(),
random,
@@ -77,7 +80,9 @@ export default class ClientZkGroupCipher {
);
}
decryptBlob(blobCiphertext: Uint8Array): Uint8Array {
decryptBlob(
blobCiphertext: Uint8Array<ArrayBuffer>
): Uint8Array<ArrayBuffer> {
return Native.GroupSecretParams_DecryptBlobWithPadding(
this.groupSecretParams.getContents(),
blobCiphertext

View File

@@ -10,7 +10,7 @@ export default class GroupIdentifier extends ByteArray {
private readonly __type?: never;
static SIZE = 32;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, GroupIdentifier.checkLength(GroupIdentifier.SIZE));
}

View File

@@ -9,7 +9,7 @@ export default class GroupMasterKey extends ByteArray {
private readonly __type?: never;
static SIZE = 32;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, GroupMasterKey.checkLength(GroupMasterKey.SIZE));
}
}

View File

@@ -10,7 +10,7 @@ import GroupIdentifier from './GroupIdentifier.js';
export default class GroupPublicParams extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GroupPublicParams_CheckValidContents);
}

View File

@@ -20,7 +20,9 @@ export default class GroupSecretParams extends ByteArray {
return GroupSecretParams.generateWithRandom(random);
}
static generateWithRandom(random: Uint8Array): GroupSecretParams {
static generateWithRandom(
random: Uint8Array<ArrayBuffer>
): GroupSecretParams {
return new GroupSecretParams(
Native.GroupSecretParams_GenerateDeterministic(random)
);
@@ -34,7 +36,7 @@ export default class GroupSecretParams extends ByteArray {
);
}
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GroupSecretParams_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ProfileKeyCiphertext extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ProfileKeyCiphertext_CheckValidContents);
}
}

View File

@@ -9,11 +9,13 @@ import * as Native from '../../Native.js';
export default class UuidCiphertext extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.UuidCiphertext_CheckValidContents);
}
static serializeAndConcatenate(ciphertexts: UuidCiphertext[]): Uint8Array {
static serializeAndConcatenate(
ciphertexts: UuidCiphertext[]
): Uint8Array<ArrayBuffer> {
if (ciphertexts.length == 0) {
return Uint8Array.of();
}

View File

@@ -22,7 +22,7 @@ import type GroupSendEndorsementsResponse from './GroupSendEndorsementsResponse.
* @see {@link GroupSendFullToken#verify}
*/
export default class GroupSendDerivedKeyPair extends ByteArray {
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GroupSendDerivedKeyPair_CheckValidContents);
}

View File

@@ -45,7 +45,10 @@ import CallLinkSecretParams from '../calllinks/CallLinkSecretParams.js';
* it's still cheaper than a usual zkgroup presentation.)
*/
export default class GroupSendEndorsement extends ByteArray {
constructor(contents: Uint8Array, marker?: typeof UNCHECKED_AND_UNCLONED) {
constructor(
contents: Uint8Array<ArrayBuffer>,
marker?: typeof UNCHECKED_AND_UNCLONED
) {
super(contents, marker ?? Native.GroupSendEndorsement_CheckValidContents);
}

View File

@@ -41,7 +41,7 @@ export type ReceivedEndorsements = {
* perspective.
*/
export default class GroupSendEndorsementsResponse extends ByteArray {
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GroupSendEndorsementsResponse_CheckValidContents);
}
@@ -69,7 +69,7 @@ export default class GroupSendEndorsementsResponse extends ByteArray {
public static issueWithRandom(
groupMembers: UuidCiphertext[],
keyPair: GroupSendDerivedKeyPair,
random: Uint8Array
random: Uint8Array<ArrayBuffer>
): GroupSendEndorsementsResponse {
return new GroupSendEndorsementsResponse(
Native.GroupSendEndorsementsResponse_IssueDeterministic(

View File

@@ -19,7 +19,7 @@ import type { VerificationFailedError } from '../../Errors.js';
* Generated by {@link GroupSendToken#toFullToken}, and verified by the chat server.
*/
export default class GroupSendFullToken extends ByteArray {
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GroupSendFullToken_CheckValidContents);
}

View File

@@ -20,7 +20,7 @@ import type GroupSendEndorsementsResponse from './GroupSendEndorsementsResponse.
* Generated by {@link GroupSendEndorsement#toToken}.
*/
export default class GroupSendToken extends ByteArray {
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.GroupSendToken_CheckValidContents);
}

View File

@@ -9,11 +9,13 @@ import * as Native from '../../Native.js';
export const UNCHECKED_AND_UNCLONED: unique symbol = Symbol();
export default class ByteArray {
contents: Uint8Array;
contents: Uint8Array<ArrayBuffer>;
protected constructor(
contents: Uint8Array,
checkValid: ((contents: Uint8Array) => void) | typeof UNCHECKED_AND_UNCLONED
contents: Uint8Array<ArrayBuffer>,
checkValid:
| ((contents: Uint8Array<ArrayBuffer>) => void)
| typeof UNCHECKED_AND_UNCLONED
) {
if (checkValid === UNCHECKED_AND_UNCLONED) {
this.contents = contents;
@@ -25,7 +27,7 @@ export default class ByteArray {
protected static checkLength(
expectedLength: number
): (contents: Uint8Array) => void {
): (contents: Uint8Array<ArrayBuffer>) => void {
return (contents) => {
if (contents.length !== expectedLength) {
throw new LibSignalErrorBase(
@@ -37,11 +39,11 @@ export default class ByteArray {
};
}
public getContents(): Uint8Array {
public getContents(): Uint8Array<ArrayBuffer> {
return this.contents;
}
public serialize(): Uint8Array {
public serialize(): Uint8Array<ArrayBuffer> {
return Uint8Array.from(this.contents);
}
}

View File

@@ -40,7 +40,7 @@ export default class ClientZkProfileOperations {
}
createProfileKeyCredentialRequestContextWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
userId: Aci,
profileKey: ProfileKey
): ProfileKeyCredentialRequestContext {
@@ -83,7 +83,7 @@ export default class ClientZkProfileOperations {
}
createExpiringProfileKeyCredentialPresentationWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
groupSecretParams: GroupSecretParams,
profileKeyCredential: ExpiringProfileKeyCredential
): ProfileKeyCredentialPresentation {

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ExpiringProfileKeyCredential extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ExpiringProfileKeyCredential_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ExpiringProfileKeyCredentialResponse extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.ExpiringProfileKeyCredentialResponse_CheckValidContents

View File

@@ -13,7 +13,7 @@ export default class ProfileKey extends ByteArray {
private readonly __type?: never;
static SIZE = 32;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, ProfileKey.checkLength(ProfileKey.SIZE));
}
@@ -35,7 +35,7 @@ export default class ProfileKey extends ByteArray {
);
}
deriveAccessKey(): Uint8Array {
deriveAccessKey(): Uint8Array<ArrayBuffer> {
return Native.ProfileKey_DeriveAccessKey(this.contents);
}
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ProfileKeyCommitment extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ProfileKeyCommitment_CheckValidContents);
}
}

View File

@@ -11,7 +11,7 @@ import ProfileKeyCiphertext from '../groups/ProfileKeyCiphertext.js';
export default class ProfileKeyCredentialPresentation extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ProfileKeyCredentialPresentation_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ProfileKeyCredentialRequest extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ProfileKeyCredentialRequest_CheckValidContents);
}
}

View File

@@ -10,7 +10,7 @@ import ProfileKeyCredentialRequest from './ProfileKeyCredentialRequest.js';
export default class ProfileKeyCredentialRequestContext extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.ProfileKeyCredentialRequestContext_CheckValidContents

View File

@@ -9,7 +9,7 @@ export default class ProfileKeyVersion extends ByteArray {
private readonly __type?: never;
static SIZE = 64;
constructor(contents: Uint8Array | string) {
constructor(contents: Uint8Array<ArrayBuffer> | string) {
super(
typeof contents === 'string'
? new TextEncoder().encode(contents)

View File

@@ -41,7 +41,7 @@ export default class ServerZkProfileOperations {
}
issueExpiringProfileKeyCredentialWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
profileKeyCredentialRequest: ProfileKeyCredentialRequest,
userId: Aci,
profileKeyCommitment: ProfileKeyCommitment,

View File

@@ -31,7 +31,7 @@ export default class ClientZkReceiptOperations {
}
createReceiptCredentialRequestContextWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
receiptSerial: ReceiptSerial
): ReceiptCredentialRequestContext {
return new ReceiptCredentialRequestContext(
@@ -67,7 +67,7 @@ export default class ClientZkReceiptOperations {
}
createReceiptCredentialPresentationWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
receiptCredential: ReceiptCredential
): ReceiptCredentialPresentation {
return new ReceiptCredentialPresentation(

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ReceiptCredential extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ReceiptCredential_CheckValidContents);
}

View File

@@ -11,7 +11,7 @@ export default class ReceiptCredentialPresentation extends ByteArray {
private readonly __type?: never;
static SIZE = 329;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ReceiptCredentialPresentation_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ReceiptCredentialRequest extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ReceiptCredentialRequest_CheckValidContents);
}
}

View File

@@ -11,7 +11,7 @@ export default class ReceiptCredentialRequestContext extends ByteArray {
private readonly __type?: never;
static SIZE = 177;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ReceiptCredentialRequestContext_CheckValidContents);
}

View File

@@ -9,7 +9,7 @@ import * as Native from '../../Native.js';
export default class ReceiptCredentialResponse extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, Native.ReceiptCredentialResponse_CheckValidContents);
}
}

View File

@@ -9,7 +9,7 @@ export default class ReceiptSerial extends ByteArray {
private readonly __type?: never;
static SIZE = 16;
constructor(contents: Uint8Array) {
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, ReceiptSerial.checkLength(ReceiptSerial.SIZE));
}
}

View File

@@ -33,7 +33,7 @@ export default class ServerZkReceiptOperations {
}
issueReceiptCredentialWithRandom(
random: Uint8Array,
random: Uint8Array<ArrayBuffer>,
receiptCredentialRequest: ReceiptCredentialRequest,
receiptExpirationTime: number,
receiptLevel: bigint

Some files were not shown because too many files have changed in this diff Show More