Differences From Artifact [bf0f4f5521]:
- File src/scrypt.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 6197) [annotate] [blame] [check-ins using] [more...]
To Artifact [42e8413fd6]:
- File
src/scrypt.m
— part of check-in
[b9641347e3]
at
2020-06-21 21:30:23
on branch trunk
— Move parameters for of_pbkdf2() to a struct
This should make it more readable for such a large number of parameters. (user: js, size: 6525) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
181 182 183 184 185 186 187 | allowsSwappableMemory: allowsSwappableMemory]; bufferItems = buffer.mutableItems; HMAC = [[OFHMAC alloc] initWithHashClass: [OFSHA256Hash class] allowsSwappableMemory: allowsSwappableMemory]; | > > > > > > | | | > > > > > | | > > > > | > | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | allowsSwappableMemory: allowsSwappableMemory]; bufferItems = buffer.mutableItems; HMAC = [[OFHMAC alloc] initWithHashClass: [OFSHA256Hash class] allowsSwappableMemory: allowsSwappableMemory]; of_pbkdf2((of_pbkdf2_parameters_t){ .HMAC = HMAC, .iterations = 1, .salt = salt, .saltLength = saltLength, .password = password, .passwordLength = passwordLength, .key = (unsigned char *)bufferItems, .keyLength = parallelization * 128 * blockSize, .allowsSwappableMemory = allowsSwappableMemory }); for (size_t i = 0; i < parallelization; i++) of_scrypt_romix(bufferItems + i * 32 * blockSize, blockSize, costFactor, tmpItems); of_pbkdf2((of_pbkdf2_parameters_t){ .HMAC = HMAC, .iterations = 1, .salt = (unsigned char *)bufferItems, .saltLength = parallelization * 128 * blockSize, .password = password, .passwordLength = passwordLength, .key = key, .keyLength = keyLength, .allowsSwappableMemory = allowsSwappableMemory }); } @finally { [tmp release]; [buffer release]; [HMAC release]; } } |