Merge release-5-0 into master
[alexxy/gromacs.git] / src / gromacs / fileio / md5.c
index e6a608ebf3ec6974d3690577166670f3b27d1a7f..c7cd9930858f27457d1ac4e734177191b5aa89b6 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+/* This software has been altered by GROMACS for its use, including
+ * the use of GMX_INTEGER_BIG_ENDIAN, and the renaming of the
+ * functions md5_init, md5_append and md5_finish to have a gmx_ prefix
+ * (to avoid name clashes). */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -358,7 +362,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
 }
 
 void
-md5_init(md5_state_t *pms)
+gmx_md5_init(md5_state_t *pms)
 {
     pms->count[0] = pms->count[1] = 0;
     pms->abcd[0]  = 0x67452301;
@@ -368,7 +372,7 @@ md5_init(md5_state_t *pms)
 }
 
 void
-md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
+gmx_md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
 {
     const md5_byte_t *p = data;
     int left            = nbytes;
@@ -417,7 +421,7 @@ md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
 }
 
 void
-md5_finish(md5_state_t *pms, md5_byte_t digest[16])
+gmx_md5_finish(md5_state_t *pms, md5_byte_t digest[16])
 {
     static const md5_byte_t pad[64] = {
         0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -434,9 +438,9 @@ md5_finish(md5_state_t *pms, md5_byte_t digest[16])
         data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
     }
     /* Pad to 56 bytes mod 64. */
-    md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
+    gmx_md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
     /* Append the length. */
-    md5_append(pms, data, 8);
+    gmx_md5_append(pms, data, 8);
     for (i = 0; i < 16; ++i)
     {
         digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));