Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for libplaton/platon/hash/md5.c between version 1.1 and 1.2

version 1.1, 2004/08/27 21:55:12 version 1.2, 2004/08/27 22:18:03
Line 356  MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh
Line 356  MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh
 d174ab98d277d9f5a5611c2c9f419d9f  d174ab98d277d9f5a5611c2c9f419d9f
 MD5 ("123456789012345678901234567890123456789012345678901234567890123456  MD5 ("123456789012345678901234567890123456789012345678901234567890123456
 78901234567890") = 57edf4a22be3c955ac49da2e2107b67a  78901234567890") = 57edf4a22be3c955ac49da2e2107b67a
   memcmp(MD5_weakness[0], MD5_weakness[1], MD5_weakness_size) = 1
   MD5 ("MD5_weakness[0]") = a4c0d35c95a63a805915367dcfe6b751
   MD5 ("MD5_weakness[1]") = a4c0d35c95a63a805915367dcfe6b751
   
 */  */
   
Line 429  static void MDPrint PROTO_LIST ((unsigne
Line 432  static void MDPrint PROTO_LIST ((unsigne
 #define MDFinal MD5Final  #define MDFinal MD5Final
 #endif  #endif
   
   #define MD5_weakness_size       (128)
   unsigned char MD5_weakness[2][MD5_weakness_size] =
   {
           {0xd1,0x31,0xdd,0x02,0xc5,0xe6,0xee,0xc4,0x69,0x3d,0x9a,0x06,0x98,0xaf,0xf9,0x5c,
                   0x2f,0xca,0xb5,0x87,0x12,0x46,0x7e,0xab,0x40,0x04,0x58,0x3e,0xb8,0xfb,0x7f,0x89,
                   0x55,0xad,0x34,0x06,0x09,0xf4,0xb3,0x02,0x83,0xe4,0x88,0x83,0x25,0x71,0x41,0x5a,
                   0x08,0x51,0x25,0xe8,0xf7,0xcd,0xc9,0x9f,0xd9,0x1d,0xbd,0xf2,0x80,0x37,0x3c,0x5b,
                   0x96,0x0b,0x1d,0xd1,0xdc,0x41,0x7b,0x9c,0xe4,0xd8,0x97,0xf4,0x5a,0x65,0x55,0xd5,
                   0x35,0x73,0x9a,0xc7,0xf0,0xeb,0xfd,0x0c,0x30,0x29,0xf1,0x66,0xd1,0x09,0xb1,0x8f,
                   0x75,0x27,0x7f,0x79,0x30,0xd5,0x5c,0xeb,0x22,0xe8,0xad,0xba,0x79,0xcc,0x15,0x5c,
                   0xed,0x74,0xcb,0xdd,0x5f,0xc5,0xd3,0x6d,0xb1,0x9b,0x0a,0xd8,0x35,0xcc,0xa7,0xe3},
   
           {0xd1,0x31,0xdd,0x02,0xc5,0xe6,0xee,0xc4,0x69,0x3d,0x9a,0x06,0x98,0xaf,0xf9,0x5c,
                   0x2f,0xca,0xb5,0x07,0x12,0x46,0x7e,0xab,0x40,0x04,0x58,0x3e,0xb8,0xfb,0x7f,0x89,
                   0x55,0xad,0x34,0x06,0x09,0xf4,0xb3,0x02,0x83,0xe4,0x88,0x83,0x25,0xf1,0x41,0x5a,
                   0x08,0x51,0x25,0xe8,0xf7,0xcd,0xc9,0x9f,0xd9,0x1d,0xbd,0x72,0x80,0x37,0x3c,0x5b,
                   0x96,0x0b,0x1d,0xd1,0xdc,0x41,0x7b,0x9c,0xe4,0xd8,0x97,0xf4,0x5a,0x65,0x55,0xd5,
                   0x35,0x73,0x9a,0x47,0xf0,0xeb,0xfd,0x0c,0x30,0x29,0xf1,0x66,0xd1,0x09,0xb1,0x8f,
                   0x75,0x27,0x7f,0x79,0x30,0xd5,0x5c,0xeb,0x22,0xe8,0xad,0xba,0x79,0x4c,0x15,0x5c,
                   0xed,0x74,0xcb,0xdd,0x5f,0xc5,0xd3,0x6d,0xb1,0x9b,0x0a,0x58,0x35,0xcc,0xa7,0xe3}
   };
   
 /* Main driver.  /* Main driver.
   
 Arguments (may be any combination):  Arguments (may be any combination):
Line 478  char *string;
Line 503  char *string;
   printf ("\n");    printf ("\n");
 }  }
   
   /* Digests a string and prints the result.
    */
   static void MDString2 (string, len, name)
   char *string;
   char *name;
   {
     MD_CTX context;
     unsigned char digest[16];
   
     MDInit (&context);
     MDUpdate (&context, string, len);
     MDFinal (digest, &context);
   
     printf ("MD%d (\"%s\") = ", MD, name);
     MDPrint (digest);
     printf ("\n");
   }
   
 /* Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte  /* Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte
   blocks.    blocks.
  */   */
Line 533  static void MDTestSuite ()
Line 576  static void MDTestSuite ()
   MDString    MDString
  ("1234567890123456789012345678901234567890\   ("1234567890123456789012345678901234567890\
 1234567890123456789012345678901234567890");  1234567890123456789012345678901234567890");
   
     printf("memcmp(MD5_weakness[0], MD5_weakness[1], MD5_weakness_size) = %d\n",
                     memcmp(MD5_weakness[0], MD5_weakness[1], MD5_weakness_size));
     MDString2(MD5_weakness[0], sizeof(MD5_weakness[0]), "MD5_weakness[0]");
     MDString2(MD5_weakness[1], sizeof(MD5_weakness[0]), "MD5_weakness[1]");
   
 }  }
   
 /* Digests a file and prints the result.  /* Digests a file and prints the result.

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top