While trying to implement the IKE session key generation algorithms I came across the following code snippets for the following algorithm implementation Algorithm for generating a certain session key
SKEYID_e = HMAC (SKEYID, SKEYID_a || gxy || CKY-I || CKY-R || 2)
implementation to get the last concatenation HMAC of digit 2
hmac_update(ctx, (unsigned char *) "\2", 1)
here hmac_update is the API used to concatenate the buffer to get the HMAC before finalizing the digest and CTX is HMAC context "\2" is adding the digit 2 and 1 is size of the buffer.
My question is what is the difference between and escaped unsigned char *
"\2"
and a char
/uint8_t
value 2