Back to index

courier  0.68.2
md5.h
Go to the documentation of this file.
00001 #ifndef       md5_h
00002 #define       md5_h
00003 
00004 /*
00005 ** Copyright 1998 - 2001 Double Precision, Inc.
00006 ** See COPYING for distribution information.
00007 */
00008 
00009 /*
00010 ** RFC 1321 MD5 Message digest calculation.
00011 **
00012 ** Returns a pointer to a sixteen-byte message digest.
00013 */
00014 
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018 
00019 #if    HAVE_CONFIG_H
00020 #include      "md5/config.h"
00021 #endif
00022 
00023 #if    HAVE_SYS_TYPES_H
00024 #include      <sys/types.h>
00025 #endif
00026 
00027 #define       MD5_DIGEST_SIZE      16
00028 #define       MD5_BLOCK_SIZE       64
00029 
00030 typedef unsigned char MD5_DIGEST[MD5_DIGEST_SIZE];
00031 
00032 #ifdef MD5_INTERNAL
00033 
00034 struct MD5_CONTEXT {
00035 
00036        MD5_WORD      A, B, C, D;
00037 
00038        unsigned char blk[MD5_BLOCK_SIZE];
00039        unsigned blk_ptr;
00040        } ;
00041 
00042 void md5_context_init(struct MD5_CONTEXT *);
00043 void md5_context_hash(struct MD5_CONTEXT *,
00044               const unsigned char[MD5_BLOCK_SIZE]);
00045 void md5_context_hashstream(struct MD5_CONTEXT *, const void *, unsigned);
00046 void md5_context_endstream(struct MD5_CONTEXT *, unsigned long);
00047 void md5_context_digest(struct MD5_CONTEXT *, MD5_DIGEST);
00048 
00049 void md5_context_restore(struct MD5_CONTEXT *, const MD5_DIGEST);
00050 
00051 #endif
00052 
00053 void md5_digest(const void *msg, unsigned int len, MD5_DIGEST);
00054 
00055 char *md5_crypt_redhat(const char *, const char *);
00056 #define       md5_crypt     md5_crypt_redhat
00057 
00058 const char *md5_hash_courier(const char *);
00059 const char *md5_hash_raw(const char *);
00060 
00061 #ifdef __cplusplus
00062 } ;
00063 #endif
00064 
00065 #endif