From: Ken Raeburn Date: Thu, 9 Jun 2005 22:43:54 +0000 (+0000) Subject: * f_tables.h: Include k5-platform.h. X-Git-Tag: ms-bug-test-20060525~242 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=db604cfab8e6762248bece0edba7d87d8a48338d;p=krb5.git * f_tables.h: Include k5-platform.h. (GET_HALF_BLOCK): Use load_32_be. (PUT_HALF_BLOCK): Use store_32_be. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17231 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/des/ChangeLog b/src/lib/crypto/des/ChangeLog index 48a7cc36c..df5a9d62d 100644 --- a/src/lib/crypto/des/ChangeLog +++ b/src/lib/crypto/des/ChangeLog @@ -1,3 +1,9 @@ +2005-06-09 Ken Raeburn + + * f_tables.h: Include k5-platform.h. + (GET_HALF_BLOCK): Use load_32_be. + (PUT_HALF_BLOCK): Use store_32_be. + 2005-04-13 Ken Raeburn * d3_cbc.c (krb5int_des3_cbc_encrypt, krb5int_des3_cbc_decrypt): diff --git a/src/lib/crypto/des/f_tables.h b/src/lib/crypto/des/f_tables.h index 3ea346159..65181157a 100644 --- a/src/lib/crypto/des/f_tables.h +++ b/src/lib/crypto/des/f_tables.h @@ -14,6 +14,7 @@ #ifndef __DES_TABLES_H__ #define __DES_TABLES_H__ /* nothing */ +#include "k5-platform.h" /* * These may be declared const if you wish. Be sure to change the * declarations in des_tables.c as well. @@ -249,17 +250,8 @@ extern void krb5int_des_do_decrypt_2(unsigned DES_INT32 *l, * These are handy dandy utility thingies for straightening out bytes. * Included here because they're used a couple of places. */ -#define GET_HALF_BLOCK(lr, ip) \ - (lr) = ((unsigned DES_INT32)(*(ip)++)) << 24; \ - (lr) |= ((unsigned DES_INT32)(*(ip)++)) << 16; \ - (lr) |= ((unsigned DES_INT32)(*(ip)++)) << 8; \ - (lr) |= (unsigned DES_INT32)(*(ip)++) - -#define PUT_HALF_BLOCK(lr, op) \ - *(op)++ = (unsigned char) (((lr) >> 24) & 0xff); \ - *(op)++ = (unsigned char) (((lr) >> 16) & 0xff); \ - *(op)++ = (unsigned char) (((lr) >> 8) & 0xff); \ - *(op)++ = (unsigned char) ( (lr) & 0xff) +#define GET_HALF_BLOCK(lr, ip) ((lr) = load_32_be(ip), (ip) += 4) +#define PUT_HALF_BLOCK(lr, op) (store_32_be(lr, op), (op) += 4) /* Shorthand that we'll need in several places, for creating values that really can hold 32 bits regardless of the prevailing int size. */