diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-03-13 10:40:59 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-03-13 10:40:59 +0000 |
commit | 476f9b74ec21eaae467d20732aab75b8cdc4c75b (patch) | |
tree | b2396d72dfff158f4f170631fdf3e104f5988bca /libavutil | |
parent | f6a3477bb505ef048ecb191dce4badc140fc0bc5 (diff) | |
download | ffmpeg-476f9b74ec21eaae467d20732aab75b8cdc4c75b.tar.gz |
simplify
Originally committed as revision 8376 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/sha1.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavutil/sha1.c b/libavutil/sha1.c index 8998a23c58..27fe805262 100644 --- a/libavutil/sha1.c +++ b/libavutil/sha1.c @@ -32,15 +32,7 @@ static void transform(uint32_t state[5], uint8_t buffer[64]){ unsigned int i; unsigned int a, b, c, d, e; -#if defined (VARIANT2) - for(i=0; i<16; i++) - block[i]= be2me_32(((uint32_t*)buffer)[i]); - for(;i<80; i++) - block[i]= rol(block[i-3]^block[i-8]^block[i-14]^block[i-16],1); -#else memcpy(block, buffer, 64); -#endif - a = state[0]; b = state[1]; @@ -49,7 +41,11 @@ static void transform(uint32_t state[5], uint8_t buffer[64]){ e = state[4]; #ifdef VARIANT2 for(i=0; i<80; i++){ - int t= e+block[i]+rol(a,5); + int t; + if(i<16) t= be2me_32(((uint32_t*)buffer)[i]); + else t= rol(block[i-3]^block[i-8]^block[i-14]^block[i-16],1); + block[i]= t; + t+= e+rol(a,5); if(i<40){ if(i<20) t+= ((b&(c^d))^d) +0x5A827999; else t+= ( b^c ^d) +0x6ED9EBA1; |