01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.Digest;
04: import org.bouncycastle.crypto.digests.TigerDigest;
05:
06: /**
07: * Tiger Digest Test
08: */
09: public class TigerDigestTest extends DigestTest {
10: final static String[] messages = {
11: "",
12: "abc",
13: "Tiger",
14: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
15: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw",
16: "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
17: "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996.",
18: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-" };
19:
20: final static String[] digests = {
21: "3293AC630C13F0245F92BBB1766E16167A4E58492DDE73F3",
22: "2AAB1484E8C158F2BFB8C5FF41B57A525129131C957B5F93",
23: "DD00230799F5009FEC6DEBC838BB6A27DF2B9D6F110C7937",
24: "F71C8583902AFB879EDFE610F82C0D4786A3A534504486B5",
25: "38F41D9D9A710A10C3727AC0DEEAA270727D9F926EC10139",
26: "48CEEB6308B87D46E95D656112CDF18D97915F9765658957",
27: "631ABDD103EB9A3D245B6DFD4D77B257FC7439501D1568DD",
28: "C54034E5B43EB8005848A7E0AE6AAC76E4FF590AE715FD25",
29: "C54034E5B43EB8005848A7E0AE6AAC76E4FF590AE715FD25" };
30:
31: final static String hash64k = "FDF4F5B35139F48E710E421BE5AF411DE1A8AAC333F26204";
32:
33: TigerDigestTest() {
34: super (new TigerDigest(), messages, digests);
35: }
36:
37: public void performTest() {
38: super .performTest();
39:
40: sixtyFourKTest(hash64k);
41: }
42:
43: protected Digest cloneDigest(Digest digest) {
44: return new TigerDigest((TigerDigest) digest);
45: }
46:
47: public static void main(String[] args) {
48: runTest(new TigerDigestTest());
49: }
50: }
|