"Fossies" - the Fresh Open Source Software Archive

Member "motion-Release-4.3.0/src/md5.h" (14 Jan 2020, 2256 Bytes) of package /linux/misc/motion-Release-4.3.0.tar.gz:


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.

    1 /*
    2  *  MD5.H - header file for MD5C.C
    3  *  taken from RFC 1321
    4  */
    5 
    6 #ifndef MD5_H
    7 #define MD5_H
    8 
    9 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
   10 rights reserved.
   11 
   12 License to copy and use this software is granted provided that it
   13 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
   14 Algorithm" in all material mentioning or referencing this software
   15 or this function.
   16 
   17 License is also granted to make and use derivative works provided
   18 that such works are identified as "derived from the RSA Data
   19 Security, Inc. MD5 Message-Digest Algorithm" in all material
   20 mentioning or referencing the derived work.
   21 
   22 RSA Data Security, Inc. makes no representations concerning either
   23 the merchantability of this software or the suitability of this
   24 software for any particular purpose. It is provided "as is"
   25 without express or implied warranty of any kind.
   26 
   27 These notices must be retained in any copies of any part of this
   28 documentation and/or software.
   29  */
   30 
   31 /* GLOBAL.H - RSAREF types and constants
   32  */
   33 
   34 /*
   35  * PROTOTYPES should be set to one if and only if the compiler supports
   36  * function argument prototyping.
   37  * The following makes PROTOTYPES default to 0 if it has not already
   38  * been defined with C compiler flags.
   39  */
   40 
   41 #ifndef PROTOTYPES
   42 #define PROTOTYPES 0
   43 #endif
   44 
   45 /* POINTER defines a generic pointer type */
   46 typedef unsigned char *POINTER;
   47 
   48 /* UINT2 defines a two byte word */
   49 typedef unsigned short int UINT2;
   50 
   51 /* UINT4 defines a four byte word */
   52 typedef unsigned int UINT4;
   53 
   54 /*
   55  * PROTO_LIST is defined depending on how PROTOTYPES is defined above.
   56  * If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
   57  * returns an empty list.
   58  */
   59 #if PROTOTYPES
   60 #define PROTO_LIST(list) list
   61 #else
   62 #define PROTO_LIST(list) ()
   63 #endif
   64 
   65 /* MD5 context. */
   66 typedef struct {
   67   UINT4 state[4];                                   /* state (ABCD) */
   68   UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
   69   unsigned char buffer[64];                         /* input buffer */
   70 } MD5_CTX;
   71 
   72 void MD5Init(MD5_CTX *);
   73 void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
   74 void MD5Final(unsigned char [16], MD5_CTX *);
   75 void MD5(unsigned char *message, unsigned long message_length, unsigned char *md);
   76 
   77 #endif // MD5_H