geliboot: Use the multi-block functions for AES-XTS.
Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33530
This commit is contained in:
parent
d7f0b3ce6d
commit
b156362338
@ -42,7 +42,7 @@ geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize,
|
|||||||
cipherInstance cipher;
|
cipherInstance cipher;
|
||||||
struct aes_xts_ctx xtsctx, *ctxp;
|
struct aes_xts_ctx xtsctx, *ctxp;
|
||||||
size_t xts_len;
|
size_t xts_len;
|
||||||
int err, blks, i;
|
int err, blks;
|
||||||
|
|
||||||
switch (algo) {
|
switch (algo) {
|
||||||
case CRYPTO_AES_CBC:
|
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) {
|
switch (enc) {
|
||||||
case GELI_DECRYPT:
|
case GELI_DECRYPT:
|
||||||
for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) {
|
enc_xform_aes_xts.decrypt_multi(ctxp, data, data,
|
||||||
enc_xform_aes_xts.decrypt(ctxp, data + i,
|
datasize);
|
||||||
data + i);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GELI_ENCRYPT:
|
case GELI_ENCRYPT:
|
||||||
for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) {
|
enc_xform_aes_xts.encrypt_multi(ctxp, data, data,
|
||||||
enc_xform_aes_xts.encrypt(ctxp, data + i,
|
datasize);
|
||||||
data + i);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user