Шифрование, финальная версия E2EE и обмен ключами с DH

This commit is contained in:
RoyceDa
2026-03-20 18:30:07 +02:00
parent 46af6661a1
commit f91392e6aa

View File

@@ -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}`);