Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Tyley <roberto.tyley@gmail.com>2014-07-15 01:38:01 +0400
committerRoberto Tyley <roberto.tyley@gmail.com>2014-07-26 11:23:17 +0400
commit7cb752aaf746dc0b473afeb9e892b7fbc12666c5 (patch)
treecc4f91ddc18332b5adbe82e3fcb040d976c90105 /core/src/test/java/org/spongycastle/crypto/test/TwofishTest.java
parent551830f8ea5177042af2c7dd1fc90888bc67387d (diff)
Execute become-spongy.sh
https://github.com/rtyley/spongycastle/blob/3040af/become-spongy.sh
Diffstat (limited to 'core/src/test/java/org/spongycastle/crypto/test/TwofishTest.java')
-rw-r--r--core/src/test/java/org/spongycastle/crypto/test/TwofishTest.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/core/src/test/java/org/spongycastle/crypto/test/TwofishTest.java b/core/src/test/java/org/spongycastle/crypto/test/TwofishTest.java
new file mode 100644
index 00000000..84f3e7fc
--- /dev/null
+++ b/core/src/test/java/org/spongycastle/crypto/test/TwofishTest.java
@@ -0,0 +1,45 @@
+package org.spongycastle.crypto.test;
+
+import org.spongycastle.crypto.engines.TwofishEngine;
+import org.spongycastle.crypto.params.KeyParameter;
+import org.spongycastle.util.encoders.Hex;
+import org.spongycastle.util.test.SimpleTest;
+
+public class TwofishTest
+ extends CipherTest
+{
+ static String key1 = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f";
+ static String key2 = "000102030405060708090a0b0c0d0e0f1011121314151617";
+ static String key3 = "000102030405060708090a0b0c0d0e0f";
+
+ static String input = "000102030405060708090A0B0C0D0E0F";
+
+ static SimpleTest[] tests =
+ {
+ new BlockCipherVectorTest(0, new TwofishEngine(),
+ new KeyParameter(Hex.decode(key1)),
+ input, "8ef0272c42db838bcf7b07af0ec30f38"),
+ new BlockCipherVectorTest(1, new TwofishEngine(),
+ new KeyParameter(Hex.decode(key2)),
+ input, "95accc625366547617f8be4373d10cd7"),
+ new BlockCipherVectorTest(2, new TwofishEngine(),
+ new KeyParameter(Hex.decode(key3)),
+ input, "9fb63337151be9c71306d159ea7afaa4")
+ };
+
+ TwofishTest()
+ {
+ super(tests, new TwofishEngine(), new KeyParameter(new byte[32]));
+ }
+
+ public String getName()
+ {
+ return "Twofish";
+ }
+
+ public static void main(
+ String[] args)
+ {
+ runTest(new TwofishTest());
+ }
+}