Mercurial > libavutil.hg
changeset 307:c5ee81be1e16 libavutil
dont memcpy() simpler and same speed
author | michael |
---|---|
date | Tue, 13 Mar 2007 10:45:41 +0000 |
parents | d66e1c3838d7 |
children | 66948d7cef8a |
files | sha1.c |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/sha1.c Tue Mar 13 10:40:59 2007 +0000 +++ b/sha1.c Tue Mar 13 10:45:41 2007 +0000 @@ -14,7 +14,7 @@ #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 @@ unsigned int i; unsigned int a, b, c, d, e; - memcpy(block, buffer, 64); - a = state[0]; b = state[1]; c = state[2];