]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/crypto/padlock-aes.c
[IRDA]: stir4200, switching to the kthread API
[linux-2.6-omap-h63xx.git] / drivers / crypto / padlock-aes.c
index 64819aa7cac42a31f9e181809167ae92cf1ac5dc..5158a9db4bc58faeabd16b44a7ed2221cbd141ed 100644 (file)
@@ -284,7 +284,11 @@ aes_hw_extkey_available(uint8_t key_len)
 
 static inline struct aes_ctx *aes_ctx(void *ctx)
 {
-       return (struct aes_ctx *)ALIGN((unsigned long)ctx, PADLOCK_ALIGNMENT);
+       unsigned long align = PADLOCK_ALIGNMENT;
+
+       if (align <= crypto_tfm_ctx_alignment())
+               align = 1;
+       return (struct aes_ctx *)ALIGN((unsigned long)ctx, align);
 }
 
 static int
@@ -348,10 +352,10 @@ aes_set_key(void *ctx_arg, const uint8_t *in_key, unsigned int key_len, uint32_t
                break;
 
        case 32:
-               E_KEY[4] = le32_to_cpu(in_key[4]);
-               E_KEY[5] = le32_to_cpu(in_key[5]);
-               E_KEY[6] = le32_to_cpu(in_key[6]);
-               t = E_KEY[7] = le32_to_cpu(in_key[7]);
+               E_KEY[4] = le32_to_cpu(key[4]);
+               E_KEY[5] = le32_to_cpu(key[5]);
+               E_KEY[6] = le32_to_cpu(key[6]);
+               t = E_KEY[7] = le32_to_cpu(key[7]);
                for (i = 0; i < 7; ++i)
                        loop8 (i);
                break;