01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.Digest;
04: import org.bouncycastle.crypto.digests.SHA1Digest;
05:
06: /**
07: * standard vector test for SHA-1 from "Handbook of Applied Cryptography", page 345.
08: */
09: public class SHA1DigestTest extends DigestTest {
10: private static String[] messages = { "", "a", "abc",
11: "abcdefghijklmnopqrstuvwxyz" };
12:
13: private static String[] digests = {
14: "da39a3ee5e6b4b0d3255bfef95601890afd80709",
15: "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8",
16: "a9993e364706816aba3e25717850c26c9cd0d89d",
17: "32d10c7b8cf96570ca04ce37f2a19d84240d3a89" };
18:
19: SHA1DigestTest() {
20: super (new SHA1Digest(), messages, digests);
21: }
22:
23: protected Digest cloneDigest(Digest digest) {
24: return new SHA1Digest((SHA1Digest) digest);
25: }
26:
27: public static void main(String[] args) {
28: runTest(new SHA1DigestTest());
29: }
30: }
|