Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix usage of aesni_encrypt_xts() and aesni_decrypt_xts()

  • Loading branch information...
commit 8d083b6b372c1fdd42bc9dfef00281e389ccad0f 1 parent f7b7133
Kris Moore authored September 13, 2013

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  sys/fs/pefs/pefs_aesni.c
7  sys/fs/pefs/pefs_aesni.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
40 40
 #include <sys/systm.h>
41 41
 
42 42
 #include <fs/pefs/pefs_crypto.h>
  43
+#include <cryptodev_if.h>
43 44
 
44 45
 #define	AESNI_ENABLE_ENV	"vfs.pefs.aesni_enable"
45 46
 
@@ -117,7 +118,8 @@ pefs_aesni_encrypt(const struct pefs_session *xses,
117 118
 	const struct pefs_aesni_ctx *ctx = &xctx->o.pctx_aesni;
118 119
 
119 120
 	if (ses->fpu_saved >= 0)
120  
-		aesni_encrypt_xts(ctx->rounds - 1, ctx->enc_schedule, in, out, NULL);
  121
+		aesni_encrypt_xts(ses->rounds, ses->enc_schedule,
  122
+                            ses->xts_schedule, AES_BLOCK_LEN, in, out, NULL);
121 123
 	else
122 124
 		rijndael_encrypt(&ctx->sw, in, out);
123 125
 }
@@ -130,7 +132,8 @@ pefs_aesni_decrypt(const struct pefs_session *xses,
130 132
 	const struct pefs_aesni_ctx *ctx = &xctx->o.pctx_aesni;
131 133
 
132 134
 	if (ses->fpu_saved >= 0)
133  
-		aesni_decrypt_xts(ctx->rounds - 1, ctx->dec_schedule, in, out, NULL);
  135
+		aesni_decrypt_xts(ses->rounds, ses->enc_schedule,
  136
+                            ses->xts_schedule, AES_BLOCK_LEN, in, out, NULL);
134 137
 	else
135 138
 		rijndael_decrypt(&ctx->sw, in, out);
136 139
 }

0 notes on commit 8d083b6

Please sign in to comment.
Something went wrong with that request. Please try again.