diff options
author | John Baldwin <jhb@FreeBSD.org> | 2020-05-20 22:25:41 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2020-05-20 22:25:41 +0000 |
commit | 4f98ffdd1da28744fbcf31d3d818fc17ea30cb5e (patch) | |
tree | 7789d34ca601b09277df736269ad69fb83166962 | |
parent | 2c6d9dc0bbd887a50e7ff0c6af3499ff265f1a16 (diff) | |
download | src-4f98ffdd1da28744fbcf31d3d818fc17ea30cb5e.tar.gz src-4f98ffdd1da28744fbcf31d3d818fc17ea30cb5e.zip |
Notes
-rw-r--r-- | stand/libsa/geli/geliboot_crypto.c | 12 | ||||
-rw-r--r-- | sys/opencrypto/xform_enc.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/stand/libsa/geli/geliboot_crypto.c b/stand/libsa/geli/geliboot_crypto.c index 82a137c06212..e2de7bba4cf5 100644 --- a/stand/libsa/geli/geliboot_crypto.c +++ b/stand/libsa/geli/geliboot_crypto.c @@ -78,20 +78,20 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size_t datasize, xts_len = keysize << 1; ctxp = &xtsctx; - rijndael_set_key(&ctxp->key1, key, xts_len / 2); - rijndael_set_key(&ctxp->key2, key + (xts_len / 16), xts_len / 2); - - enc_xform_aes_xts.reinit((caddr_t)ctxp, iv); + enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8); + enc_xform_aes_xts.reinit(ctxp, iv); switch (enc) { case 0: /* decrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.decrypt(ctxp, data + i, + data + i); } break; case 1: /* encrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.encrypt(ctxp, data + i, + data + 1); } break; } diff --git a/sys/opencrypto/xform_enc.h b/sys/opencrypto/xform_enc.h index 33a61c3ae13b..05c0cdadc070 100644 --- a/sys/opencrypto/xform_enc.h +++ b/sys/opencrypto/xform_enc.h @@ -36,6 +36,9 @@ #include <crypto/rijndael/rijndael.h> #include <crypto/camellia/camellia.h> #include <opencrypto/cryptodev.h> +#ifdef _STANDALONE +#include <stand.h> +#endif #define AESICM_BLOCKSIZE AES_BLOCK_LEN #define AES_XTS_BLOCKSIZE 16 |