aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa/geli
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-01-11 22:18:12 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-01-11 22:18:12 +0000
commitb156362338456023956446f0f354ad8b3a35e5ad (patch)
treea53dd10c17036f9a024c8f20866bb7e9a5250aa0 /stand/libsa/geli
parentd7f0b3ce6dbde5b6810cda2c14acbbce5172f53c (diff)
downloadsrc-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.c14
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;