md2
Click on the red underlined text to get to the source
... message having a given prespecified target message digest. The MD2
algorithm is intended for digital signature ...
... 1115hist(-> 1423hist) [3], which
also gives a reference implementation of MD2. The main differences
are that a textual description of MD2 is included, and that the
...
... also gives a reference implementation of MD2. The main differences
are that a textual description of MD2 is included, and that the
reference implementation of MD2 is more portable.
...
... are that a textual description of MD2 is included, and that the
reference implementation of MD2 is more portable.
...
...
This completes the description of MD2. A reference implementation in
C is given in the appendix.
...
... and that the difficulty of coming up with any message having a given
message digest is on the order of 2^128 operations. The MD2 algorithm
has been carefully scrutinized for weaknesses. It is, however, a
...
...
The driver compiles for MD5 by default but can compile for MD2 or MD4 if
the symbol MD is defined on the C compiler command line ...
... A.2 md2.h ...
... MD2_CTX *));
void MD2Update PROTO_LIST
((MD2_CTX *, unsigned char *, unsigned int));
void MD2Final PROTO_LIST ((unsigned char [16], MD2_CTX *));
...
... ((MD2_CTX *, unsigned char *, unsigned int));
void MD2Final PROTO_LIST ((unsigned char [16], MD2_CTX *));
...
...
#include "global.h"
#include "md2.h"
static void MD2Transform PROTO_LIST
...
... static void MD2Transform PROTO_LIST
((unsigned char [16], unsigned char [16], unsigned char [16]));
static void MD2_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
static void MD2_memset PROTO_LIST ((POINTER, int, unsigned int));
...
... static void MD2_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
static void MD2_memset PROTO_LIST ((POINTER, int, unsigned int));
/* Permutation of 0..255 constructed from the digits of pi. It gives a
...
... /* MD2 block update operation. Continues an MD2 message-digest
operation, processing another message block, and updating the
...
... MD2_memcpy ((POINTER)x, (POINTER)state, 16);
MD2_memcpy ((POINTER)x+16, (POINTER)block, 16);
for (i = 0; i < 16; i++)
x[i+32] = state ...
... /* Zeroize sensitive information.
*/
MD2_memset ((POINTER)x, 0, sizeof (x));
}
...
... /* Note: Replace "for loop" with standard memcpy if possible.
*/
static void MD2_memcpy (output, input, len)
POINTER output;
POINTER input;
...
... /* Note: Replace "for loop" with standard memset if possible.
*/
static void MD2_memset (output, value, len)
POINTER output;
int value;
...
...
The MD2 test suite (driver option "-x") should print the following
results:
...
...
MD2 test suite:
MD2 ("") = 8350e5a3e24c153df2275c9f80692773
MD2 ("a") = 32ec01ec4a6dac72c0ab96fb34c0b5d1
MD2 ...
... MD2 test suite:
MD2 ("") = 8350e5a3e24c153df2275c9f80692773
MD2 ("a") = 32ec01ec4a6dac72c0ab96fb34c0b5d1
MD2 ("abc") = da853b0d3f88d99b30283a69e6ded6bb
MD2 ...
... MD2 ("") = 8350e5a3e24c153df2275c9f80692773
MD2 ("a") = 32ec01ec4a6dac72c0ab96fb34c0b5d1
MD2 ("abc") = da853b0d3f88d99b30283a69e6ded6bb
MD2 ("message digest") = ab4f496bfb2a530b219ff33031fe06b0
...
... MD2 ("a") = 32ec01ec4a6dac72c0ab96fb34c0b5d1
MD2 ("abc") = da853b0d3f88d99b30283a69e6ded6bb
MD2 ("message digest") = ab4f496bfb2a530b219ff33031fe06b0
MD2 ("abcdefghijklmnopqrstuvwxyz") = 4e8ddff3650292ab5a4108c3aa47940b
...
... MD2 ("message digest") = ab4f496bfb2a530b219ff33031fe06b0
MD2 ("abcdefghijklmnopqrstuvwxyz") = 4e8ddff3650292ab5a4108c3aa47940b
MD2 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =
da33def2a42df13975352846c30338cd
...
... message digest") = ab4f496bfb2a530b219ff33031fe06b0
MD2 ("abcdefghijklmnopqrstuvwxyz") = 4e8ddff3650292ab5a4108c3aa47940b
MD2 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =
da33def2a42df13975352846c30338cd
MD2 ("123456789012345678901234567890123456789012345678901234567890123456
...
... MD2 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =
da33def2a42df13975352846c30338cd
MD2 ("123456789012345678901234567890123456789012345678901234567890123456
78901234567890") = d5976f79d83d3a0dc9806c3c66f3efd8
...
... sufficient for implementing very high security hybrid digital
signature schemes based on MD2 and a public-key cryptosystem.
...
