Bad API design for aes-gcm
โ Rust ๐ 2025-07-04 ๐ค surdeus ๐๏ธ 19Hi everyone.
Has anyone here worked with aes-gcm? As far as I understand, when using encrypt_in_place / decrypt_in_place, Iโm required to implement the Buffer trait only because the library canโt tell in advance whether thereโs enough space for the authentication tag during encryption.
Isnโt that just bad design? It forces me to inject a buffer pool into the object implementing Buffer, just to avoid unnecessary allocations - instead of simply allowing me to pass a &mut [u8] with enough capacity upfront.
1 post - 1 participant
๐ท๏ธ rust_feed