Differences From Artifact [307a03b74d]:
- File
src/OFMD5Hash.m
— part of check-in
[c4d2f177cb]
at
2014-08-31 17:59:11
on branch trunk
— Rewrite OFMD5Hash
The old one was based on a public domain implementation, which is
optimized for old compilers and quite unreadable. The new one is written
from scratch and designed to be readable and to exploit optimizations of
modern compilers. (user: js, size: 4615) [annotate] [blame] [check-ins using]
To Artifact [210a4456e6]:
- File
src/OFMD5Hash.m
— part of check-in
[23dc2c7ff8]
at
2014-09-01 10:47:15
on branch trunk
— OF{MD5,SHA1}Hash: Zero _buffer when done
This way, possibly sensitive information is discarded from memory as
soon as possible. (user: js, size: 4654) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | 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); byteSwapVectorIfBE(_state, 4); _calculated = true; return (const uint8_t*)_state; } - (bool)isCalculated { return _calculated; } @end | > | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | 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, 4); _calculated = true; return (const uint8_t*)_state; } - (bool)isCalculated { return _calculated; } @end |