From 3cd15d775374ff6b83c75e6c675cc62e8abfb1f5 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 12 Aug 2008 21:28:30 +0000 Subject: [PATCH] If CONFIG_SMALL_NO_CRYPTO is defined, turn off CONFIG_SMALL changes for crypto code only git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20648 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/aes/aesopt.h | 14 +++++++------- src/lib/crypto/des/f_cbc.c | 2 +- src/lib/crypto/des/f_tables.h | 2 +- src/lib/crypto/md4/md4.c | 2 +- src/lib/crypto/md5/md5.c | 2 +- src/lib/crypto/sha1/shs.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib/crypto/aes/aesopt.h b/src/lib/crypto/aes/aesopt.h index e7f3efa78..006fbb3eb 100644 --- a/src/lib/crypto/aes/aesopt.h +++ b/src/lib/crypto/aes/aesopt.h @@ -371,7 +371,7 @@ unrolling. The following options allow partial or full loop unrolling to be set independently for encryption and decryption */ -#if !defined(CONFIG_SMALL) +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) #define ENC_UNROLL FULL #elif 0 #define ENC_UNROLL PARTIAL @@ -379,7 +379,7 @@ #define ENC_UNROLL NONE #endif -#if !defined(CONFIG_SMALL) +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) #define DEC_UNROLL FULL #elif 0 #define DEC_UNROLL PARTIAL @@ -464,7 +464,7 @@ of tables used by this implementation. */ -#if !defined(CONFIG_SMALL) /* set tables for the normal encryption round */ +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) /* set tables for the normal encryption round */ #define ENC_ROUND FOUR_TABLES #elif 0 #define ENC_ROUND ONE_TABLE @@ -472,7 +472,7 @@ #define ENC_ROUND NO_TABLES #endif -#if !defined(CONFIG_SMALL) /* set tables for the last encryption round */ +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) /* set tables for the last encryption round */ #define LAST_ENC_ROUND FOUR_TABLES #elif 0 #define LAST_ENC_ROUND ONE_TABLE @@ -480,7 +480,7 @@ #define LAST_ENC_ROUND NO_TABLES #endif -#if !defined(CONFIG_SMALL) /* set tables for the normal decryption round */ +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) /* set tables for the normal decryption round */ #define DEC_ROUND FOUR_TABLES #elif 0 #define DEC_ROUND ONE_TABLE @@ -488,7 +488,7 @@ #define DEC_ROUND NO_TABLES #endif -#if !defined(CONFIG_SMALL) /* set tables for the last decryption round */ +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) /* set tables for the last decryption round */ #define LAST_DEC_ROUND FOUR_TABLES #elif 0 #define LAST_DEC_ROUND ONE_TABLE @@ -500,7 +500,7 @@ way that the round functions can. Include or exclude the following defines to set this requirement. */ -#if !defined(CONFIG_SMALL) +#if !defined(CONFIG_SMALL) || defined(CONFIG_SMALL_NO_CRYPTO) #define KEY_SCHED FOUR_TABLES #elif 0 #define KEY_SCHED ONE_TABLE diff --git a/src/lib/crypto/des/f_cbc.c b/src/lib/crypto/des/f_cbc.c index 36c4a084f..0949ba140 100644 --- a/src/lib/crypto/des/f_cbc.c +++ b/src/lib/crypto/des/f_cbc.c @@ -257,7 +257,7 @@ krb5int_des_cbc_decrypt(const mit_des_cblock *in, } } -#ifdef CONFIG_SMALL +#if defined(CONFIG_SMALL) && !defined(CONFIG_SMALL_NO_CRYPTO) void krb5int_des_do_encrypt_2 (unsigned DES_INT32 *left, unsigned DES_INT32 *right, const unsigned DES_INT32 *kp) diff --git a/src/lib/crypto/des/f_tables.h b/src/lib/crypto/des/f_tables.h index 28c30fcc3..45a6322fe 100644 --- a/src/lib/crypto/des/f_tables.h +++ b/src/lib/crypto/des/f_tables.h @@ -251,7 +251,7 @@ extern const unsigned DES_INT32 des_SP_table[8][64]; DES_FINAL_PERM((left), (right), (temp2)); \ } while (0) -#ifdef CONFIG_SMALL +#if defined(CONFIG_SMALL) && !defined(CONFIG_SMALL_NO_CRYPTO) extern void krb5int_des_do_encrypt_2(unsigned DES_INT32 *l, unsigned DES_INT32 *r, const unsigned DES_INT32 *k); diff --git a/src/lib/crypto/md4/md4.c b/src/lib/crypto/md4/md4.c index d1da9ef0c..7922c71ed 100644 --- a/src/lib/crypto/md4/md4.c +++ b/src/lib/crypto/md4/md4.c @@ -156,7 +156,7 @@ static void Transform (krb5_ui_4 *buf, krb5_ui_4 *in) { register krb5_ui_4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; -#ifdef CONFIG_SMALL +#if defined(CONFIG_SMALL) && !defined(CONFIG_SMALL_NO_CRYPTO) int i; #define ROTATE { krb5_ui_4 temp; temp = d, d = c, c = b, b = a, a = temp; } for (i = 0; i < 16; i++) { diff --git a/src/lib/crypto/md5/md5.c b/src/lib/crypto/md5/md5.c index da8aca451..e548dbc3a 100644 --- a/src/lib/crypto/md5/md5.c +++ b/src/lib/crypto/md5/md5.c @@ -192,7 +192,7 @@ static void Transform (krb5_ui_4 *buf, krb5_ui_4 *in) { register krb5_ui_4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; -#ifdef CONFIG_SMALL +#if defined(CONFIG_SMALL) && !defined(CONFIG_SMALL_NO_CRYPTO) int i; #define ROTATE { krb5_ui_4 temp; temp = d, d = c, c = b, b = a, a = temp; } diff --git a/src/lib/crypto/sha1/shs.c b/src/lib/crypto/sha1/shs.c index 0089055d7..61f5d2f73 100644 --- a/src/lib/crypto/sha1/shs.c +++ b/src/lib/crypto/sha1/shs.c @@ -112,7 +112,7 @@ void SHSTransform(SHS_LONG *digest, const SHS_LONG *data) E = digest[ 4 ]; memcpy(eData, data, sizeof (eData)); -#ifdef CONFIG_SMALL +#if defined(CONFIG_SMALL) && !defined(CONFIG_SMALL_NO_CRYPTO) { int i; -- 2.26.2