01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.Digest;
04: import org.bouncycastle.crypto.digests.RIPEMD160Digest;
05:
06: /**
07: * RIPEMD160 Digest Test
08: */
09: public class RIPEMD160DigestTest 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: "9c1185a5c5e9fc54612808977ee8f548b2258d31",
22: "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe",
23: "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc",
24: "5d0689ef49d2fae572b881b123a85ffa21595f36",
25: "f71c27109c692c1b56bbdceb5b9d2865b3708dbc",
26: "12a053384a9c0c88e405a06c27dcf49ada62eb2b",
27: "b0e20b6e3116640286ed3a87a5713079b21f5189",
28: "9b752e45573d4b39f4dbd3323cab82bf63326bfb" };
29:
30: final static String million_a_digest = "52783243c1697bdbe16d37f97f68f08325dc1528";
31:
32: RIPEMD160DigestTest() {
33: super (new RIPEMD160Digest(), 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 RIPEMD160Digest((RIPEMD160Digest) digest);
44: }
45:
46: public static void main(String[] args) {
47: runTest(new RIPEMD160DigestTest());
48: }
49: }
|