Differences From Artifact [dc13eea305]:
- File tests/ScryptTests.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 8418) [annotate] [blame] [check-ins using] [more...]
To Artifact [b2b1c50b4e]:
- File
tests/ScryptTests.m
— part of check-in
[63f5276b33]
at
2020-06-21 22:08:00
on branch trunk
— Move parameters for of_scrypt() to a struct
This should make it more readable for such a large number of parameters. (user: js, size: 9600) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
152 153 154 155 156 157 158 | TEST(@"ROMix", R(memcpy(ROMixBuffer, ROMixInput, 128)) && R(of_scrypt_romix(ROMixBuffer, 1, 16, ROMixTmp)) && memcmp(ROMixBuffer, ROMixOutput, 128) == 0) TEST(@"scrypt test vector #1", | > > > > | > > > > > > | > > > > | > > > > > > | > > > > | > | > > > > | > > > > | > | > > > > | | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 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 | TEST(@"ROMix", R(memcpy(ROMixBuffer, ROMixInput, 128)) && R(of_scrypt_romix(ROMixBuffer, 1, 16, ROMixTmp)) && memcmp(ROMixBuffer, ROMixOutput, 128) == 0) TEST(@"scrypt test vector #1", R(of_scrypt((of_scrypt_parameters_t){ .blockSize = 1, .costFactor = 16, .parallelization = 1, .salt = (unsigned char *)"", .saltLength = 0, .password = "", .passwordLength = 0, .key = output, .keyLength = 64, .allowsSwappableMemory = true })) && memcmp(output, testVector1, 64) == 0) TEST(@"scrypt test vector #2", R(of_scrypt((of_scrypt_parameters_t){ .blockSize = 8, .costFactor = 1024, .parallelization = 16, .salt = (unsigned char *)"NaCl", .saltLength = 4, .password = "password", .passwordLength = 8, .key = output, .keyLength = 64, .allowsSwappableMemory = true })) && memcmp(output, testVector2, 64) == 0) TEST(@"scrypt test vector #3", R(of_scrypt((of_scrypt_parameters_t){ .blockSize = 8, .costFactor = 16384, .parallelization = 1, .salt = (unsigned char *)"SodiumChloride", .saltLength = 14, .password = "pleaseletmein", .passwordLength = 13, .key = output, .keyLength = 64, .allowsSwappableMemory = true })) && memcmp(output, testVector3, 64) == 0) /* The forth test vector is too expensive to include it in the tests. */ #if 0 TEST(@"scrypt test vector #4", R(of_scrypt((of_scrypt_parameters_t){ .blockSize = 8, .costFactor = 1048576, .parallelization = 1, .salt = (unsigned char *)"SodiumChloride", .saltLength = 14, .password = "pleaseletmein", .passwordLength = 13, .key = output, .keyLength = 64, .allowsSwappableMemory = true })) && memcmp(output, testVector4, 64) == 0) #endif objc_autoreleasePoolPop(pool); } @end |