#include <config.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include "md5.h"Defines | |
| #define | rol(x, n) ( ((x) << (n)) | ((x) >> (32-(n))) ) |
| md5.c - MD5 Message-Digest Algorithm Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc. | |
| #define | FF(b, c, d) (d ^ (b & (c ^ d))) |
| #define | FG(b, c, d) FF (d, b, c) |
| #define | FH(b, c, d) (b ^ c ^ d) |
| #define | FI(b, c, d) (c ^ (b | ~d)) |
| #define | OP(a, b, c, d, s, T) |
| #define | OP(f, a, b, c, d, k, s, T) |
| #define | X(a) do { *(u32*)p = (*hd).a ; p += 4; } while(0) |
Functions | |
| static void | md5_init (MD5_CONTEXT *ctx) |
| static void | transform (MD5_CONTEXT *ctx, const unsigned char *data) |
| static void | md5_update (MD5_CONTEXT *hd, const unsigned char *inbuf, size_t inlen) |
| static void | do_final (MD5_CONTEXT *hd) |
| static void | md5_final (unsigned char *digest, MD5_CONTEXT *ctx) |
| static void | md5_hex_digest (char *hexdigest, const unsigned char *s) |
| static void | md5_hmac (unsigned char *digest, const unsigned char *text, int text_len, const unsigned char *key, int key_len) |
| static void | md5_hex_hmac (char *hexdigest, const unsigned char *text, int text_len, const unsigned char *key, int key_len) |
| void | caldav_md5_hex_digest (char *hexdigest, const unsigned char *s) |
| void | caldav_md5_hex_hmac (char *hexdigest, const unsigned char *text, int text_len, const unsigned char *key, int key_len) |
| #define FF | ( | b, | |||
| c, | |||||
| d | ) | (d ^ (b & (c ^ d))) |
| #define FG | ( | b, | |||
| c, | |||||
| d | ) | FF (d, b, c) |
| #define FH | ( | b, | |||
| c, | |||||
| d | ) | (b ^ c ^ d) |
| #define FI | ( | b, | |||
| c, | |||||
| d | ) | (c ^ (b | ~d)) |
| #define OP | ( | f, | |||
| a, | |||||
| b, | |||||
| c, | |||||
| d, | |||||
| k, | |||||
| s, | |||||
| T | ) |
Value:
do { \ a += f (b, c, d) + correct_words[k] + T; \ a = rol(a, s); \ a += b; \ } while (0)
| #define OP | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| s, | |||||
| T | ) |
| #define rol | ( | x, | |||
| n | ) | ( ((x) << (n)) | ((x) >> (32-(n))) ) |
md5.c - MD5 Message-Digest Algorithm Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
according to the definition of MD5 in RFC 1321 from April 1992. NOTE: This is *not* the same file as the one from glibc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. heavily modified for GnuPG by <werner.koch@guug.de>. modified again for Sylpheed by <wk@gnupg.org> 2001-02-11.
| #define X | ( | a | ) | do { *(u32*)p = (*hd).a ; p += 4; } while(0) |
| void caldav_md5_hex_digest | ( | char * | hexdigest, | |
| const unsigned char * | s | |||
| ) |
| void caldav_md5_hex_hmac | ( | char * | hexdigest, | |
| const unsigned char * | text, | |||
| int | text_len, | |||
| const unsigned char * | key, | |||
| int | key_len | |||
| ) |
| static void do_final | ( | MD5_CONTEXT * | hd | ) | [static] |
| static void md5_final | ( | unsigned char * | digest, | |
| MD5_CONTEXT * | ctx | |||
| ) | [static] |
| static void md5_hex_digest | ( | char * | hexdigest, | |
| const unsigned char * | s | |||
| ) | [static] |
| static void md5_hex_hmac | ( | char * | hexdigest, | |
| const unsigned char * | text, | |||
| int | text_len, | |||
| const unsigned char * | key, | |||
| int | key_len | |||
| ) | [static] |
| static void md5_hmac | ( | unsigned char * | digest, | |
| const unsigned char * | text, | |||
| int | text_len, | |||
| const unsigned char * | key, | |||
| int | key_len | |||
| ) | [static] |
| static void md5_init | ( | MD5_CONTEXT * | ctx | ) | [static] |
| static void md5_update | ( | MD5_CONTEXT * | hd, | |
| const unsigned char * | inbuf, | |||
| size_t | inlen | |||
| ) | [static] |
| static void transform | ( | MD5_CONTEXT * | ctx, | |
| const unsigned char * | data | |||
| ) | [static] |
1.5.5