01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.Digest;
04: import org.bouncycastle.crypto.digests.MD2Digest;
05:
06: /**
07: * standard vector test for MD2
08: * from RFC1319 by B.Kaliski of RSA Laboratories April 1992
09: *
10: */
11: public class MD2DigestTest extends DigestTest {
12: static final String messages[] = {
13: "",
14: "a",
15: "abc",
16: "message digest",
17: "abcdefghijklmnopqrstuvwxyz",
18: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
19: "12345678901234567890123456789012345678901234567890123456789012345678901234567890" };
20:
21: static final String digests[] = {
22: "8350e5a3e24c153df2275c9f80692773",
23: "32ec01ec4a6dac72c0ab96fb34c0b5d1",
24: "da853b0d3f88d99b30283a69e6ded6bb",
25: "ab4f496bfb2a530b219ff33031fe06b0",
26: "4e8ddff3650292ab5a4108c3aa47940b",
27: "da33def2a42df13975352846c30338cd",
28: "d5976f79d83d3a0dc9806c3c66f3efd8" };
29:
30: MD2DigestTest() {
31: super (new MD2Digest(), messages, digests);
32: }
33:
34: protected Digest cloneDigest(Digest digest) {
35: return new MD2Digest((MD2Digest) digest);
36: }
37:
38: public static void main(String[] args) {
39: runTest(new MD2DigestTest());
40: }
41: }
|