| 178 | } |
| 179 | |
| 180 | void CSHA1::Finalize(unsigned char hash[OUTPUT_SIZE]) |
| 181 | { |
| 182 | static const unsigned char pad[64] = {0x80}; |
| 183 | unsigned char sizedesc[8]; |
| 184 | WriteBE64(sizedesc, bytes << 3); |
| 185 | Write(pad, 1 + ((119 - (bytes % 64)) % 64)); |
| 186 | Write(sizedesc, 8); |
| 187 | WriteBE32(hash, s[0]); |
| 188 | WriteBE32(hash + 4, s[1]); |
| 189 | WriteBE32(hash + 8, s[2]); |
| 190 | WriteBE32(hash + 12, s[3]); |
| 191 | WriteBE32(hash + 16, s[4]); |
| 192 | } |
| 193 | |
| 194 | CSHA1& CSHA1::Reset() |
| 195 | { |