"Fossies" - the Fresh Open Source Software Archive

Member "msmtp-1.8.5/src/md5.h" (12 Dec 2018, 1751 Bytes) of package /linux/privat/msmtp-1.8.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "md5.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.8.1_vs_1.8.2.

    1 /*
    2  * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
    3  * MD5 Message-Digest Algorithm (RFC 1321).
    4  *
    5  * Homepage:
    6  * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
    7  *
    8  * Author:
    9  * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
   10  *
   11  * This software was written by Alexander Peslyak in 2001.  No copyright is
   12  * claimed, and the software is hereby placed in the public domain.
   13  * In case this attempt to disclaim copyright and place the software in the
   14  * public domain is deemed null and void, then the software is
   15  * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
   16  * general public under the following terms:
   17  *
   18  * Redistribution and use in source and binary forms, with or without
   19  * modification, are permitted.
   20  *
   21  * There's ABSOLUTELY NO WARRANTY, express or implied.
   22  *
   23  * See md5.c for more information.
   24  */
   25 
   26 /* Local change for msmtp: always use these functions regardless of HAVE_OPENSSL,
   27  * and use the prefix 'msmtp_' for all symbols to avoid clashes. */
   28 #undef HAVE_OPENSSL
   29 #define MD5_u32plus msmtp_MD5_u32plus
   30 #define MD5_CTX msmtp_MD5_CTX
   31 #define MD5_Init msmtp_MD5_Init
   32 #define MD5_Update msmtp_MD5_Update
   33 #define MD5_Final msmtp_MD5_Final
   34 
   35 #ifdef HAVE_OPENSSL
   36 #include <openssl/md5.h>
   37 #elif !defined(_MD5_H)
   38 #define _MD5_H
   39 
   40 /* Any 32-bit or wider unsigned integer data type will do */
   41 typedef unsigned int MD5_u32plus;
   42 
   43 typedef struct {
   44     MD5_u32plus lo, hi;
   45     MD5_u32plus a, b, c, d;
   46     unsigned char buffer[64];
   47     MD5_u32plus block[16];
   48 } MD5_CTX;
   49 
   50 extern void MD5_Init(MD5_CTX *ctx);
   51 extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
   52 extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
   53 
   54 #endif