[Updt] Mtp 0.3.0
Some checks failed
Dependency builds / Build web (pull_request) Has been skipped
Dependency builds / Build desktop (pull_request) Has been skipped
Dependency builds / Test native MTP (pull_request) Has been skipped
Dependency builds / Build mobile (pull_request) Has been skipped
/ build-web (push) Failing after 3m32s
/ build-desktop (linux) (push) Failing after 2m47s
/ build-mobile (push) Failing after 5m29s
/ release (push) Has been skipped
Some checks failed
Dependency builds / Build web (pull_request) Has been skipped
Dependency builds / Build desktop (pull_request) Has been skipped
Dependency builds / Test native MTP (pull_request) Has been skipped
Dependency builds / Build mobile (pull_request) Has been skipped
/ build-web (push) Failing after 3m32s
/ build-desktop (linux) (push) Failing after 2m47s
/ build-mobile (push) Failing after 5m29s
/ release (push) Has been skipped
This commit is contained in:
parent
57c7ceb27a
commit
2a55c87df1
33 changed files with 1825 additions and 785 deletions
|
|
@ -13,11 +13,13 @@ export function deriveCallSecretId(callId: string): string {
|
|||
}
|
||||
|
||||
export function ownKemPublicKeyFromKeyring(keyring: string): Uint8Array {
|
||||
return crypto.keyringToKeys(keyring).kemPublicKey;
|
||||
return crypto.keyringToKeys({ value: keyring, encoding: "base64" })
|
||||
.kemPublicKey;
|
||||
}
|
||||
|
||||
export function kemPublicKeyFromPublicKeyBundle(publicKey: string): Uint8Array {
|
||||
return crypto.publicKeyBundleToKeys(publicKey).kemPublicKey;
|
||||
return crypto.publicKeyBundleToKeys({ value: publicKey, encoding: "base64" })
|
||||
.kemPublicKey;
|
||||
}
|
||||
|
||||
export async function wrapCallSecret(args: {
|
||||
|
|
@ -72,7 +74,10 @@ export async function unwrapCallSecret(args: {
|
|||
);
|
||||
}
|
||||
|
||||
const ownKeys = crypto.keyringToKeys(args.keyring);
|
||||
const ownKeys = crypto.keyringToKeys({
|
||||
value: args.keyring,
|
||||
encoding: "base64",
|
||||
});
|
||||
const sharedSecret = crypto.decapsulate(
|
||||
ownKeys.kemSecretKey,
|
||||
args.kemCiphertext,
|
||||
|
|
|
|||
|
|
@ -23,11 +23,13 @@ export function randomChatSecret(): Uint8Array {
|
|||
}
|
||||
|
||||
export function ownKemPublicKeyFromKeyring(keyring: string): Uint8Array {
|
||||
return crypto.keyringToKeys(keyring).kemPublicKey;
|
||||
return crypto.keyringToKeys({ value: keyring, encoding: "base64" })
|
||||
.kemPublicKey;
|
||||
}
|
||||
|
||||
export function kemPublicKeyFromPublicKeyBundle(publicKey: string): Uint8Array {
|
||||
return crypto.publicKeyBundleToKeys(publicKey).kemPublicKey;
|
||||
return crypto.publicKeyBundleToKeys({ value: publicKey, encoding: "base64" })
|
||||
.kemPublicKey;
|
||||
}
|
||||
|
||||
export async function wrapChatSecret(args: {
|
||||
|
|
@ -79,7 +81,10 @@ export async function unwrapChatSecret(args: {
|
|||
);
|
||||
}
|
||||
|
||||
const ownKeys = crypto.keyringToKeys(args.keyring);
|
||||
const ownKeys = crypto.keyringToKeys({
|
||||
value: args.keyring,
|
||||
encoding: "base64",
|
||||
});
|
||||
const sharedSecret = crypto.decapsulate(
|
||||
ownKeys.kemSecretKey,
|
||||
args.kemCiphertext,
|
||||
|
|
|
|||
Loading…
Reference in a new issue