The Security services API doesn’t appear to allow me to compute a hash directly. There are plenty of public domain and liberally licensed versions available, but I’d rather use a system library implementation if possible.
The data is accessible via NSData, or plain pointers.
The cryptographic strength of the hash is important to me. SHA-256 is the minimum acceptable hash size.
This is what I’m using for SHA1:
Replace
CC_SHA1withCC_SHA256(or whichever you need), as well asCC_SHA1_DIGEST_LENGTHwithCC_SHA256_DIGEST_LENGTH.