summaryrefslogtreecommitdiffstats
path: root/bcprov/src/main/java/org/bouncycastle/crypto/test/NoekeonTest.java
blob: ebebbd64a633cf2bbcdd707faca961901c3089e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package org.bouncycastle.crypto.test;

import org.bouncycastle.crypto.engines.NoekeonEngine;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.test.SimpleTest;

/**
 * Noekeon tester
 */
public class NoekeonTest
    extends CipherTest
{
    static SimpleTest[]  tests =
    {
        new BlockCipherVectorTest(0, new NoekeonEngine(),
            new KeyParameter(Hex.decode("00000000000000000000000000000000")),
            "00000000000000000000000000000000",
            "b1656851699e29fa24b70148503d2dfc"),
        new BlockCipherVectorTest(1, new NoekeonEngine(),
            new KeyParameter(Hex.decode("ffffffffffffffffffffffffffffffff")),
            "ffffffffffffffffffffffffffffffff",
            "2a78421b87c7d0924f26113f1d1349b2"),
        new BlockCipherVectorTest(2, new NoekeonEngine(),
            new KeyParameter(Hex.decode("b1656851699e29fa24b70148503d2dfc")),
            "2a78421b87c7d0924f26113f1d1349b2",
            "e2f687e07b75660ffc372233bc47532c")
    };

    NoekeonTest()
    {
        super(tests, new NoekeonEngine(), new KeyParameter(new byte[16]));
    }

    public String getName()
    {
        return "Noekeon";
    }

    public static void main(
        String[]    args)
    {
        runTest(new NoekeonTest());
    }
}