diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/padlock-aes.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index f53301e836d9..d4501dc7e650 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c | |||
@@ -452,46 +452,6 @@ static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) | |||
452 | padlock_xcrypt_ecb(in, out, ctx->D, &ctx->cword.decrypt, 1); | 452 | padlock_xcrypt_ecb(in, out, ctx->D, &ctx->cword.decrypt, 1); |
453 | } | 453 | } |
454 | 454 | ||
455 | static unsigned int aes_encrypt_ecb(const struct cipher_desc *desc, u8 *out, | ||
456 | const u8 *in, unsigned int nbytes) | ||
457 | { | ||
458 | struct aes_ctx *ctx = aes_ctx(desc->tfm); | ||
459 | padlock_xcrypt_ecb(in, out, ctx->E, &ctx->cword.encrypt, | ||
460 | nbytes / AES_BLOCK_SIZE); | ||
461 | return nbytes & ~(AES_BLOCK_SIZE - 1); | ||
462 | } | ||
463 | |||
464 | static unsigned int aes_decrypt_ecb(const struct cipher_desc *desc, u8 *out, | ||
465 | const u8 *in, unsigned int nbytes) | ||
466 | { | ||
467 | struct aes_ctx *ctx = aes_ctx(desc->tfm); | ||
468 | padlock_xcrypt_ecb(in, out, ctx->D, &ctx->cword.decrypt, | ||
469 | nbytes / AES_BLOCK_SIZE); | ||
470 | return nbytes & ~(AES_BLOCK_SIZE - 1); | ||
471 | } | ||
472 | |||
473 | static unsigned int aes_encrypt_cbc(const struct cipher_desc *desc, u8 *out, | ||
474 | const u8 *in, unsigned int nbytes) | ||
475 | { | ||
476 | struct aes_ctx *ctx = aes_ctx(desc->tfm); | ||
477 | u8 *iv; | ||
478 | |||
479 | iv = padlock_xcrypt_cbc(in, out, ctx->E, desc->info, | ||
480 | &ctx->cword.encrypt, nbytes / AES_BLOCK_SIZE); | ||
481 | memcpy(desc->info, iv, AES_BLOCK_SIZE); | ||
482 | |||
483 | return nbytes & ~(AES_BLOCK_SIZE - 1); | ||
484 | } | ||
485 | |||
486 | static unsigned int aes_decrypt_cbc(const struct cipher_desc *desc, u8 *out, | ||
487 | const u8 *in, unsigned int nbytes) | ||
488 | { | ||
489 | struct aes_ctx *ctx = aes_ctx(desc->tfm); | ||
490 | padlock_xcrypt_cbc(in, out, ctx->D, desc->info, &ctx->cword.decrypt, | ||
491 | nbytes / AES_BLOCK_SIZE); | ||
492 | return nbytes & ~(AES_BLOCK_SIZE - 1); | ||
493 | } | ||
494 | |||
495 | static struct crypto_alg aes_alg = { | 455 | static struct crypto_alg aes_alg = { |
496 | .cra_name = "aes", | 456 | .cra_name = "aes", |
497 | .cra_driver_name = "aes-padlock", | 457 | .cra_driver_name = "aes-padlock", |
@@ -509,10 +469,6 @@ static struct crypto_alg aes_alg = { | |||
509 | .cia_setkey = aes_set_key, | 469 | .cia_setkey = aes_set_key, |
510 | .cia_encrypt = aes_encrypt, | 470 | .cia_encrypt = aes_encrypt, |
511 | .cia_decrypt = aes_decrypt, | 471 | .cia_decrypt = aes_decrypt, |
512 | .cia_encrypt_ecb = aes_encrypt_ecb, | ||
513 | .cia_decrypt_ecb = aes_decrypt_ecb, | ||
514 | .cia_encrypt_cbc = aes_encrypt_cbc, | ||
515 | .cia_decrypt_cbc = aes_decrypt_cbc, | ||
516 | } | 472 | } |
517 | } | 473 | } |
518 | }; | 474 | }; |