aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto/aes_s390.c
diff options
context:
space:
mode:
authorJan Glauber <jan.glauber@de.ibm.com>2007-05-04 12:47:47 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-05-04 12:48:25 -0400
commitf67d1369665b2ce88227c40d9c9a6c8ba16bb866 (patch)
tree15772b01fb0aafae0a38b778519c64b16c6dde6c /arch/s390/crypto/aes_s390.c
parent33464e3b57834e161add62b499492cf43e35e54c (diff)
[S390] aes-s390 key length.
Register aes-s390 algorithms with the actual supported max keylen size Signed-off-by: Jan Glauber <jan.glauber@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/crypto/aes_s390.c')
-rw-r--r--arch/s390/crypto/aes_s390.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 91636353f6f0..3660ca6a3306 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -119,7 +119,8 @@ static struct crypto_alg aes_alg = {
119 .cra_name = "aes", 119 .cra_name = "aes",
120 .cra_driver_name = "aes-s390", 120 .cra_driver_name = "aes-s390",
121 .cra_priority = CRYPT_S390_PRIORITY, 121 .cra_priority = CRYPT_S390_PRIORITY,
122 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 122 .cra_flags = CRYPTO_ALG_TYPE_CIPHER |
123 CRYPTO_ALG_NEED_FALLBACK,
123 .cra_blocksize = AES_BLOCK_SIZE, 124 .cra_blocksize = AES_BLOCK_SIZE,
124 .cra_ctxsize = sizeof(struct s390_aes_ctx), 125 .cra_ctxsize = sizeof(struct s390_aes_ctx),
125 .cra_module = THIS_MODULE, 126 .cra_module = THIS_MODULE,
@@ -206,7 +207,8 @@ static struct crypto_alg ecb_aes_alg = {
206 .cra_name = "ecb(aes)", 207 .cra_name = "ecb(aes)",
207 .cra_driver_name = "ecb-aes-s390", 208 .cra_driver_name = "ecb-aes-s390",
208 .cra_priority = CRYPT_S390_COMPOSITE_PRIORITY, 209 .cra_priority = CRYPT_S390_COMPOSITE_PRIORITY,
209 .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, 210 .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
211 CRYPTO_ALG_NEED_FALLBACK,
210 .cra_blocksize = AES_BLOCK_SIZE, 212 .cra_blocksize = AES_BLOCK_SIZE,
211 .cra_ctxsize = sizeof(struct s390_aes_ctx), 213 .cra_ctxsize = sizeof(struct s390_aes_ctx),
212 .cra_type = &crypto_blkcipher_type, 214 .cra_type = &crypto_blkcipher_type,
@@ -300,7 +302,8 @@ static struct crypto_alg cbc_aes_alg = {
300 .cra_name = "cbc(aes)", 302 .cra_name = "cbc(aes)",
301 .cra_driver_name = "cbc-aes-s390", 303 .cra_driver_name = "cbc-aes-s390",
302 .cra_priority = CRYPT_S390_COMPOSITE_PRIORITY, 304 .cra_priority = CRYPT_S390_COMPOSITE_PRIORITY,
303 .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER, 305 .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER |
306 CRYPTO_ALG_NEED_FALLBACK,
304 .cra_blocksize = AES_BLOCK_SIZE, 307 .cra_blocksize = AES_BLOCK_SIZE,
305 .cra_ctxsize = sizeof(struct s390_aes_ctx), 308 .cra_ctxsize = sizeof(struct s390_aes_ctx),
306 .cra_type = &crypto_blkcipher_type, 309 .cra_type = &crypto_blkcipher_type,
@@ -333,10 +336,14 @@ static int __init aes_init(void)
333 return -EOPNOTSUPP; 336 return -EOPNOTSUPP;
334 337
335 /* z9 109 and z9 BC/EC only support 128 bit key length */ 338 /* z9 109 and z9 BC/EC only support 128 bit key length */
336 if (keylen_flag == AES_KEYLEN_128) 339 if (keylen_flag == AES_KEYLEN_128) {
340 aes_alg.cra_u.cipher.cia_max_keysize = AES_MIN_KEY_SIZE;
341 ecb_aes_alg.cra_u.blkcipher.max_keysize = AES_MIN_KEY_SIZE;
342 cbc_aes_alg.cra_u.blkcipher.max_keysize = AES_MIN_KEY_SIZE;
337 printk(KERN_INFO 343 printk(KERN_INFO
338 "aes_s390: hardware acceleration only available for" 344 "aes_s390: hardware acceleration only available for"
339 "128 bit keys\n"); 345 "128 bit keys\n");
346 }
340 347
341 ret = crypto_register_alg(&aes_alg); 348 ret = crypto_register_alg(&aes_alg);
342 if (ret) 349 if (ret)