Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107566878
D28157.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28157.diff
View Options
diff --git a/sys/crypto/aesni/aesni.h b/sys/crypto/aesni/aesni.h
--- a/sys/crypto/aesni/aesni.h
+++ b/sys/crypto/aesni/aesni.h
@@ -47,11 +47,13 @@
#define AES192_ROUNDS 12
#define AES256_ROUNDS 14
#define AES_SCHED_LEN ((AES256_ROUNDS + 1) * AES_BLOCK_LEN)
+#define AES_SCHED_ALIGN 16
struct aesni_session {
- uint8_t enc_schedule[AES_SCHED_LEN] __aligned(16);
- uint8_t dec_schedule[AES_SCHED_LEN] __aligned(16);
- uint8_t xts_schedule[AES_SCHED_LEN] __aligned(16);
+ uint8_t schedules[3 * AES_SCHED_LEN + AES_SCHED_ALIGN];
+ uint8_t *enc_schedule;
+ uint8_t *dec_schedule;
+ uint8_t *xts_schedule;
int rounds;
/* uint8_t *ses_ictx; */
/* uint8_t *ses_octx; */
diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c
--- a/sys/crypto/aesni/aesni.c
+++ b/sys/crypto/aesni/aesni.c
@@ -560,8 +560,15 @@
const struct crypto_session_params *csp)
{
struct fpu_kern_ctx *ctx;
+ uint8_t *schedbase;
int kt, ctxidx, error;
+ schedbase = (uint8_t *)roundup2((uintptr_t)ses->schedules,
+ AES_SCHED_ALIGN);
+ ses->enc_schedule = schedbase;
+ ses->dec_schedule = schedbase + AES_SCHED_LEN;
+ ses->xts_schedule = schedbase + AES_SCHED_LEN * 2;
+
switch (csp->csp_auth_alg) {
case CRYPTO_SHA1_HMAC:
ses->hmac = true;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 11:55 PM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15830794
Default Alt Text
D28157.diff (1 KB)
Attached To
Mode
D28157: aesni: Ensure that key schedules are aligned
Attached
Detach File
Event Timeline
Log In to Comment