diff --git a/SignalServiceKit/src/Util/Cryptography.m b/SignalServiceKit/src/Util/Cryptography.m index f82658f70..234a6d398 100755 --- a/SignalServiceKit/src/Util/Cryptography.m +++ b/SignalServiceKit/src/Util/Cryptography.m @@ -257,7 +257,7 @@ const NSUInteger kAES256_KeyByteLength = 32; withHMACKey:(NSData *)HMACKey truncation:(NSUInteger)truncation { - OWSAssert(truncation >= CC_SHA1_DIGEST_LENGTH); + OWSAssert(truncation <= CC_SHA1_DIGEST_LENGTH); return [[Cryptography computeSHA1HMAC:dataToHMAC withHMACKey:HMACKey] subdataWithRange:NSMakeRange(0, truncation)]; } @@ -266,7 +266,7 @@ const NSUInteger kAES256_KeyByteLength = 32; withHMACKey:(NSData *)HMACKey truncation:(NSUInteger)truncation { - OWSAssert(truncation >= CC_SHA256_DIGEST_LENGTH); + OWSAssert(truncation <= CC_SHA256_DIGEST_LENGTH); return [[Cryptography computeSHA256HMAC:dataToHMAC withHMACKey:HMACKey] subdataWithRange:NSMakeRange(0, truncation)];