| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: hmac.3,v 1.1 2016/07/01 22:41:39 christos Exp $ | | 1 | .\" $NetBSD: hmac.3,v 1.2 2016/07/01 22:56:06 christos Exp $ |
2 | .\" | | 2 | .\" |
3 | .Dd July 1, 2016 | | 3 | .Dd July 1, 2016 |
4 | .Dt HMAC 3 | | 4 | .Dt HMAC 3 |
5 | .Os | | 5 | .Os |
6 | .Sh NAME | | 6 | .Sh NAME |
7 | .Nm hmac , | | 7 | .Nm hmac , |
8 | .Nd Compute a key-Hash Message Authentication Code | | 8 | .Nd Compute a key-Hash Message Authentication Code |
9 | .Sh LIBRARY | | 9 | .Sh LIBRARY |
10 | .Lb libc | | 10 | .Lb libc |
11 | .Sh SYNOPSIS | | 11 | .Sh SYNOPSIS |
12 | .In stdlib.h | | 12 | .In stdlib.h |
13 | .Ft ssize_t | | 13 | .Ft ssize_t |
14 | .Fn hmac "const char *hname" "const void *key" "size_t klen" "const void *text" "size_t tlen" "void *digest" "size_t dlen" | | 14 | .Fn hmac "const char *hname" "const void *key" "size_t klen" "const void *text" "size_t tlen" "void *digest" "size_t dlen" |
| @@ -19,33 +19,35 @@ function computes the key-Hash Message A | | | @@ -19,33 +19,35 @@ function computes the key-Hash Message A |
19 | .%R RFC 2104 | | 19 | .%R RFC 2104 |
20 | and places the result in | | 20 | and places the result in |
21 | .Fa digest | | 21 | .Fa digest |
22 | writing up to | | 22 | writing up to |
23 | .Fa dlen | | 23 | .Fa dlen |
24 | bytes. | | 24 | bytes. |
25 | The actual number of bytes that would be written is returned. | | 25 | The actual number of bytes that would be written is returned. |
26 | .Pp | | 26 | .Pp |
27 | The hash functions supported are: md2, md4, md5, rmd160, sha1, sha224, | | 27 | The hash functions supported are: md2, md4, md5, rmd160, sha1, sha224, |
28 | sha256, sha384, sha512. | | 28 | sha256, sha384, sha512. |
29 | .Sh RETURN VALUES | | 29 | .Sh RETURN VALUES |
30 | The | | 30 | The |
31 | .Fn hmac | | 31 | .Fn hmac |
32 | return | | 32 | returns |
33 | .Dv -1 | | 33 | .Dv -1 |
34 | if the | | 34 | if the |
35 | .Fa hname | | 35 | .Fa hname |
36 | is not found | | 36 | is not found. |
37 | and the length of the digest string which is dependend on the hashing | | 37 | Otherwise the actual length of the digest string is returned (which could |
38 | function. | | 38 | be bigger or smaller than |
| | | 39 | .Fa dlen ) . |
| | | 40 | This length depends on the hashing function selected. |
39 | .Sh SEE ALSO | | 41 | .Sh SEE ALSO |
40 | .Xr md2 3 , | | 42 | .Xr md2 3 , |
41 | .Xr md4 3 , | | 43 | .Xr md4 3 , |
42 | .Xr md5 3 , | | 44 | .Xr md5 3 , |
43 | .Xr rmd160 3 , | | 45 | .Xr rmd160 3 , |
44 | .Xr sha1 3 , | | 46 | .Xr sha1 3 , |
45 | .Xr sha2 3 | | 47 | .Xr sha2 3 |
46 | .Sh STANDARDS | | 48 | .Sh STANDARDS |
47 | .%R RFC 2104 | | 49 | .%R RFC 2104 |
48 | .Sh NOTES | | 50 | .Sh NOTES |
49 | The maximum digest length has been extended from | | 51 | The maximum digest length has been extended from |
50 | .Dv 64 | | 52 | .Dv 64 |
51 | to | | 53 | to |