Differences From Artifact [17bf6db694]:
- File
tests/OFHMACTests.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: 5121) [annotate] [blame] [check-ins using]
To Artifact [490f0952c5]:
- File tests/OFHMACTests.m — part of check-in [b045cbb9c7] at 2019-03-25 00:21:30 on branch trunk — tests: Use dot syntax (user: js, size: 5088) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
90 91 92 93 94 95 96 | TEST(@"-[setKey:length:] with SHA-384", R([HMAC_SHA384 setKey: key length: key_length])) TEST(@"-[setKey:length:] with SHA-512", R([HMAC_SHA512 setKey: key length: key_length])) | | | | < | | | | | | | | | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | TEST(@"-[setKey:length:] with SHA-384", R([HMAC_SHA384 setKey: key length: key_length])) TEST(@"-[setKey:length:] with SHA-512", R([HMAC_SHA512 setKey: key length: key_length])) while (!f.atEndOfStream) { char buf[64]; size_t len = [f readIntoBuffer: buf length: 64]; [HMAC_MD5 updateWithBuffer: buf length: len]; [HMAC_SHA1 updateWithBuffer: buf length: len]; [HMAC_RMD160 updateWithBuffer: buf length: len]; [HMAC_SHA256 updateWithBuffer: buf length: len]; [HMAC_SHA384 updateWithBuffer: buf length: len]; [HMAC_SHA512 updateWithBuffer: buf length: len]; } [f close]; TEST(@"-[digest] with MD5", memcmp(HMAC_MD5.digest, digest_md5, HMAC_MD5.digestSize) == 0) TEST(@"-[digest] with SHA-1", memcmp(HMAC_SHA1.digest, digest_sha1, HMAC_SHA1.digestSize) == 0) TEST(@"-[digest] with RIPEMD-160", memcmp(HMAC_RMD160.digest, digest_rmd160, HMAC_RMD160.digestSize) == 0) TEST(@"-[digest] with SHA-256", memcmp(HMAC_SHA256.digest, digest_sha256, HMAC_SHA256.digestSize) == 0) TEST(@"-[digest] with SHA-384", memcmp(HMAC_SHA384.digest, digest_sha384, HMAC_SHA384.digestSize) == 0) TEST(@"-[digest] with SHA-512", memcmp(HMAC_SHA512.digest, digest_sha512, HMAC_SHA512.digestSize) == 0) [pool drain]; } @end |