01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.Digest;
04: import org.bouncycastle.crypto.digests.RIPEMD128Digest;
05:
06: /**
07: * RIPEMD128 Digest Test
08: */
09: public class RIPEMD128DigestTest extends DigestTest {
10: final static String[] messages = {
11: "",
12: "a",
13: "abc",
14: "message digest",
15: "abcdefghijklmnopqrstuvwxyz",
16: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
17: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
18: "12345678901234567890123456789012345678901234567890123456789012345678901234567890" };
19:
20: final static String[] digests = {
21: "cdf26213a150dc3ecb610f18f6b38b46",
22: "86be7afa339d0fc7cfc785e72f578d33",
23: "c14a12199c66e4ba84636b0f69144c77",
24: "9e327b3d6e523062afc1132d7df9d1b8",
25: "fd2aa607f71dc8f510714922b371834e",
26: "a1aa0689d0fafa2ddc22e88b49133a06",
27: "d1e959eb179c911faea4624c60c5c702",
28: "3f45ef194732c2dbb2c4a2c769795fa3" };
29:
30: final static String million_a_digest = "4a7f5723f954eba1216c9d8f6320431f";
31:
32: RIPEMD128DigestTest() {
33: super (new RIPEMD128Digest(), messages, digests);
34: }
35:
36: public void performTest() {
37: super .performTest();
38:
39: millionATest(million_a_digest);
40: }
41:
42: protected Digest cloneDigest(Digest digest) {
43: return new RIPEMD128Digest((RIPEMD128Digest) digest);
44: }
45:
46: public static void main(String[] args) {
47: runTest(new RIPEMD128DigestTest());
48: }
49: }
|