01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.Digest;
04: import org.bouncycastle.crypto.digests.MD5Digest;
05:
06: /**
07: * standard vector test for MD5 from "Handbook of Applied Cryptography", page 345.
08: */
09: public class MD5DigestTest extends DigestTest {
10: static final String[] messages = { "", "a", "abc",
11: "abcdefghijklmnopqrstuvwxyz" };
12:
13: static final String[] digests = {
14: "d41d8cd98f00b204e9800998ecf8427e",
15: "0cc175b9c0f1b6a831c399e269772661",
16: "900150983cd24fb0d6963f7d28e17f72",
17: "c3fcd3d76192e4007dfb496cca67e13b" };
18:
19: MD5DigestTest() {
20: super (new MD5Digest(), messages, digests);
21: }
22:
23: protected Digest cloneDigest(Digest digest) {
24: return new MD5Digest((MD5Digest) digest);
25: }
26:
27: public static void main(String[] args) {
28: runTest(new MD5DigestTest());
29: }
30: }
|