diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-08-05 02:28:19 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2006-09-20 21:46:16 -0400 |
commit | efcf8023e299be605f217dc2c1b2754b5534569c (patch) | |
tree | 36baba6406dd270f64c4e039811893877f9f0499 /arch/s390/crypto/des_s390.c | |
parent | f12cc2090d721647c23dfce20834f4306db3b77d (diff) |
[CRYPTO] drivers: Remove obsolete block cipher operations
This patch removes obsolete block operations of the simple cipher type
from drivers. These were preserved so that existing users can make a
smooth transition. Now that the transition is complete, they are no
longer needed.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/s390/crypto/des_s390.c')
-rw-r--r-- | arch/s390/crypto/des_s390.c | 203 |
1 files changed, 0 insertions, 203 deletions
diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c index a6d2385ccb7a..2aba04852fe3 100644 --- a/arch/s390/crypto/des_s390.c +++ b/arch/s390/crypto/des_s390.c | |||
@@ -73,67 +73,6 @@ static void des_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) | |||
73 | crypt_s390_km(KM_DEA_DECRYPT, dctx->key, out, in, DES_BLOCK_SIZE); | 73 | crypt_s390_km(KM_DEA_DECRYPT, dctx->key, out, in, DES_BLOCK_SIZE); |
74 | } | 74 | } |
75 | 75 | ||
76 | static unsigned int des_encrypt_ecb(const struct cipher_desc *desc, u8 *out, | ||
77 | const u8 *in, unsigned int nbytes) | ||
78 | { | ||
79 | struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
80 | int ret; | ||
81 | |||
82 | /* only use complete blocks */ | ||
83 | nbytes &= ~(DES_BLOCK_SIZE - 1); | ||
84 | ret = crypt_s390_km(KM_DEA_ENCRYPT, sctx->key, out, in, nbytes); | ||
85 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
86 | |||
87 | return nbytes; | ||
88 | } | ||
89 | |||
90 | static unsigned int des_decrypt_ecb(const struct cipher_desc *desc, u8 *out, | ||
91 | const u8 *in, unsigned int nbytes) | ||
92 | { | ||
93 | struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
94 | int ret; | ||
95 | |||
96 | /* only use complete blocks */ | ||
97 | nbytes &= ~(DES_BLOCK_SIZE - 1); | ||
98 | ret = crypt_s390_km(KM_DEA_DECRYPT, sctx->key, out, in, nbytes); | ||
99 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
100 | |||
101 | return nbytes; | ||
102 | } | ||
103 | |||
104 | static unsigned int des_encrypt_cbc(const struct cipher_desc *desc, u8 *out, | ||
105 | const u8 *in, unsigned int nbytes) | ||
106 | { | ||
107 | struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
108 | int ret; | ||
109 | |||
110 | /* only use complete blocks */ | ||
111 | nbytes &= ~(DES_BLOCK_SIZE - 1); | ||
112 | |||
113 | memcpy(sctx->iv, desc->info, DES_BLOCK_SIZE); | ||
114 | ret = crypt_s390_kmc(KMC_DEA_ENCRYPT, &sctx->iv, out, in, nbytes); | ||
115 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
116 | |||
117 | memcpy(desc->info, sctx->iv, DES_BLOCK_SIZE); | ||
118 | return nbytes; | ||
119 | } | ||
120 | |||
121 | static unsigned int des_decrypt_cbc(const struct cipher_desc *desc, u8 *out, | ||
122 | const u8 *in, unsigned int nbytes) | ||
123 | { | ||
124 | struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
125 | int ret; | ||
126 | |||
127 | /* only use complete blocks */ | ||
128 | nbytes &= ~(DES_BLOCK_SIZE - 1); | ||
129 | |||
130 | memcpy(&sctx->iv, desc->info, DES_BLOCK_SIZE); | ||
131 | ret = crypt_s390_kmc(KMC_DEA_DECRYPT, &sctx->iv, out, in, nbytes); | ||
132 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
133 | |||
134 | return nbytes; | ||
135 | } | ||
136 | |||
137 | static struct crypto_alg des_alg = { | 76 | static struct crypto_alg des_alg = { |
138 | .cra_name = "des", | 77 | .cra_name = "des", |
139 | .cra_driver_name = "des-s390", | 78 | .cra_driver_name = "des-s390", |
@@ -150,10 +89,6 @@ static struct crypto_alg des_alg = { | |||
150 | .cia_setkey = des_setkey, | 89 | .cia_setkey = des_setkey, |
151 | .cia_encrypt = des_encrypt, | 90 | .cia_encrypt = des_encrypt, |
152 | .cia_decrypt = des_decrypt, | 91 | .cia_decrypt = des_decrypt, |
153 | .cia_encrypt_ecb = des_encrypt_ecb, | ||
154 | .cia_decrypt_ecb = des_decrypt_ecb, | ||
155 | .cia_encrypt_cbc = des_encrypt_cbc, | ||
156 | .cia_decrypt_cbc = des_decrypt_cbc, | ||
157 | } | 92 | } |
158 | } | 93 | } |
159 | }; | 94 | }; |
@@ -344,71 +279,6 @@ static void des3_128_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | |||
344 | DES3_128_BLOCK_SIZE); | 279 | DES3_128_BLOCK_SIZE); |
345 | } | 280 | } |
346 | 281 | ||
347 | static unsigned int des3_128_encrypt_ecb(const struct cipher_desc *desc, | ||
348 | u8 *out, const u8 *in, | ||
349 | unsigned int nbytes) | ||
350 | { | ||
351 | struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
352 | int ret; | ||
353 | |||
354 | /* only use complete blocks */ | ||
355 | nbytes &= ~(DES3_128_BLOCK_SIZE - 1); | ||
356 | ret = crypt_s390_km(KM_TDEA_128_ENCRYPT, sctx->key, out, in, nbytes); | ||
357 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
358 | |||
359 | return nbytes; | ||
360 | } | ||
361 | |||
362 | static unsigned int des3_128_decrypt_ecb(const struct cipher_desc *desc, | ||
363 | u8 *out, const u8 *in, | ||
364 | unsigned int nbytes) | ||
365 | { | ||
366 | struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
367 | int ret; | ||
368 | |||
369 | /* only use complete blocks */ | ||
370 | nbytes &= ~(DES3_128_BLOCK_SIZE - 1); | ||
371 | ret = crypt_s390_km(KM_TDEA_128_DECRYPT, sctx->key, out, in, nbytes); | ||
372 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
373 | |||
374 | return nbytes; | ||
375 | } | ||
376 | |||
377 | static unsigned int des3_128_encrypt_cbc(const struct cipher_desc *desc, | ||
378 | u8 *out, const u8 *in, | ||
379 | unsigned int nbytes) | ||
380 | { | ||
381 | struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
382 | int ret; | ||
383 | |||
384 | /* only use complete blocks */ | ||
385 | nbytes &= ~(DES3_128_BLOCK_SIZE - 1); | ||
386 | |||
387 | memcpy(sctx->iv, desc->info, DES3_128_BLOCK_SIZE); | ||
388 | ret = crypt_s390_kmc(KMC_TDEA_128_ENCRYPT, &sctx->iv, out, in, nbytes); | ||
389 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
390 | |||
391 | memcpy(desc->info, sctx->iv, DES3_128_BLOCK_SIZE); | ||
392 | return nbytes; | ||
393 | } | ||
394 | |||
395 | static unsigned int des3_128_decrypt_cbc(const struct cipher_desc *desc, | ||
396 | u8 *out, const u8 *in, | ||
397 | unsigned int nbytes) | ||
398 | { | ||
399 | struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
400 | int ret; | ||
401 | |||
402 | /* only use complete blocks */ | ||
403 | nbytes &= ~(DES3_128_BLOCK_SIZE - 1); | ||
404 | |||
405 | memcpy(&sctx->iv, desc->info, DES3_128_BLOCK_SIZE); | ||
406 | ret = crypt_s390_kmc(KMC_TDEA_128_DECRYPT, &sctx->iv, out, in, nbytes); | ||
407 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
408 | |||
409 | return nbytes; | ||
410 | } | ||
411 | |||
412 | static struct crypto_alg des3_128_alg = { | 282 | static struct crypto_alg des3_128_alg = { |
413 | .cra_name = "des3_ede128", | 283 | .cra_name = "des3_ede128", |
414 | .cra_driver_name = "des3_ede128-s390", | 284 | .cra_driver_name = "des3_ede128-s390", |
@@ -425,10 +295,6 @@ static struct crypto_alg des3_128_alg = { | |||
425 | .cia_setkey = des3_128_setkey, | 295 | .cia_setkey = des3_128_setkey, |
426 | .cia_encrypt = des3_128_encrypt, | 296 | .cia_encrypt = des3_128_encrypt, |
427 | .cia_decrypt = des3_128_decrypt, | 297 | .cia_decrypt = des3_128_decrypt, |
428 | .cia_encrypt_ecb = des3_128_encrypt_ecb, | ||
429 | .cia_decrypt_ecb = des3_128_decrypt_ecb, | ||
430 | .cia_encrypt_cbc = des3_128_encrypt_cbc, | ||
431 | .cia_decrypt_cbc = des3_128_decrypt_cbc, | ||
432 | } | 298 | } |
433 | } | 299 | } |
434 | }; | 300 | }; |
@@ -575,71 +441,6 @@ static void des3_192_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | |||
575 | DES3_192_BLOCK_SIZE); | 441 | DES3_192_BLOCK_SIZE); |
576 | } | 442 | } |
577 | 443 | ||
578 | static unsigned int des3_192_encrypt_ecb(const struct cipher_desc *desc, | ||
579 | u8 *out, const u8 *in, | ||
580 | unsigned int nbytes) | ||
581 | { | ||
582 | struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
583 | int ret; | ||
584 | |||
585 | /* only use complete blocks */ | ||
586 | nbytes &= ~(DES3_192_BLOCK_SIZE - 1); | ||
587 | ret = crypt_s390_km(KM_TDEA_192_ENCRYPT, sctx->key, out, in, nbytes); | ||
588 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
589 | |||
590 | return nbytes; | ||
591 | } | ||
592 | |||
593 | static unsigned int des3_192_decrypt_ecb(const struct cipher_desc *desc, | ||
594 | u8 *out, const u8 *in, | ||
595 | unsigned int nbytes) | ||
596 | { | ||
597 | struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
598 | int ret; | ||
599 | |||
600 | /* only use complete blocks */ | ||
601 | nbytes &= ~(DES3_192_BLOCK_SIZE - 1); | ||
602 | ret = crypt_s390_km(KM_TDEA_192_DECRYPT, sctx->key, out, in, nbytes); | ||
603 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
604 | |||
605 | return nbytes; | ||
606 | } | ||
607 | |||
608 | static unsigned int des3_192_encrypt_cbc(const struct cipher_desc *desc, | ||
609 | u8 *out, const u8 *in, | ||
610 | unsigned int nbytes) | ||
611 | { | ||
612 | struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
613 | int ret; | ||
614 | |||
615 | /* only use complete blocks */ | ||
616 | nbytes &= ~(DES3_192_BLOCK_SIZE - 1); | ||
617 | |||
618 | memcpy(sctx->iv, desc->info, DES3_192_BLOCK_SIZE); | ||
619 | ret = crypt_s390_kmc(KMC_TDEA_192_ENCRYPT, &sctx->iv, out, in, nbytes); | ||
620 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
621 | |||
622 | memcpy(desc->info, sctx->iv, DES3_192_BLOCK_SIZE); | ||
623 | return nbytes; | ||
624 | } | ||
625 | |||
626 | static unsigned int des3_192_decrypt_cbc(const struct cipher_desc *desc, | ||
627 | u8 *out, const u8 *in, | ||
628 | unsigned int nbytes) | ||
629 | { | ||
630 | struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm); | ||
631 | int ret; | ||
632 | |||
633 | /* only use complete blocks */ | ||
634 | nbytes &= ~(DES3_192_BLOCK_SIZE - 1); | ||
635 | |||
636 | memcpy(&sctx->iv, desc->info, DES3_192_BLOCK_SIZE); | ||
637 | ret = crypt_s390_kmc(KMC_TDEA_192_DECRYPT, &sctx->iv, out, in, nbytes); | ||
638 | BUG_ON((ret < 0) || (ret != nbytes)); | ||
639 | |||
640 | return nbytes; | ||
641 | } | ||
642 | |||
643 | static struct crypto_alg des3_192_alg = { | 444 | static struct crypto_alg des3_192_alg = { |
644 | .cra_name = "des3_ede", | 445 | .cra_name = "des3_ede", |
645 | .cra_driver_name = "des3_ede-s390", | 446 | .cra_driver_name = "des3_ede-s390", |
@@ -656,10 +457,6 @@ static struct crypto_alg des3_192_alg = { | |||
656 | .cia_setkey = des3_192_setkey, | 457 | .cia_setkey = des3_192_setkey, |
657 | .cia_encrypt = des3_192_encrypt, | 458 | .cia_encrypt = des3_192_encrypt, |
658 | .cia_decrypt = des3_192_decrypt, | 459 | .cia_decrypt = des3_192_decrypt, |
659 | .cia_encrypt_ecb = des3_192_encrypt_ecb, | ||
660 | .cia_decrypt_ecb = des3_192_decrypt_ecb, | ||
661 | .cia_encrypt_cbc = des3_192_encrypt_cbc, | ||
662 | .cia_decrypt_cbc = des3_192_decrypt_cbc, | ||
663 | } | 460 | } |
664 | } | 461 | } |
665 | }; | 462 | }; |