aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-06-12 10:40:38 +0200
committerMartin Willi <martin@strongswan.org>2009-06-12 10:40:38 +0200
commit095f971c10a3d2851e3327f779f1b36c0897e067 (patch)
tree9b75c2a7b4f87d1485763159bcb8a298bb04653f /src/libstrongswan/plugins
parent371a54c7a902c0869ca6fb05ca6ced2d6d765214 (diff)
downloadstrongswan-095f971c10a3d2851e3327f779f1b36c0897e067.tar.bz2
strongswan-095f971c10a3d2851e3327f779f1b36c0897e067.tar.xz
added a FIPS_PRF test vector
Diffstat (limited to 'src/libstrongswan/plugins')
-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/fips_prf.c30
3 files changed, 32 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/test_vectors/Makefile.am b/src/libstrongswan/plugins/test_vectors/Makefile.am
index 5cf53c348..55bf009ff 100644
--- a/src/libstrongswan/plugins/test_vectors/Makefile.am
+++ b/src/libstrongswan/plugins/test_vectors/Makefile.am
@@ -16,6 +16,7 @@ libstrongswan_test_vectors_la_SOURCES = \
test_vectors/sha1_hmac.c \
test_vectors/sha2.c \
test_vectors/sha2_hmac.c \
+ test_vectors/fips_prf.c \
test_vectors/rng.c
libstrongswan_test_vectors_la_LDFLAGS = -module
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors.h b/src/libstrongswan/plugins/test_vectors/test_vectors.h
index 125039860..d91ffaf8d 100644
--- a/src/libstrongswan/plugins/test_vectors/test_vectors.h
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors.h
@@ -92,6 +92,7 @@ TEST_VECTOR_PRF(sha512_hmac_p3)
TEST_VECTOR_PRF(sha512_hmac_p4)
TEST_VECTOR_PRF(sha512_hmac_p5)
TEST_VECTOR_PRF(sha512_hmac_p6)
+TEST_VECTOR_PRF(fips_prf_1)
TEST_VECTOR_RNG(rng_monobit_1)
TEST_VECTOR_RNG(rng_monobit_2)
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors/fips_prf.c b/src/libstrongswan/plugins/test_vectors/test_vectors/fips_prf.c
new file mode 100644
index 000000000..74e000419
--- /dev/null
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors/fips_prf.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2009 Martin Willi
+ * 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>
+
+/**
+ * FIPS PRF known value test
+ */
+prf_test_vector_t fips_prf_1 = {
+ .alg = PRF_FIPS_SHA1_160, .stateful = TRUE, .key_size = 20, .len = 1,
+ .key = "\xbd\x02\x9b\xbe\x7f\x51\x96\x0b\xcf\x9e\xdb\x2b\x61\xf0\x6f\x0f"
+ "\xeb\x5a\x38\xb6",
+ .seed = "\x00",
+ .out = "\x20\x70\xb3\x22\x3d\xba\x37\x2f\xde\x1c\x0f\xfc\x7b\x2e\x3b\x49"
+ "\x8b\x26\x06\x14\x3c\x6c\x18\xba\xcb\x0f\x6c\x55\xba\xbb\x13\x78"
+ "\x8e\x20\xd7\x37\xa3\x27\x51\x16"
+};
+