diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-01-11 22:18:12 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-01-11 22:18:12 +0000 |
commit | b156362338456023956446f0f354ad8b3a35e5ad (patch) | |
tree | a53dd10c17036f9a024c8f20866bb7e9a5250aa0 /stand/libsa/geli | |
parent | d7f0b3ce6dbde5b6810cda2c14acbbce5172f53c (diff) | |
download | src-b156362338456023956446f0f354ad8b3a35e5ad.tar.gz src-b156362338456023956446f0f354ad8b3a35e5ad.zip |
geliboot: Use the multi-block functions for AES-XTS.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33530
Diffstat (limited to 'stand/libsa/geli')
-rw-r--r-- | stand/libsa/geli/geliboot_crypto.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/stand/libsa/geli/geliboot_crypto.c b/stand/libsa/geli/geliboot_crypto.c index fcc5d7bcd7fb..766f908d9037 100644 --- a/stand/libsa/geli/geliboot_crypto.c +++ b/stand/libsa/geli/geliboot_crypto.c @@ -42,7 +42,7 @@ geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, cipherInstance cipher; struct aes_xts_ctx xtsctx, *ctxp; size_t xts_len; - int err, blks, i; + int err, blks; switch (algo) { case CRYPTO_AES_CBC: @@ -85,16 +85,12 @@ geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, switch (enc) { case GELI_DECRYPT: - for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt(ctxp, data + i, - data + i); - } + enc_xform_aes_xts.decrypt_multi(ctxp, data, data, + datasize); break; case GELI_ENCRYPT: - for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt(ctxp, data + i, - data + i); - } + enc_xform_aes_xts.encrypt_multi(ctxp, data, data, + datasize); break; } break; |