aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/test_vectors
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-06-17 21:53:30 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-06-17 21:53:30 +0200
commited65740846dda04f8d60149ebf9aba52c1127133 (patch)
tree4cb45e08f64ad4787d7f97b4ae45fcac5a984ea8 /src/libstrongswan/plugins/test_vectors
parent364786b69f4ede2c9c11d06e9347c3b879065e33 (diff)
downloadstrongswan-ed65740846dda04f8d60149ebf9aba52c1127133.tar.bz2
strongswan-ed65740846dda04f8d60149ebf9aba52c1127133.tar.xz
added 2 IDEA test vectors
Diffstat (limited to 'src/libstrongswan/plugins/test_vectors')
-rw-r--r--src/libstrongswan/plugins/test_vectors/Makefile.am1
-rw-r--r--src/libstrongswan/plugins/test_vectors/test_vectors.h2
-rw-r--r--src/libstrongswan/plugins/test_vectors/test_vectors/idea.c44
3 files changed, 47 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/test_vectors/Makefile.am b/src/libstrongswan/plugins/test_vectors/Makefile.am
index 2d075523c..13419b89a 100644
--- a/src/libstrongswan/plugins/test_vectors/Makefile.am
+++ b/src/libstrongswan/plugins/test_vectors/Makefile.am
@@ -13,6 +13,7 @@ libstrongswan_test_vectors_la_SOURCES = \
test_vectors/blowfish.c \
test_vectors/camellia_cbc.c \
test_vectors/cast.c \
+ test_vectors/idea.c \
test_vectors/serpent_cbc.c \
test_vectors/twofish_cbc.c \
test_vectors/md5.c \
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors.h b/src/libstrongswan/plugins/test_vectors/test_vectors.h
index da7a96cd0..b95fd3972 100644
--- a/src/libstrongswan/plugins/test_vectors/test_vectors.h
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors.h
@@ -30,6 +30,8 @@ TEST_VECTOR_CRYPTER(camellia_cbc6)
TEST_VECTOR_CRYPTER(cast1)
TEST_VECTOR_CRYPTER(des3_cbc1)
TEST_VECTOR_CRYPTER(des3_cbc2)
+TEST_VECTOR_CRYPTER(idea1)
+TEST_VECTOR_CRYPTER(idea2)
TEST_VECTOR_CRYPTER(serpent_cbc1)
TEST_VECTOR_CRYPTER(serpent_cbc2)
TEST_VECTOR_CRYPTER(serpent_cbc3)
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors/idea.c b/src/libstrongswan/plugins/test_vectors/test_vectors/idea.c
new file mode 100644
index 000000000..4856a480f
--- /dev/null
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors/idea.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2009 Andreas Steffen
+ * Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the Licenseor (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be usefulbut
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include <crypto/crypto_tester.h>
+
+/**
+ * All testvectors from https://www.cosic.esat.kuleuven.be/nessie/testvectors/
+ */
+
+/**
+ * IDEA 128 bit: set 8, vector #0
+ */
+crypter_test_vector_t idea1 = {
+ .alg = ENCR_IDEA, .key_size = 16, .len = 8,
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+ .plain = "\xDB\x2D\x4A\x92\xAA\x68\x27\x3F",
+ .cipher = "\x00\x11\x22\x33\x44\x55\x66\x77"
+};
+
+/**
+ * IDEA 128 bit: set 8, vector #1
+ */
+crypter_test_vector_t idea2 = {
+ .alg = ENCR_IDEA, .key_size = 16, .len = 8,
+ .key = "\x2B\xD6\x45\x9F\x82\xC5\xB3\x00\x95\x2C\x49\x10\x48\x81\xFF\x48",
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+ .plain = "\xF1\x29\xA6\x60\x1E\xF6\x2A\x47",
+ .cipher = "\xEA\x02\x47\x14\xAD\x5C\x4D\x84"
+};
+
+