Differences From Artifact [c9c8fa689f]:
- File
src/OFRIPEMD160Hash.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 5930) [annotate] [blame] [check-ins using]
To Artifact [eb95ce0800]:
- File
src/OFRIPEMD160Hash.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 5934) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
178 179 180 181 182 183 184 | _state[0] = 0x67452301; _state[1] = 0xEFCDAB89; _state[2] = 0x98BADCFE; _state[3] = 0x10325476; _state[4] = 0xC3D2E1F0; } | | | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | _state[0] = 0x67452301; _state[1] = 0xEFCDAB89; _state[2] = 0x98BADCFE; _state[3] = 0x10325476; _state[4] = 0xC3D2E1F0; } - (void)updateWithBuffer: (const void *)buffer_ length: (size_t)length { const uint8_t *buffer = buffer_; if (_calculated) @throw [OFHashAlreadyCalculatedException exceptionWithObject: self]; |
︙ | ︙ | |||
208 209 210 211 212 213 214 | if (_bufferLength == 64) { processBlock(_state, _buffer.words); _bufferLength = 0; } } } | | | | | 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | if (_bufferLength == 64) { processBlock(_state, _buffer.words); _bufferLength = 0; } } } - (const unsigned char *)digest { if (_calculated) return (const uint8_t *)_state; _buffer.bytes[_bufferLength] = 0x80; memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1); if (_bufferLength >= 56) { processBlock(_state, _buffer.words); memset(_buffer.bytes, 0, 64); } _buffer.words[14] = OF_BSWAP32_IF_BE((uint32_t)(_bits & 0xFFFFFFFF)); _buffer.words[15] = OF_BSWAP32_IF_BE((uint32_t)(_bits >> 32)); processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfBE(_state, 5); _calculated = true; return (const uint8_t *)_state; } - (void)reset { [self OF_resetState]; _bits = 0; memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } @end |