]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[CRYPTO] aes: Move common defines into a header file
authorSebastian Siewior <sebastian@breakpoint.cc>
Wed, 17 Oct 2007 15:18:57 +0000 (23:18 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Jan 2008 21:16:04 +0000 (08:16 +1100)
This three defines are used in all AES related hardware.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/s390/crypto/aes_s390.c
arch/x86/crypto/aes_32.c
arch/x86/crypto/aes_64.c
crypto/aes_generic.c
drivers/crypto/geode-aes.c
drivers/crypto/padlock-aes.c
include/crypto/aes.h [new file with mode: 0644]

index 512669691ad01b9513ce5c283d5d9db6e75e5aed..812511bbb540009c53dc5d1e1109fa110a1c4811 100644 (file)
  *
  */
 
+#include <crypto/aes.h>
 #include <crypto/algapi.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include "crypt_s390.h"
 
-#define AES_MIN_KEY_SIZE       16
-#define AES_MAX_KEY_SIZE       32
-
-/* data block size for all key lengths */
-#define AES_BLOCK_SIZE         16
-
 #define AES_KEYLEN_128         1
 #define AES_KEYLEN_192         2
 #define AES_KEYLEN_256         4
index 49aad9397f10afe8facc4c13f1d3bc0fa1d7307b..9b0ab50394b0c46d35a439e43282a53308eeb6f4 100644 (file)
@@ -38,6 +38,7 @@
  */
 
 #include <asm/byteorder.h>
+#include <crypto/aes.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -48,9 +49,6 @@
 asmlinkage void aes_enc_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
 asmlinkage void aes_dec_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
 
-#define AES_MIN_KEY_SIZE       16
-#define AES_MAX_KEY_SIZE       32
-#define AES_BLOCK_SIZE         16
 #define AES_KS_LENGTH          4 * AES_BLOCK_SIZE
 #define RC_LENGTH              29
 
index 5cdb13ea5cc2d3d9126ebf4c93f4dfb96a7d21e0..0b38a4cd2ce1bcda1380042cdede32f97c5ef4ff 100644 (file)
@@ -54,6 +54,7 @@
 */
 
 #include <asm/byteorder.h>
+#include <crypto/aes.h>
 #include <linux/bitops.h>
 #include <linux/crypto.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/types.h>
 
-#define AES_MIN_KEY_SIZE       16
-#define AES_MAX_KEY_SIZE       32
-
-#define AES_BLOCK_SIZE         16
-
 /*
  * #define byte(x, nr) ((unsigned char)((x) >> (nr*8)))
  */
index 9401dca85e87c9a5c3908ef6cfbd78fa9a20db89..6683260475f9427b3b28d056a75fd151687c4106 100644 (file)
@@ -52,6 +52,7 @@
     s/RIJNDAEL(d_key)/D_KEY/g
 */
 
+#include <crypto/aes.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/crypto.h>
 #include <asm/byteorder.h>
 
-#define AES_MIN_KEY_SIZE       16
-#define AES_MAX_KEY_SIZE       32
-
-#define AES_BLOCK_SIZE         16
-
 /*
  * #define byte(x, nr) ((unsigned char)((x) >> (nr*8))) 
  */
index fa4c9904346f5ec223da20732c2fed99ff756b8e..5008a1cddffbcae8d40c64d43640cdffdf2d6ff6 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/crypto.h>
 #include <linux/spinlock.h>
 #include <crypto/algapi.h>
+#include <crypto/aes.h>
 
 #include <asm/io.h>
 #include <asm/delay.h>
index 5f7e7181048931dfb23192d7af582d85a071aba6..c33334ac987e8053b96a00f431d2ce0c86e9e398 100644 (file)
@@ -44,6 +44,7 @@
  */
 
 #include <crypto/algapi.h>
+#include <crypto/aes.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -53,9 +54,6 @@
 #include <asm/byteorder.h>
 #include "padlock.h"
 
-#define AES_MIN_KEY_SIZE       16      /* in uint8_t units */
-#define AES_MAX_KEY_SIZE       32      /* ditto */
-#define AES_BLOCK_SIZE         16      /* ditto */
 #define AES_EXTENDED_KEY_SIZE  64      /* in uint32_t units */
 #define AES_EXTENDED_KEY_SIZE_B        (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t))
 
diff --git a/include/crypto/aes.h b/include/crypto/aes.h
new file mode 100644 (file)
index 0000000..9ff842f
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Common values for AES algorithms
+ */
+
+#ifndef _CRYPTO_AES_H
+#define _CRYPTO_AES_H
+
+#define AES_MIN_KEY_SIZE       16
+#define AES_MAX_KEY_SIZE       32
+#define AES_KEYSIZE_128                16
+#define AES_KEYSIZE_192                24
+#define AES_KEYSIZE_256                32
+#define AES_BLOCK_SIZE         16
+
+#endif