Differences From Artifact [23d069a3eb]:
- File src/OFHMAC.m — part of check-in [2969086342] at 2021-04-07 21:14:36 on branch trunk — Rename OFCryptoHash -> OFCryptographicHash (user: js, size: 4541) [annotate] [blame] [check-ins using] [more...]
To Artifact [2ceebc7fc2]:
- File
src/OFHMAC.m
— part of check-in
[82801897d3]
at
2022-03-25 10:22:55
on branch trunk
— OFCryptographicHash: Add -[calculate]
Before, -[digest] would do the final calculation, however, this would
mean a property modifies state, which is bad. (user: js, size: 4811) [annotate] [blame] [check-ins using] [more...]
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + + | /* |
︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | + | @try { if (length > blockSize) { id <OFCryptographicHash> hash = [_hashClass hashWithAllowsSwappableMemory: _allowsSwappableMemory]; [hash updateWithBuffer: key length: length]; [hash calculate]; length = hash.digestSize; if OF_UNLIKELY (length > blockSize) length = blockSize; memcpy(outerKeyPadItems, hash.digest, length); memcpy(innerKeyPadItems, hash.digest, length); |
︙ | |||
136 137 138 139 140 141 142 | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | - + + + + + - + - - + + + + + + + | if (_calculated) @throw [OFHashAlreadyCalculatedException exceptionWithObject: self]; [_innerHash updateWithBuffer: buffer length: length]; } |
︙ |