Add a SHA1 test vector forcing padding over block boundary
authorMartin Willi <martin@revosec.ch>
Wed, 18 Jul 2012 10:28:16 +0000 (12:28 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 18 Jul 2012 13:10:29 +0000 (15:10 +0200)
src/libstrongswan/plugins/test_vectors/test_vectors.h
src/libstrongswan/plugins/test_vectors/test_vectors/sha1.c

index 40fb51d..a004697 100644 (file)
@@ -140,6 +140,7 @@ TEST_VECTOR_HASHER(md5_7)
 TEST_VECTOR_HASHER(sha1_1)
 TEST_VECTOR_HASHER(sha1_2)
 TEST_VECTOR_HASHER(sha1_3)
+TEST_VECTOR_HASHER(sha1_4)
 TEST_VECTOR_HASHER(sha224_1)
 TEST_VECTOR_HASHER(sha224_2)
 TEST_VECTOR_HASHER(sha224_3)
index 51f2271..669adf8 100644 (file)
@@ -49,3 +49,9 @@ hasher_test_vector_t sha1_3 = {
                          "\x2b\xad\x27\xb3"
 };
 
+hasher_test_vector_t sha1_4 = {
+       .alg = HASH_SHA1, .len = 62,
+       .data   = "12345678901234567890123456789012345678901234567890123456789012",
+       .hash   = "\xd8\xd0\x73\xb3\x83\x15\x66\x17\xc5\xca\xdf\x17\xf6\x15\x96\xa3"
+                         "\x84\x0a\xfd\x8b"
+};