Differences From Artifact [f9dfdefc9d]:
- File
tests/ScryptTests.m
— part of check-in
[09be825f88]
at
2019-09-29 15:58:33
on branch trunk
— Remove OFAutoreleasePool
OFAutoreleasePools have long been discouraged in favor of the runtime's
autorelease pools. (user: js, size: 8391) [annotate] [blame] [check-ins using] [more...]
To 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...]
1 2 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, | | | | 1 2 3 4 5 6 7 8 9 10 11 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, * 2018, 2019, 2020 * Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
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 | 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(1, 16, 1, (unsigned char *)"", 0, "", 0, output, 64, true)) && memcmp(output, testVector1, 64) == 0) TEST(@"scrypt test vector #2", R(of_scrypt(8, 1024, 16, (unsigned char *)"NaCl", 4, "password", 8, output, 64, true)) && memcmp(output, testVector2, 64) == 0) TEST(@"scrypt test vector #3", R(of_scrypt(8, 16384, 1, (unsigned char *)"SodiumChloride", 14, "pleaseletmein", 13, output, 64, 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(8, 1048576, 1, (unsigned char *)"SodiumChloride", 14, "pleaseletmein", 13, output, 64, true)) && memcmp(output, testVector4, 64) == 0) #endif objc_autoreleasePoolPop(pool); } @end |