Mercurial > libavutil.hg
comparison sha1.c @ 751:e426c6e3a78a libavutil
Rename function to sha1_transform so it won't be confused with SHA-2 transform
when it's added.
author | kostya |
---|---|
date | Thu, 09 Jul 2009 07:29:03 +0000 |
parents | 88d366bd895e |
children |
comparison
equal
deleted
inserted
replaced
750:88d366bd895e | 751:e426c6e3a78a |
---|---|
47 #define R3(v,w,x,y,z,i) z += (((w|x)&y)|(w&x)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30); | 47 #define R3(v,w,x,y,z,i) z += (((w|x)&y)|(w&x)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30); |
48 #define R4(v,w,x,y,z,i) z += ( w^x ^y) + blk (i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30); | 48 #define R4(v,w,x,y,z,i) z += ( w^x ^y) + blk (i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30); |
49 | 49 |
50 /* Hash a single 512-bit block. This is the core of the algorithm. */ | 50 /* Hash a single 512-bit block. This is the core of the algorithm. */ |
51 | 51 |
52 static void transform(uint32_t state[5], const uint8_t buffer[64]) | 52 static void sha1_transform(uint32_t state[5], const uint8_t buffer[64]) |
53 { | 53 { |
54 uint32_t block[80]; | 54 uint32_t block[80]; |
55 unsigned int i, a, b, c, d, e; | 55 unsigned int i, a, b, c, d, e; |
56 | 56 |
57 a = state[0]; | 57 a = state[0]; |
132 ctx->state[0] = 0x67452301; | 132 ctx->state[0] = 0x67452301; |
133 ctx->state[1] = 0xEFCDAB89; | 133 ctx->state[1] = 0xEFCDAB89; |
134 ctx->state[2] = 0x98BADCFE; | 134 ctx->state[2] = 0x98BADCFE; |
135 ctx->state[3] = 0x10325476; | 135 ctx->state[3] = 0x10325476; |
136 ctx->state[4] = 0xC3D2E1F0; | 136 ctx->state[4] = 0xC3D2E1F0; |
137 ctx->transform = transform; | 137 ctx->transform = sha1_transform; |
138 ctx->count = 0; | 138 ctx->count = 0; |
139 } | 139 } |
140 | 140 |
141 void av_sha1_update(AVSHA1* ctx, const uint8_t* data, unsigned int len) | 141 void av_sha1_update(AVSHA1* ctx, const uint8_t* data, unsigned int len) |
142 { | 142 { |