seb-m / CryptoPill

Core Secret's crypto code.
coresecret.io
Other
21 stars 3 forks source link

Use an assert instead of returning nil in hmacSha256WithKey #2

Closed gabriel closed 10 years ago

gabriel commented 10 years ago

Instead of returning nil in hmacSha256WithKey if item is not NSData, probably better to do an assert?

https://github.com/seb-m/CryptoPill/blob/master/CryptoPill/common/NSArray%2BHMAC.m#L26

NSAssert([item isKindOfClass:[NSData class]], @"Item must be an NSData");

seb-m commented 10 years ago

Hi Gabriel,

I think you're right, using an NSAssert is totally appropriate in this case. I've just committed your change 79cb215fe228f7d2869dc0d5aebb32dc8f82a42f. Thanks.