aboutsummaryrefslogtreecommitdiffstats
path: root/xen/crypto/rijndael.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-03-09 16:31:00 +0000
committerJan Beulich <jbeulich@novell.com>2011-03-09 16:31:00 +0000
commitcba76631d1fc7b511facfca6449a0c1d5565fbf0 (patch)
tree566b375a761c58618a3cdb4e6e6d970c9760a735 /xen/crypto/rijndael.c
parent007f425ac5d2bc0b607fb4fb429ad92315f52de1 (diff)
downloadxen-cba76631d1fc7b511facfca6449a0c1d5565fbf0.tar.gz
xen-cba76631d1fc7b511facfca6449a0c1d5565fbf0.tar.bz2
xen-cba76631d1fc7b511facfca6449a0c1d5565fbf0.zip
move various bits into .init.* sections
This also includes the removal of some entirely unused functions. The patch builds upon the makefile adjustments done in the earlier sent patch titled "move more kernel decompression bits to .init.* sections". Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/crypto/rijndael.c')
-rw-r--r--xen/crypto/rijndael.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xen/crypto/rijndael.c b/xen/crypto/rijndael.c
index f7496187d3..b7cd0d1acd 100644
--- a/xen/crypto/rijndael.c
+++ b/xen/crypto/rijndael.c
@@ -806,6 +806,8 @@ rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits)
return 0;
}
+#ifdef NEED_RIJNDAEL_DECRYPT
+
/**
* Expand the cipher key into the decryption key schedule.
*
@@ -854,6 +856,8 @@ rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits)
return Nr;
}
+#endif /* NEED_RIJNDAEL_DECRYPT */
+
void
rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16],
u8 ct[16])
@@ -1038,6 +1042,8 @@ rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16],
PUTU32(ct + 12, s3);
}
+#ifdef NEED_RIJNDAEL_DECRYPT
+
static void
rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16],
u8 pt[16])
@@ -1222,6 +1228,10 @@ rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16],
PUTU32(pt + 12, s3);
}
+#endif /* NEED_RIJNDAEL_DECRYPT */
+
+#ifdef NEED_RIJNDAEL_WRAPPERS
+
/* setup key context for encryption only */
int
rijndael_set_key_enc_only(rijndael_ctx *ctx, const u_char *key, int bits)
@@ -1267,3 +1277,5 @@ rijndael_encrypt(rijndael_ctx *ctx, const u_char *src, u_char *dst)
{
rijndaelEncrypt(ctx->ek, ctx->Nr, src, dst);
}
+
+#endif /* NEED_RIJNDAEL_WRAPPERS */