I am new to hmac-sha1. I have a couple of questions about the sample.
/* inputs: NSData *keyData; NSData *clearTextData */
uint8_t digest[CC_SHA1_DIGEST_LENGTH] = {0};
CCHmacContext hmacContext; CCHmacInit(&hmacContext, kCCHmacAlgSHA1, keyData.bytes, keyData.length); CCHmacUpdate(&hmacContext, clearTextData.bytes, clearTextData.length); CCHmacFinal(&hmacContext, digest);
NSData *out = [NSData dataWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];
- What is clearTextData? Is it the source string in NSData object form?
- What is kData? Is it the source data to be encoded?
- Where is the secret key? (Is that kData?)
Thank you for any help you can provide.