]> err.no Git - linux-2.6/blobdiff - arch/s390/crypto/aes_s390.c
[CRYPTO] s390: Added missing driver name and priority
[linux-2.6] / arch / s390 / crypto / aes_s390.c
index c5ca2dc5d4281ee67d7d67be936dec4ec2214ff0..220300e760d8a85a52b9003524c24cf48f636794 100644 (file)
@@ -37,10 +37,11 @@ struct s390_aes_ctx {
        int key_len;
 };
 
-static int aes_set_key(void *ctx, const u8 *in_key, unsigned int key_len,
-                      u32 *flags)
+static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
+                      unsigned int key_len)
 {
-       struct s390_aes_ctx *sctx = ctx;
+       struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
+       u32 *flags = &tfm->crt_flags;
 
        switch (key_len) {
        case 16:
@@ -70,9 +71,9 @@ fail:
        return -EINVAL;
 }
 
-static void aes_encrypt(void *ctx, u8 *out, const u8 *in)
+static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 {
-       const struct s390_aes_ctx *sctx = ctx;
+       const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
 
        switch (sctx->key_len) {
        case 16:
@@ -90,9 +91,9 @@ static void aes_encrypt(void *ctx, u8 *out, const u8 *in)
        }
 }
 
-static void aes_decrypt(void *ctx, u8 *out, const u8 *in)
+static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 {
-       const struct s390_aes_ctx *sctx = ctx;
+       const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
 
        switch (sctx->key_len) {
        case 16:
@@ -221,6 +222,8 @@ static unsigned int aes_decrypt_cbc(const struct cipher_desc *desc, u8 *out,
 
 static struct crypto_alg aes_alg = {
        .cra_name               =       "aes",
+       .cra_driver_name        =       "aes-s390",
+       .cra_priority           =       CRYPT_S390_PRIORITY,
        .cra_flags              =       CRYPTO_ALG_TYPE_CIPHER,
        .cra_blocksize          =       AES_BLOCK_SIZE,
        .cra_ctxsize            =       sizeof(struct s390_aes_ctx),