Differences From 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]
To Artifact [8c6a093adf]:
- File
src/OFMD5Hash.m
— part of check-in
[46af1252a5]
at
2014-09-01 11:08:43
on branch trunk
— Add OFSHA256Hash
Took me some time to figure out the RFC is buggy and SSIG0(t-15) should
be SSIG0(W(t-15))... (user: js, size: 4648) [annotate] [blame] [check-ins using]
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - + | #import "OFHashAlreadyCalculatedException.h" #define F(a, b, c) (((a) & (b)) | (~(a) & (c))) #define G(a, b, c) (((a) & (c)) | ((b) & ~(c))) #define H(a, b, c) ((a) ^ (b) ^ (c)) #define I(a, b, c) ((b) ^ ((a) | ~(c))) |
︙ | |||
88 89 90 91 92 93 94 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | - + | const uint_fast8_t a = (4 - (i & 3)) & 3; \ const uint_fast8_t b = (a + 1) & 3; \ const uint_fast8_t c = (a + 2) & 3; \ const uint_fast8_t d = (a + 3) & 3; \ const uint_fast8_t r = rotateBits[(i % 4) + (i / 16) * 4]; \ \ new[a] += f(new[b], new[c], new[d]) + \ |
︙ |