Differences From Artifact [7299afd4f0]:
- File
tests/PBKDF2Tests.m
— part of check-in
[dc0c6c34ab]
at
2019-02-17 22:44:23
on branch trunk
— tests: Only import ObjFW.h
This prevents forgetting to add an import to ObjFW.h, as the tests would
then not compile. (user: js, size: 2631) [annotate] [blame] [check-ins using]
To Artifact [390e84b82b]:
- File
tests/PBKDF2Tests.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: 2629) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
22 23 24 25 26 27 28 | #import "TestsAppDelegate.h" static OFString *module = @"PBKDF2"; @implementation TestsAppDelegate (PBKDF2Tests) - (void)PBKDF2Tests { | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #import "TestsAppDelegate.h" static OFString *module = @"PBKDF2"; @implementation TestsAppDelegate (PBKDF2Tests) - (void)PBKDF2Tests { void *pool = objc_autoreleasePoolPush(); OFHMAC *HMAC = [OFHMAC HMACWithHashClass: [OFSHA1Hash class]]; unsigned char key[25]; /* Test vectors from RFC 6070 */ TEST(@"PBKDF2-SHA1, 1 iteration", R(of_pbkdf2(HMAC, 1, (unsigned char *)"salt", 4, "password", 8, key, |
︙ | ︙ | |||
68 69 70 71 72 73 74 | TEST(@"PBKDF2-SHA1, 4096 iterations, key < 1 block", R(of_pbkdf2(HMAC, 4096, (unsigned char *)"sa\0lt", 5, "pass\0word", 9, key, 16)) && memcmp(key, "\x56\xFA\x6A\xA7\x55\x48\x09\x9D\xCC\x37\xD7\xF0\x34" "\x25\xE0\xC3", 16) == 0) | | | 68 69 70 71 72 73 74 75 76 77 | TEST(@"PBKDF2-SHA1, 4096 iterations, key < 1 block", R(of_pbkdf2(HMAC, 4096, (unsigned char *)"sa\0lt", 5, "pass\0word", 9, key, 16)) && memcmp(key, "\x56\xFA\x6A\xA7\x55\x48\x09\x9D\xCC\x37\xD7\xF0\x34" "\x25\xE0\xC3", 16) == 0) objc_autoreleasePoolPop(pool); } @end |