md5.h
上传用户:s81996212
上传日期:2007-01-04
资源大小:722k
文件大小:1k
- #ifndef md5_h
- #define md5_h
- /*
- ** Copyright 1998 - 1999 Double Precision, Inc.
- ** See COPYING for distribution information.
- */
- /*
- ** RFC 1321 MD5 Message digest calculation.
- **
- ** Returns a pointer to a sixteen-byte message digest.
- */
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if HAVE_CONFIG_H
- #include "config.h"
- #endif
- #if HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #if HAVE_SYNCH_H
- #include <synch.h>
- #endif
- #ifdef HAVE_U_INT32_T
- #define MD5_WORD u_int32_t
- #else
- #ifdef HAVE_UINT32_T
- #define MD5_WORD uint32_t
- #else
- #define MD5_WORD unsigned long
- #endif
- #endif
- #define MD5_DIGEST_SIZE 16
- #define MD5_BLOCK_SIZE 64
- typedef unsigned char MD5_DIGEST[MD5_DIGEST_SIZE];
- #ifdef MD5_INTERNAL
- struct MD5_CONTEXT {
- MD5_WORD A, B, C, D;
- unsigned char blk[MD5_BLOCK_SIZE];
- unsigned blk_ptr;
- } ;
- void md5_context_init(struct MD5_CONTEXT *);
- void md5_context_hash(struct MD5_CONTEXT *,
- const unsigned char[MD5_BLOCK_SIZE]);
- void md5_context_hashstream(struct MD5_CONTEXT *, const void *, unsigned);
- void md5_context_endstream(struct MD5_CONTEXT *, unsigned long);
- void md5_context_digest(struct MD5_CONTEXT *, MD5_DIGEST);
- void md5_context_restore(struct MD5_CONTEXT *, const MD5_DIGEST);
- #endif
- void md5_digest(const void *msg, unsigned int len, MD5_DIGEST);
- char *md5_crypt_redhat(const char *, const char *);
- #define md5_crypt md5_crypt_redhat
- const char *md5_hash(const char *);
- #ifdef __cplusplus
- } ;
- #endif
- #endif