diff options
author | Ken Raeburn <raeburn@mit.edu> | 2008-08-02 06:34:51 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2008-08-02 06:34:51 +0000 |
commit | fef45697544a3855a989a321b621612aa4651f20 (patch) | |
tree | 8277e855cdcd34ba30f4c6ceb1d5821fbf44d6d8 | |
parent | c96def98b1a87c94a5be5452e8b7cfc26382a214 (diff) | |
download | krb5-fef45697544a3855a989a321b621612aa4651f20.zip krb5-fef45697544a3855a989a321b621612aa4651f20.tar.gz krb5-fef45697544a3855a989a321b621612aa4651f20.tar.bz2 |
Use GET_HALF_BLOCK to fetch new values instead of open-coding
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20598 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/crypto/des/d3_cbc.c | 13 | ||||
-rw-r--r-- | src/lib/crypto/des/f_cksum.c | 13 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/lib/crypto/des/d3_cbc.c b/src/lib/crypto/des/d3_cbc.c index 37c32c7..077e78d 100644 --- a/src/lib/crypto/des/d3_cbc.c +++ b/src/lib/crypto/des/d3_cbc.c @@ -84,14 +84,11 @@ krb5int_des3_cbc_encrypt(const mit_des_cblock *in, * forward. Otherwise we have to fart around. */ if (length >= 8) { - left ^= ((*ip++) & FF_UINT32) << 24; - left ^= ((*ip++) & FF_UINT32) << 16; - left ^= ((*ip++) & FF_UINT32) << 8; - left ^= (*ip++) & FF_UINT32; - right ^= ((*ip++) & FF_UINT32) << 24; - right ^= ((*ip++) & FF_UINT32) << 16; - right ^= ((*ip++) & FF_UINT32) << 8; - right ^= (*ip++) & FF_UINT32; + unsigned DES_INT32 temp; + GET_HALF_BLOCK(temp, ip); + left ^= temp; + GET_HALF_BLOCK(temp, ip); + right ^= temp; length -= 8; } else { /* diff --git a/src/lib/crypto/des/f_cksum.c b/src/lib/crypto/des/f_cksum.c index 1b9e9a0..a11e340 100644 --- a/src/lib/crypto/des/f_cksum.c +++ b/src/lib/crypto/des/f_cksum.c @@ -60,14 +60,11 @@ mit_des_cbc_cksum(const krb5_octet *in, krb5_octet *out, * forward. Otherwise we have to fart around. */ if (len >= 8) { - left ^= ((*ip++) & FF_UINT32) << 24; - left ^= ((*ip++) & FF_UINT32) << 16; - left ^= ((*ip++) & FF_UINT32) << 8; - left ^= (*ip++) & FF_UINT32; - right ^= ((*ip++) & FF_UINT32) << 24; - right ^= ((*ip++) & FF_UINT32) << 16; - right ^= ((*ip++) & FF_UINT32) << 8; - right ^= (*ip++) & FF_UINT32; + unsigned DES_INT32 temp; + GET_HALF_BLOCK(temp, ip); + left ^= temp; + GET_HALF_BLOCK(temp, ip); + right ^= temp; len -= 8; } else { /* |