01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.engines.SEEDEngine;
04: import org.bouncycastle.crypto.params.KeyParameter;
05: import org.bouncycastle.util.encoders.Hex;
06: import org.bouncycastle.util.test.SimpleTest;
07:
08: /**
09: * SEED tester - vectors http://www.ietf.org/rfc/rfc4009.txt
10: */
11: public class SEEDTest extends CipherTest {
12: static SimpleTest[] tests = {
13: new BlockCipherVectorTest(
14: 0,
15: new SEEDEngine(),
16: new KeyParameter(Hex
17: .decode("00000000000000000000000000000000")),
18: "000102030405060708090a0b0c0d0e0f",
19: "5EBAC6E0054E166819AFF1CC6D346CDB"),
20: new BlockCipherVectorTest(
21: 0,
22: new SEEDEngine(),
23: new KeyParameter(Hex
24: .decode("000102030405060708090a0b0c0d0e0f")),
25: "00000000000000000000000000000000",
26: "c11f22f20140505084483597e4370f43"),
27: new BlockCipherVectorTest(
28: 0,
29: new SEEDEngine(),
30: new KeyParameter(Hex
31: .decode("4706480851E61BE85D74BFB3FD956185")),
32: "83A2F8A288641FB9A4E9A5CC2F131C7D",
33: "EE54D13EBCAE706D226BC3142CD40D4A"),
34: new BlockCipherVectorTest(
35: 0,
36: new SEEDEngine(),
37: new KeyParameter(Hex
38: .decode("28DBC3BC49FFD87DCFA509B11D422BE7")),
39: "B41E6BE2EBA84A148E2EED84593C5EC7",
40: "9B9B7BFCD1813CB95D0B3618F40F5122"), };
41:
42: SEEDTest() {
43: super (tests, new SEEDEngine(), new KeyParameter(new byte[16]));
44: }
45:
46: public String getName() {
47: return "SEED";
48: }
49:
50: public static void main(String[] args) {
51: runTest(new SEEDTest());
52: }
53: }
|