1 /* $Id: TestRIPEMD128.java,v 1.6 2001/06/25 15:41:13 gelderen Exp $
2  *
3  * Copyright (C) 1995-1999 The Cryptix Foundation Limited.
4  * All rights reserved.
5  *
6  * Use, modification, copying and distribution of this software is subject
7  * the terms and conditions of the Cryptix General Licence. You should have
8  * received a copy of the Cryptix General Licence along with this library;
9  * if not, you can download a copy from http://www.cryptix.org/ .
10  */
11 package cryptix.jce.test;
12 
13 
14 final class TestRIPEMD128
15 extends MessageDigestTest
16 {
17     private static final String NAME="RIPEMD128";
18 
19     private static final String[][] TEST_VALUES =
20     {
21         //    data, md
22         {"",
23             "CDF26213A150DC3ECB610F18F6B38B46"},
24         {"a",
25             "86BE7AFA339D0FC7CFC785E72F578D33"},
26         {"abc",
27             "C14A12199C66E4BA84636B0F69144C77"},
28         {"message digest",
29             "9E327B3D6E523062AFC1132D7DF9D1B8"},
30         {"abcdefghijklmnopqrstuvwxyz",
31             "FD2AA607F71DC8F510714922B371834E"},
32         {"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
33             "A1AA0689D0FAFA2DDC22E88B49133A06"},
34         {"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
35             "D1E959EB179C911FAEA4624C60C5C702"},
36         {"123456789012345678901234567890123456789012345678901234567890"+
37          "12345678901234567890",
38             "3F45EF194732C2DBB2C4A2C769795FA3"}
39     };
40 
41     private static final String LARGE_STRING_VALUE =
42         "4A7F5723F954EBA1216C9D8F6320431F";
43 
44 
TestRIPEMD128()45     protected TestRIPEMD128()
46     {
47         super(NAME);
48     }
49 
50 
doIt()51     protected void doIt()
52     throws Exception
53     {
54         testExistence(NAME);
55         testExistence("RIPEMD-128");
56         testValues(NAME, TEST_VALUES);
57         testLargeString(NAME, (byte)'a', 1000000, LARGE_STRING_VALUE);
58         testCloning(NAME);
59     }
60 }
61