Differences From Artifact [61d6c59846]:
- File
src/OFSHA1Hash.m
— part of check-in
[d310aeee30]
at
2014-08-31 17:59:31
on branch trunk
— Rewrite OFSHA1Hash
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: 3537) [annotate] [blame] [check-ins using]
To Artifact [20f00e8f54]:
- File
src/OFSHA1Hash.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: 3576) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | memset(_buffer.bytes, 0, 64); } _buffer.words[14] = OF_BSWAP32_IF_LE((uint32_t)(_bits >> 32)); _buffer.words[15] = OF_BSWAP32_IF_LE((uint32_t)(_bits & 0xFFFFFFFF)); processBlock(_state, _buffer.words); byteSwapVectorIfLE(_state, 5); _calculated = true; return (const uint8_t*)_state; } - (bool)isCalculated { return _calculated; } @end | > | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | memset(_buffer.bytes, 0, 64); } _buffer.words[14] = OF_BSWAP32_IF_LE((uint32_t)(_bits >> 32)); _buffer.words[15] = OF_BSWAP32_IF_LE((uint32_t)(_bits & 0xFFFFFFFF)); processBlock(_state, _buffer.words); memset(&_buffer, 0, sizeof(_buffer)); byteSwapVectorIfLE(_state, 5); _calculated = true; return (const uint8_t*)_state; } - (bool)isCalculated { return _calculated; } @end |