diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-31 00:57:05 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-31 00:57:05 -0400 |
commit | 5bc65793cbf8da0d35f19ef025dda22887e79e80 (patch) | |
tree | 8291998abd73055de6f487fafa174ee2a5d3afee /drivers/crypto | |
parent | 6edae708bf77e012d855a7e2c7766f211d234f4f (diff) | |
parent | 3f0a6766e0cc5a577805732e5adb50a585c58175 (diff) |
[SCSI] Merge up to linux-2.6 head
Conflicts:
drivers/scsi/jazz_esp.c
Same changes made by both SCSI and SPARC trees: problem with UTF-8
conversion in the copyright.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/Kconfig | 4 | ||||
-rw-r--r-- | drivers/crypto/geode-aes.c | 12 | ||||
-rw-r--r-- | drivers/crypto/geode-aes.h | 3 |
3 files changed, 12 insertions, 7 deletions
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index e678a33ea672..bb90cbd7ca51 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
@@ -1,10 +1,10 @@ | |||
1 | menu "Hardware crypto devices" | 1 | menu "Hardware crypto devices" |
2 | 2 | ||
3 | config CRYPTO_DEV_PADLOCK | 3 | config CRYPTO_DEV_PADLOCK |
4 | bool "Support for VIA PadLock ACE" | 4 | tristate "Support for VIA PadLock ACE" |
5 | depends on X86_32 | 5 | depends on X86_32 |
6 | select CRYPTO_ALGAPI | 6 | select CRYPTO_ALGAPI |
7 | default y | 7 | default m |
8 | help | 8 | help |
9 | Some VIA processors come with an integrated crypto engine | 9 | Some VIA processors come with an integrated crypto engine |
10 | (so called VIA PadLock ACE, Advanced Cryptography Engine) | 10 | (so called VIA PadLock ACE, Advanced Cryptography Engine) |
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 6d3840e629de..6a86958b577f 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c | |||
@@ -102,10 +102,15 @@ geode_aes_crypt(struct geode_aes_op *op) | |||
102 | u32 flags = 0; | 102 | u32 flags = 0; |
103 | unsigned long iflags; | 103 | unsigned long iflags; |
104 | 104 | ||
105 | if (op->len == 0 || op->src == op->dst) | 105 | if (op->len == 0) |
106 | return 0; | 106 | return 0; |
107 | 107 | ||
108 | if (op->flags & AES_FLAGS_COHERENT) | 108 | /* If the source and destination is the same, then |
109 | * we need to turn on the coherent flags, otherwise | ||
110 | * we don't need to worry | ||
111 | */ | ||
112 | |||
113 | if (op->src == op->dst) | ||
109 | flags |= (AES_CTRL_DCA | AES_CTRL_SCA); | 114 | flags |= (AES_CTRL_DCA | AES_CTRL_SCA); |
110 | 115 | ||
111 | if (op->dir == AES_DIR_ENCRYPT) | 116 | if (op->dir == AES_DIR_ENCRYPT) |
@@ -120,7 +125,7 @@ geode_aes_crypt(struct geode_aes_op *op) | |||
120 | _writefield(AES_WRITEIV0_REG, op->iv); | 125 | _writefield(AES_WRITEIV0_REG, op->iv); |
121 | } | 126 | } |
122 | 127 | ||
123 | if (op->flags & AES_FLAGS_USRKEY) { | 128 | if (!(op->flags & AES_FLAGS_HIDDENKEY)) { |
124 | flags |= AES_CTRL_WRKEY; | 129 | flags |= AES_CTRL_WRKEY; |
125 | _writefield(AES_WRITEKEY0_REG, op->key); | 130 | _writefield(AES_WRITEKEY0_REG, op->key); |
126 | } | 131 | } |
@@ -289,6 +294,7 @@ static struct crypto_alg geode_cbc_alg = { | |||
289 | .setkey = geode_setkey, | 294 | .setkey = geode_setkey, |
290 | .encrypt = geode_cbc_encrypt, | 295 | .encrypt = geode_cbc_encrypt, |
291 | .decrypt = geode_cbc_decrypt, | 296 | .decrypt = geode_cbc_decrypt, |
297 | .ivsize = AES_IV_LENGTH, | ||
292 | } | 298 | } |
293 | } | 299 | } |
294 | }; | 300 | }; |
diff --git a/drivers/crypto/geode-aes.h b/drivers/crypto/geode-aes.h index 8003a36f3a83..f47968671ae7 100644 --- a/drivers/crypto/geode-aes.h +++ b/drivers/crypto/geode-aes.h | |||
@@ -20,8 +20,7 @@ | |||
20 | #define AES_DIR_DECRYPT 0 | 20 | #define AES_DIR_DECRYPT 0 |
21 | #define AES_DIR_ENCRYPT 1 | 21 | #define AES_DIR_ENCRYPT 1 |
22 | 22 | ||
23 | #define AES_FLAGS_USRKEY (1 << 0) | 23 | #define AES_FLAGS_HIDDENKEY (1 << 0) |
24 | #define AES_FLAGS_COHERENT (1 << 1) | ||
25 | 24 | ||
26 | struct geode_aes_op { | 25 | struct geode_aes_op { |
27 | 26 | ||