1.Dd March 22, 2007
2.Dt CCHMAC 3
3.Os
4.Sh NAME
5.Nm CCHmacInit ,
6.Nm CCHmacUpdate ,
7.Nm CCHmacFinal ,
8.Nm CCHmac
9.Nd Common HMAC Algorithm Interfaces
10.Sh LIBRARY
11These functions are found in libSystem.
12.Sh SYNOPSIS
13.In CommonCrypto/CommonHMAC.h
14.Ft void
15.Fn CCHmacInit "CCHmacContext *ctx" "CCHmacAlgorithm algorithm" "const void *key" "size_t keyLength"
16.Ft void
17.Fn CCHmacUpdate "CCHmacContext *ctx" "const void *data" "size_t dataLength"
18.Ft void
19.Fn CCHmacFinal "CCHmacContext *ctx" "void *macOut"
20.Ft void
21.Fn CCHmac "CCHmacAlgorithm algorithm" "const void *key" "size_t keyLength" "const void *data" "size_t dataLength" "void *macOut"
22.Sh DESCRIPTION
23This interface provides access to a number of HMAC
24algorithms. The following algorithms are available:
25.Bl -tag -width "kCCHmacAlgSHA224"
26.It kCCHmacAlgSHA1
27- HMAC with SHA1 digest
28.It kCCHmacAlgMD5
29- HMAC with MD5 digest
30.It kCCHmacAlgSHA256
31- HMAC with SHA256 digest
32.It kCCHmacAlgSHA384
33- HMAC with SHA384 digest
34.It kCCHmacAlgSHA224
35- HMAC with SHA224 digest
36.It kCCHmacAlgSHA512
37- HMAC with SHA512 digest
38.El
39.Pp
40The object declared in this interface, CCHmacContext, provides
41a handle for use with the
42.Fn CCHmacInit
43.Fn CCHmacUpdate
44and
45.Fn CCHmacFinal
46calls to complete the HMAC operation.  In addition there is a one shot function,
47.Fn CCHmac
48that performs a complete HMAC on a single piece of data.
49.Sh HISTORY
50These functions are available in OS X 10.5 and later.
51.Sh SEE ALSO
52.Xr CC_MD5 3cc ,
53.Xr CC_SHA 3cc ,
54.Xr CC_crypto 3cc ,
55.Xr CCCrypto 3cc
56