aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-06-17 15:24:20 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-06-17 15:24:20 +0200
commita36c082da66c1ee5dc77ce8138f22e2962a1a2eb (patch)
tree5e4449817cc784e190d5be790f4caf5a59e28b7c
parent1db85f2cc7a05bc604c443e9e516176badead348 (diff)
downloadstrongswan-a36c082da66c1ee5dc77ce8138f22e2962a1a2eb.tar.bz2
strongswan-a36c082da66c1ee5dc77ce8138f22e2962a1a2eb.tar.xz
added one CAST-128 test vector
-rw-r--r--src/libstrongswan/plugins/test_vectors/Makefile.am1
-rw-r--r--src/libstrongswan/plugins/test_vectors/test_vectors.h1
-rw-r--r--src/libstrongswan/plugins/test_vectors/test_vectors/cast.c28
3 files changed, 30 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/test_vectors/Makefile.am b/src/libstrongswan/plugins/test_vectors/Makefile.am
index b399d0da6..7c75abad7 100644
--- a/src/libstrongswan/plugins/test_vectors/Makefile.am
+++ b/src/libstrongswan/plugins/test_vectors/Makefile.am
@@ -12,6 +12,7 @@ libstrongswan_test_vectors_la_SOURCES = \
test_vectors/aes_xcbc.c \
test_vectors/blowfish.c \
test_vectors/camellia_cbc.c \
+ test_vectors/cast.c \
test_vectors/md5.c \
test_vectors/md5_hmac.c \
test_vectors/sha1.c \
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors.h b/src/libstrongswan/plugins/test_vectors/test_vectors.h
index e5c246be7..7da10a551 100644
--- a/src/libstrongswan/plugins/test_vectors/test_vectors.h
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors.h
@@ -27,6 +27,7 @@ TEST_VECTOR_CRYPTER(camellia_cbc3)
TEST_VECTOR_CRYPTER(camellia_cbc4)
TEST_VECTOR_CRYPTER(camellia_cbc5)
TEST_VECTOR_CRYPTER(camellia_cbc6)
+TEST_VECTOR_CRYPTER(cast1)
TEST_VECTOR_CRYPTER(des3_cbc1)
TEST_VECTOR_CRYPTER(des3_cbc2)
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors/cast.c b/src/libstrongswan/plugins/test_vectors/test_vectors/cast.c
new file mode 100644
index 000000000..a33a219ed
--- /dev/null
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors/cast.c
@@ -0,0 +1,28 @@
+/*
+ * 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>
+
+/**
+ * Test from RFC 2144
+ */
+crypter_test_vector_t cast1 = {
+ .alg = ENCR_CAST, .key_size = 16, .len = 8,
+ .key = "\x01\x23\x45\x67\x12\x34\x56\x78\x23\x45\x67\x89\x34\x56\x78\x9A",
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .plain = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
+ .cipher = "\x23\x8B\x4F\xE5\x84\x7E\x44\xB2"
+};
+