Revision 3884689b libavutil/sha1.c

View differences:

libavutil/sha1.c
13 13

  
14 14
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
15 15

  
16
/* blk0() and blk() perform the initial expand. */
17
/* I got the idea of expanding during the round function from SSLeay */
18
#define blk0(i) (block[i])
19 16
#define blk(i) (block[i])
20 17

  
21 18
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
22
#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)    +blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
23
#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)    +blk (i)+0x5A827999+rol(v,5);w=rol(w,30);
19
#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)    +blk (i)+0x5A827999+rol(v,5);w=rol(w,30);
24 20
#define R2(v,w,x,y,z,i) z+=( w^x     ^y)    +blk (i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
25 21
#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk (i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
26 22
#define R4(v,w,x,y,z,i) z+=( w^x     ^y)    +blk (i)+0xCA62C1D6+rol(v,5);w=rol(w,30);

Also available in: Unified diff