diff options
Diffstat (limited to 'libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/NullTest.java')
-rw-r--r-- | libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/NullTest.java | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/NullTest.java b/libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/NullTest.java deleted file mode 100644 index f384cfc4c..000000000 --- a/libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/NullTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.spongycastle.crypto.test; - -import org.spongycastle.crypto.BlockCipher; -import org.spongycastle.crypto.DataLengthException; -import org.spongycastle.crypto.engines.NullEngine; -import org.spongycastle.crypto.params.KeyParameter; -import org.spongycastle.util.encoders.Hex; -import org.spongycastle.util.test.SimpleTest; - -public class NullTest - extends CipherTest -{ - static SimpleTest[] tests = - { - new BlockCipherVectorTest(0, new NullEngine(), - new KeyParameter(Hex.decode("00")), "00", "00") - }; - - NullTest() - { - super(tests, new NullEngine(), new KeyParameter(new byte[2])); - } - - public String getName() - { - return "Null"; - } - - public void performTest() - throws Exception - { - super.performTest(); - - BlockCipher engine = new NullEngine(); - - engine.init(true, null); - - byte[] buf = new byte[1]; - - engine.processBlock(buf, 0, buf, 0); - - if (buf[0] != 0) - { - fail("NullCipher changed data!"); - } - - byte[] shortBuf = new byte[0]; - - try - { - engine.processBlock(shortBuf, 0, buf, 0); - - fail("failed short input check"); - } - catch (DataLengthException e) - { - // expected - } - - try - { - engine.processBlock(buf, 0, shortBuf, 0); - - fail("failed short output check"); - } - catch (DataLengthException e) - { - // expected - } - } - - public static void main( - String[] args) - { - runTest(new NullTest()); - } -} |