]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Support in-place decryption for GCM ciphers
authorMichael Brown <mcb30@ipxe.org>
Wed, 9 Nov 2022 16:48:04 +0000 (16:48 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 10 Nov 2022 09:58:37 +0000 (09:58 +0000)
commit4acded7e574fb18dd653a18f48a7b6066c543712
tree0ba9bdcb204b880ebc2e0d1279f5d19be691bee5
parent63fdd9b5816c752120c315c04c1d6878f3c13143
[crypto] Support in-place decryption for GCM ciphers

The hash calculation is currently performed incorrectly when
decrypting in place, since the ciphertext will have been overwritten
with the plaintext before being used to update the hash value.

Restructure the code to allow for in-place encryption and decryption.
Choose to optimise for the decryption case, since we are likely to
decrypt much more data than we encrypt.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/gcm.c