Mercurial > masqmail
diff src/md5/hmac_md5.c @ 367:b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
Now we use:
/*
** comment
*/
This makes the indent style simpler, too.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Thu, 20 Oct 2011 10:20:59 +0200 |
parents | 41958685480d |
children |
line wrap: on
line diff
--- a/src/md5/hmac_md5.c Thu Sep 22 15:07:40 2011 +0200 +++ b/src/md5/hmac_md5.c Thu Oct 20 10:20:59 2011 +0200 @@ -1,30 +1,30 @@ /* -hmac_md5 -- implements RFC 2104 - -Copyright 2010, markus schnalke <meillo@marmaro.de> - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - -My motivation to write this code was the lack of a nicely licensed -hmac_md5 function in C. I programmed it following the RFC's text. -Obviously this code is highly similar to the sample code of the RFC. -The code is tested against the test vectors of the RFC. Wikipedia's -HMAC page helped me to understand the algorithm better. - -This hmac_md5 function requires an OpenSSL-compatible MD5 -implementation. There are Public Domain MD5 implementations by Colin -Plumb and by Solar Designer. You probably want to use one of these. +** hmac_md5 -- implements RFC 2104 +** +** Copyright 2010, markus schnalke <meillo@marmaro.de> +** +** Permission to use, copy, modify, and/or distribute this software for any +** purpose with or without fee is hereby granted, provided that the above +** copyright notice and this permission notice appear in all copies. +** +** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +** ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +** WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +** ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +** +** +** My motivation to write this code was the lack of a nicely licensed +** hmac_md5 function in C. I programmed it following the RFC's text. +** Obviously this code is highly similar to the sample code of the RFC. +** The code is tested against the test vectors of the RFC. Wikipedia's +** HMAC page helped me to understand the algorithm better. +** +** This hmac_md5 function requires an OpenSSL-compatible MD5 +** implementation. There are Public Domain MD5 implementations by Colin +** Plumb and by Solar Designer. You probably want to use one of these. */ #include <string.h> @@ -36,11 +36,12 @@ /* -The computed HMAC will be written to `digest'. -Ensure digest points to hashsize bytes of allocated memory. +** The computed HMAC will be written to `digest'. +** Ensure digest points to hashsize bytes of allocated memory. */ void -hmac_md5(unsigned char *text, int textlen, unsigned char *key, int keylen, unsigned char *digest) +hmac_md5(unsigned char *text, int textlen, unsigned char *key, int keylen, + unsigned char *digest) { int i; MD5_CTX context;