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;