Шифрование, финальная версия E2EE и обмен ключами с DH
This commit is contained in:
@@ -7,7 +7,6 @@ type KeyInput = Buffer | Uint8Array;
|
|||||||
|
|
||||||
|
|
||||||
async function importAesCtrKey(input: KeyInput): Promise<CryptoKey> {
|
async function importAesCtrKey(input: KeyInput): Promise<CryptoKey> {
|
||||||
console.info("Importing AES-CTR key for E2EE:", Buffer.from(input).toString('hex'));
|
|
||||||
const keyBytes = toArrayBuffer(input);
|
const keyBytes = toArrayBuffer(input);
|
||||||
if (keyBytes.byteLength !== 32) {
|
if (keyBytes.byteLength !== 32) {
|
||||||
throw new Error(`E2EE key must be 32 bytes, got ${keyBytes.byteLength}`);
|
throw new Error(`E2EE key must be 32 bytes, got ${keyBytes.byteLength}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user