File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / rsync / lib / mdigest.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:32:36 2021 UTC (4 years ago) by misho
Branches: rsync, MAIN
CVS tags: v3_2_3, HEAD
rsync 3.2.3

    1: /* The include file for both the MD4 and MD5 routines. */
    2: 
    3: #ifdef USE_OPENSSL
    4: #include "openssl/md4.h"
    5: #include "openssl/md5.h"
    6: #endif
    7: #include "md-defines.h"
    8: 
    9: typedef struct {
   10: 	uint32 A, B, C, D;
   11: 	uint32 totalN;          /* bit count, lower 32 bits */
   12: 	uint32 totalN2;         /* bit count, upper 32 bits */
   13: 	uchar buffer[CSUM_CHUNK];
   14: } md_context;
   15: 
   16: void mdfour_begin(md_context *md);
   17: void mdfour_update(md_context *md, const uchar *in, uint32 length);
   18: void mdfour_result(md_context *md, uchar digest[MD4_DIGEST_LEN]);
   19: 
   20: #ifndef USE_OPENSSL
   21: #define MD5_CTX md_context
   22: #define MD5_Init md5_begin
   23: #define MD5_Update md5_update
   24: #define MD5_Final(digest, cptr) md5_result(cptr, digest)
   25: 
   26: void md5_begin(md_context *ctx);
   27: void md5_update(md_context *ctx, const uchar *input, uint32 length);
   28: void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN]);
   29: #endif
   30: 
   31: typedef struct {
   32:     uchar context_storage[1024];
   33:     uchar buffer[512];
   34:     unsigned int used;
   35:     unsigned int next;
   36: } MD5P8_CTX;
   37: 
   38: void MD5P8_Init(MD5P8_CTX *ctx);
   39: void MD5P8_Update(MD5P8_CTX *ctx, const uchar *input, uint32 length);
   40: void MD5P8_Final(uchar digest[MD5_DIGEST_LEN], MD5P8_CTX *ctx);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>