01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.engines.NoekeonEngine;
04: import org.bouncycastle.crypto.params.KeyParameter;
05: import org.bouncycastle.util.encoders.Hex;
06: import org.bouncycastle.util.test.SimpleTest;
07:
08: /**
09: * Noekeon tester
10: */
11: public class NoekeonTest extends CipherTest {
12: static SimpleTest[] tests = {
13: new BlockCipherVectorTest(
14: 0,
15: new NoekeonEngine(),
16: new KeyParameter(Hex
17: .decode("00000000000000000000000000000000")),
18: "00000000000000000000000000000000",
19: "b1656851699e29fa24b70148503d2dfc"),
20: new BlockCipherVectorTest(
21: 1,
22: new NoekeonEngine(),
23: new KeyParameter(Hex
24: .decode("ffffffffffffffffffffffffffffffff")),
25: "ffffffffffffffffffffffffffffffff",
26: "2a78421b87c7d0924f26113f1d1349b2"),
27: new BlockCipherVectorTest(
28: 2,
29: new NoekeonEngine(),
30: new KeyParameter(Hex
31: .decode("b1656851699e29fa24b70148503d2dfc")),
32: "2a78421b87c7d0924f26113f1d1349b2",
33: "e2f687e07b75660ffc372233bc47532c") };
34:
35: NoekeonTest() {
36: super (tests, new NoekeonEngine(),
37: new KeyParameter(new byte[16]));
38: }
39:
40: public String getName() {
41: return "Noekeon";
42: }
43:
44: public static void main(String[] args) {
45: runTest(new NoekeonTest());
46: }
47: }
|