Back to home page

MITgcm

 
 

    


File indexing completed on 2025-09-03 05:08:51 UTC

view on githubraw file Latest commit 97efbd2e on 2025-07-08 23:58:00 UTC
ec6cf3b09d Ed H*0001 /* MD5.H - header file for MD5C.C
                0002  */
                0003 
                0004 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
                0005 rights reserved.
                0006 
                0007 License to copy and use this software is granted provided that it
                0008 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
                0009 Algorithm" in all material mentioning or referencing this software
                0010 or this function.
                0011 
                0012 License is also granted to make and use derivative works provided
                0013 that such works are identified as "derived from the RSA Data
                0014 Security, Inc. MD5 Message-Digest Algorithm" in all material
                0015 mentioning or referencing the derived work.
                0016 
                0017 RSA Data Security, Inc. makes no representations concerning either
                0018 the merchantability of this software or the suitability of this
                0019 software for any particular purpose. It is provided "as is"
                0020 without express or implied warranty of any kind.
                0021 These notices must be retained in any copies of any part of this
                0022 documentation and/or software.
                0023  */
                0024 
                0025 /* GLOBAL.H - RSAREF types and constants
                0026  */
                0027 
                0028 /* PROTOTYPES should be set to one if and only if the compiler supports
                0029   function argument prototyping.
97efbd2eca Jean*0030 Previously: was setting PROTOTYPES to 0 if not already defined
                0031 Currently:  set PROTOTYPES to 1 if not already defined so that
                0032   it also work with gcc v15 (C23 standard).
ec6cf3b09d Ed H*0033  */
                0034 #ifndef PROTOTYPES
97efbd2eca Jean*0035 #define PROTOTYPES 1
ec6cf3b09d Ed H*0036 #endif
                0037 
e768bd1221 Jean*0038 #include <stdint.h>
                0039 
ec6cf3b09d Ed H*0040 /* POINTER defines a generic pointer type */
                0041 typedef unsigned char *POINTER;
                0042 
                0043 /* UINT2 defines a two byte word */
e768bd1221 Jean*0044 typedef uint16_t UINT2;
ec6cf3b09d Ed H*0045 
                0046 /* UINT4 defines a four byte word */
e768bd1221 Jean*0047 typedef uint32_t UINT4;
ec6cf3b09d Ed H*0048 
                0049 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
                0050 If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
                0051   returns an empty list.
                0052  */
                0053 #if PROTOTYPES
                0054 #define PROTO_LIST(list) list
                0055 #else
                0056 #define PROTO_LIST(list) ()
                0057 #endif
                0058 
                0059 /* MD5 context. */
                0060 typedef struct {
                0061   UINT4 state[4];                                   /* state (ABCD) */
                0062   UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
                0063   unsigned char buffer[64];                         /* input buffer */
                0064 } MD5_CTX;
                0065 
                0066 void MD5Init PROTO_LIST ((MD5_CTX *));
                0067 void MD5Update PROTO_LIST
                0068   ((MD5_CTX *, unsigned char *, unsigned int));
                0069 void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
                0070