diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-07-06 16:52:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-06 16:52:27 -0400 |
commit | 6789b2dc455b90efc9c88886c9366adc9abb7347 (patch) | |
tree | a962565f31b2c8c0cb112b2ce482cceb3d16caef /drivers/crypto/padlock.h | |
parent | 95477377995aefa2ec1654a9a3777bd57ea99146 (diff) |
[PADLOCK] Move fast path work into aes_set_key and upper layer
Most of the work done aes_padlock can be done in aes_set_key. This
means that we only have to do it once when the key changes rather
than every time we perform an encryption or decryption.
This patch also sets cra_alignmask to let the upper layer ensure
that the buffers fed to us are aligned correctly.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/crypto/padlock.h')
-rw-r--r-- | drivers/crypto/padlock.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/crypto/padlock.h b/drivers/crypto/padlock.h index 7a500605e449..3cf2b7a12348 100644 --- a/drivers/crypto/padlock.h +++ b/drivers/crypto/padlock.h | |||
@@ -13,18 +13,18 @@ | |||
13 | #ifndef _CRYPTO_PADLOCK_H | 13 | #ifndef _CRYPTO_PADLOCK_H |
14 | #define _CRYPTO_PADLOCK_H | 14 | #define _CRYPTO_PADLOCK_H |
15 | 15 | ||
16 | #define PADLOCK_ALIGNMENT 16 | ||
17 | |||
16 | /* Control word. */ | 18 | /* Control word. */ |
17 | union cword { | 19 | struct cword { |
18 | uint32_t cword[4]; | 20 | int __attribute__ ((__packed__)) |
19 | struct { | 21 | rounds:4, |
20 | int rounds:4; | 22 | algo:3, |
21 | int algo:3; | 23 | keygen:1, |
22 | int keygen:1; | 24 | interm:1, |
23 | int interm:1; | 25 | encdec:1, |
24 | int encdec:1; | 26 | ksize:2; |
25 | int ksize:2; | 27 | } __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); |
26 | } b; | ||
27 | }; | ||
28 | 28 | ||
29 | #define PFX "padlock: " | 29 | #define PFX "padlock: " |
30 | 30 | ||