diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-03-13 10:45:41 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-03-13 10:45:41 +0000 |
commit | 15b6cae245d110e91d465493276eabdc05e39cb0 (patch) | |
tree | 1a0498d591b06f84b9e3de64439a718b8414655c /libavutil/sha1.c | |
parent | 476f9b74ec21eaae467d20732aab75b8cdc4c75b (diff) | |
download | ffmpeg-15b6cae245d110e91d465493276eabdc05e39cb0.tar.gz |
dont memcpy() simpler and same speed
Originally committed as revision 8377 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/sha1.c')
-rw-r--r-- | libavutil/sha1.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavutil/sha1.c b/libavutil/sha1.c index 27fe805262..a8e2bd2c7d 100644 --- a/libavutil/sha1.c +++ b/libavutil/sha1.c @@ -14,7 +14,7 @@ typedef struct AVSHA1 { #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define blk0(i) (block[i] = be2me_32(block[i])) +#define blk0(i) (block[i] = be2me_32(((uint32_t*)buffer)[i])) #define blk(i) (block[i] = rol(block[i-3]^block[i-8]^block[i-14]^block[i-16],1)) #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y) +blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); @@ -32,8 +32,6 @@ static void transform(uint32_t state[5], uint8_t buffer[64]){ unsigned int i; unsigned int a, b, c, d, e; - memcpy(block, buffer, 64); - a = state[0]; b = state[1]; c = state[2]; |