From: Greg Hudson Date: Wed, 8 Sep 2010 03:48:05 +0000 (+0000) Subject: Don't build the built-in Camellia block cipher code if Camellia-CCM X-Git-Tag: krb5-1.9-beta1~103 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a589314c0b42ad79cbca14c6fd379f5dc72bb7d3;p=krb5.git Don't build the built-in Camellia block cipher code if Camellia-CCM enctypes aren't enabled. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24297 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/builtin/camellia/camellia-gen.c b/src/lib/crypto/builtin/camellia/camellia-gen.c index 1446d779e..bbe64d039 100644 --- a/src/lib/crypto/builtin/camellia/camellia-gen.c +++ b/src/lib/crypto/builtin/camellia/camellia-gen.c @@ -8,6 +8,8 @@ #include #include "camellia.h" +#ifdef CAMELLIA_CCM + #define B 16U unsigned char key[16]; unsigned char test_case_len[] = { B+1, 2*B-1, 2*B, 2*B+1, 3*B-1, 3*B, 4*B, }; @@ -314,14 +316,18 @@ static void cts_test () printf ("\n"); } +#endif /* CAMELLIA_CCM */ + int main () { +#ifdef CAMELLIA_CCM init (); fips_test (); ecb_test(); cbc_test(); cts_test(); +#endif return 0; } diff --git a/src/lib/crypto/builtin/camellia/camellia.c b/src/lib/crypto/builtin/camellia/camellia.c index 57b2e3642..1b8cc46dd 100644 --- a/src/lib/crypto/builtin/camellia/camellia.c +++ b/src/lib/crypto/builtin/camellia/camellia.c @@ -36,6 +36,8 @@ #include "camellia.h" +#ifdef CAMELLIA_CCM + /* key constants */ #define CAMELLIA_SIGMA1L (0xA09E667FL) @@ -1537,3 +1539,5 @@ camellia_dec_blk(const unsigned char in_blk[], unsigned char out_blk[], Camellia_DecryptBlock(cx->keybitlen, in_blk, cx->k_sch, out_blk); return camellia_good; } + +#endif /* CAMELLIA_CCM */