Simplify sticker upload
This commit is contained in:
parent
47b0ee6135
commit
d608b81292
3 changed files with 7 additions and 17 deletions
|
@ -455,8 +455,7 @@ export function decryptAttachment(
|
|||
|
||||
export function encryptAttachment(
|
||||
plaintext: Uint8Array,
|
||||
keys: Uint8Array,
|
||||
iv: Uint8Array
|
||||
keys: Uint8Array
|
||||
): EncryptedAttachment {
|
||||
if (!(plaintext instanceof Uint8Array)) {
|
||||
throw new TypeError(
|
||||
|
@ -467,9 +466,7 @@ export function encryptAttachment(
|
|||
if (keys.byteLength !== 64) {
|
||||
throw new Error('Got invalid length attachment keys');
|
||||
}
|
||||
if (iv.byteLength !== 16) {
|
||||
throw new Error('Got invalid length attachment iv');
|
||||
}
|
||||
const iv = getRandomBytes(16);
|
||||
const aesKey = keys.slice(0, 32);
|
||||
const macKey = keys.slice(32, 64);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue