Calculate the MD5 checksum of a buffer. More...
#include <stdint.h>
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | Md5Ctx |
Cursor for the MD5 hashing. More... | |
Typedefs | |
typedef uint32_t | md5_uint32 |
Functions | |
void * | mutt_md5 (const char *str, void *buf) |
Calculate the MD5 hash of a NULL-terminated string. | |
void * | mutt_md5_bytes (const void *buffer, size_t len, void *resbuf) |
Calculate the MD5 hash of a buffer. | |
void * | mutt_md5_finish_ctx (struct Md5Ctx *md5ctx, void *resbuf) |
Process the remaining bytes in the buffer. | |
void | mutt_md5_init_ctx (struct Md5Ctx *md5ctx) |
Initialise the MD5 computation. | |
void | mutt_md5_process (const char *str, struct Md5Ctx *md5ctx) |
Process a NULL-terminated string. | |
void | mutt_md5_process_bytes (const void *buf, size_t buflen, struct Md5Ctx *md5ctx) |
Process a block of data. | |
void | mutt_md5_toascii (const void *digest, char *resbuf) |
Convert a binary MD5 digest into ASCII Hexadecimal. | |
Calculate the MD5 checksum of a buffer.
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/.
Definition in file md5.h.
typedef uint32_t md5_uint32 |
void * mutt_md5 | ( | const char * | str, |
void * | buf | ||
) |
Calculate the MD5 hash of a NULL-terminated string.
str | String to hash |
buf | Buffer for result |
ptr | Results buffer |
Definition at line 317 of file md5.c.
void * mutt_md5_bytes | ( | const void * | buffer, |
size_t | len, | ||
void * | resbuf | ||
) |
Calculate the MD5 hash of a buffer.
ptr | Results buffer |
Compute MD5 message digest for LEN bytes beginning at Buffer. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest.
Definition at line 336 of file md5.c.
void * mutt_md5_finish_ctx | ( | struct Md5Ctx * | md5ctx, |
void * | resbuf | ||
) |
Process the remaining bytes in the buffer.
md5ctx | MD5 context |
resbuf | Buffer for result |
ptr | Results buffer |
Process the remaining bytes in the internal buffer and the usual prologue according to the standard and write the result to RESBUF.
Definition at line 285 of file md5.c.
void mutt_md5_init_ctx | ( | struct Md5Ctx * | md5ctx | ) |
Initialise the MD5 computation.
md5ctx | MD5 context |
RFC1321, 3.3: Step 3
Definition at line 261 of file md5.c.
void mutt_md5_process | ( | const char * | str, |
struct Md5Ctx * | md5ctx | ||
) |
void mutt_md5_process_bytes | ( | const void * | buf, |
size_t | buflen, | ||
struct Md5Ctx * | md5ctx | ||
) |
Process a block of data.
buf | Buffer to process |
buflen | Length of buffer |
md5ctx | MD5 context |
Starting with the result of former calls of this function (or the initialization function update the context for the next BUFLEN bytes starting at Buffer. It is NOT required that BUFLEN is a multiple of 64.
Definition at line 373 of file md5.c.
void mutt_md5_toascii | ( | const void * | digest, |
char * | resbuf | ||
) |
Convert a binary MD5 digest into ASCII Hexadecimal.
digest | Binary MD5 digest |
resbuf | Buffer for the ASCII result |
Definition at line 456 of file md5.c.