01: package org.bouncycastle.crypto.test;
02:
03: import org.bouncycastle.crypto.engines.CAST6Engine;
04: import org.bouncycastle.crypto.params.KeyParameter;
05: import org.bouncycastle.util.encoders.Hex;
06: import org.bouncycastle.util.test.SimpleTest;
07:
08: /**
09: * cast6 tester - vectors from http://www.ietf.org/rfc/rfc2612.txt
10: */
11: public class CAST6Test extends CipherTest {
12: static SimpleTest[] tests = {
13: new BlockCipherVectorTest(
14: 0,
15: new CAST6Engine(),
16: new KeyParameter(Hex
17: .decode("2342bb9efa38542c0af75647f29f615d")),
18: "00000000000000000000000000000000",
19: "c842a08972b43d20836c91d1b7530f6b"),
20: new BlockCipherVectorTest(
21: 0,
22: new CAST6Engine(),
23: new KeyParameter(
24: Hex
25: .decode("2342bb9efa38542cbed0ac83940ac298bac77a7717942863")),
26: "00000000000000000000000000000000",
27: "1b386c0210dcadcbdd0e41aa08a7a7e8"),
28: new BlockCipherVectorTest(
29: 0,
30: new CAST6Engine(),
31: new KeyParameter(
32: Hex
33: .decode("2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604")),
34: "00000000000000000000000000000000",
35: "4f6a2038286897b9c9870136553317fa") };
36:
37: CAST6Test() {
38: super (tests, new CAST6Engine(), new KeyParameter(new byte[16]));
39: }
40:
41: public String getName() {
42: return "CAST6";
43: }
44:
45: public static void main(String[] args) {
46: runTest(new CAST6Test());
47: }
48: }
|