crypto: Fix a comment in the attachment encryption logic

This commit is contained in:
Damir Jelić 2021-08-02 07:23:00 +02:00
parent 5192feb836
commit d27a08bc91

View file

@ -215,8 +215,8 @@ impl<'a, R: Read + 'a> AttachmentEncryptor<'a, R> {
let mut iv = Zeroizing::new([0u8; IV_SIZE]); let mut iv = Zeroizing::new([0u8; IV_SIZE]);
getrandom(&mut *key).expect("Can't generate randomness"); getrandom(&mut *key).expect("Can't generate randomness");
// Only populate the first 8 bits with randomness, the rest is 0 // Only populate the first 8 bytes with randomness, the rest is 0
// initialized. // initialized for the counter.
getrandom(&mut iv[0..8]).expect("Can't generate randomness"); getrandom(&mut iv[0..8]).expect("Can't generate randomness");
let web_key = JsonWebKey::from(JsonWebKeyInit { let web_key = JsonWebKey::from(JsonWebKeyInit {