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