Commit 25e2d2e6 authored by Niels Möller's avatar Niels Möller

Test sha512_224 and sha512_256.

parent 7aef18d3
2014-04-09 Niels Möller <nisse@lysator.liu.se> 2014-04-09 Niels Möller <nisse@lysator.liu.se>
* testsuite/sha512-224-test.c: New file.
* testsuite/sha512-256-test.c: New file.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added new files.
* nettle-meta.h (nettle_sha512_224, nettle_sha512_256): Declare. * nettle-meta.h (nettle_sha512_224, nettle_sha512_256): Declare.
* sha512-224-meta.c (nettle_sha512_224): New file, new nettle_hash. * sha512-224-meta.c (nettle_sha512_224): New file, new nettle_hash.
* sha512-256-meta.c (nettle_sha512_256): New file, new nettle_hash. * sha512-256-meta.c (nettle_sha512_256): New file, new nettle_hash.
......
...@@ -73,6 +73,12 @@ sha384-test$(EXEEXT): sha384-test.$(OBJEXT) ...@@ -73,6 +73,12 @@ sha384-test$(EXEEXT): sha384-test.$(OBJEXT)
sha512-test$(EXEEXT): sha512-test.$(OBJEXT) sha512-test$(EXEEXT): sha512-test.$(OBJEXT)
$(LINK) sha512-test.$(OBJEXT) $(TEST_OBJS) -o sha512-test$(EXEEXT) $(LINK) sha512-test.$(OBJEXT) $(TEST_OBJS) -o sha512-test$(EXEEXT)
sha512-224-test$(EXEEXT): sha512-224-test.$(OBJEXT)
$(LINK) sha512-224-test.$(OBJEXT) $(TEST_OBJS) -o sha512-224-test$(EXEEXT)
sha512-256-test$(EXEEXT): sha512-256-test.$(OBJEXT)
$(LINK) sha512-256-test.$(OBJEXT) $(TEST_OBJS) -o sha512-256-test$(EXEEXT)
sha3-permute-test$(EXEEXT): sha3-permute-test.$(OBJEXT) sha3-permute-test$(EXEEXT): sha3-permute-test.$(OBJEXT)
$(LINK) sha3-permute-test.$(OBJEXT) $(TEST_OBJS) -o sha3-permute-test$(EXEEXT) $(LINK) sha3-permute-test.$(OBJEXT) $(TEST_OBJS) -o sha3-permute-test$(EXEEXT)
...@@ -100,9 +106,6 @@ knuth-lfib-test$(EXEEXT): knuth-lfib-test.$(OBJEXT) ...@@ -100,9 +106,6 @@ knuth-lfib-test$(EXEEXT): knuth-lfib-test.$(OBJEXT)
cbc-test$(EXEEXT): cbc-test.$(OBJEXT) cbc-test$(EXEEXT): cbc-test.$(OBJEXT)
$(LINK) cbc-test.$(OBJEXT) $(TEST_OBJS) -o cbc-test$(EXEEXT) $(LINK) cbc-test.$(OBJEXT) $(TEST_OBJS) -o cbc-test$(EXEEXT)
ccm-test$(EXEEXT): ccm-test.$(OBJEXT)
$(LINK) ccm-test.$(OBJEXT) $(TEST_OBJS) -o ccm-test$(EXEEXT)
ctr-test$(EXEEXT): ctr-test.$(OBJEXT) ctr-test$(EXEEXT): ctr-test.$(OBJEXT)
$(LINK) ctr-test.$(OBJEXT) $(TEST_OBJS) -o ctr-test$(EXEEXT) $(LINK) ctr-test.$(OBJEXT) $(TEST_OBJS) -o ctr-test$(EXEEXT)
...@@ -112,6 +115,9 @@ gcm-test$(EXEEXT): gcm-test.$(OBJEXT) ...@@ -112,6 +115,9 @@ gcm-test$(EXEEXT): gcm-test.$(OBJEXT)
eax-test$(EXEEXT): eax-test.$(OBJEXT) eax-test$(EXEEXT): eax-test.$(OBJEXT)
$(LINK) eax-test.$(OBJEXT) $(TEST_OBJS) -o eax-test$(EXEEXT) $(LINK) eax-test.$(OBJEXT) $(TEST_OBJS) -o eax-test$(EXEEXT)
ccm-test$(EXEEXT): ccm-test.$(OBJEXT)
$(LINK) ccm-test.$(OBJEXT) $(TEST_OBJS) -o ccm-test$(EXEEXT)
poly1305-test$(EXEEXT): poly1305-test.$(OBJEXT) poly1305-test$(EXEEXT): poly1305-test.$(OBJEXT)
$(LINK) poly1305-test.$(OBJEXT) $(TEST_OBJS) -o poly1305-test$(EXEEXT) $(LINK) poly1305-test.$(OBJEXT) $(TEST_OBJS) -o poly1305-test$(EXEEXT)
......
...@@ -20,7 +20,7 @@ TS_NETTLE_SOURCES = aes-test.c arcfour-test.c arctwo-test.c \ ...@@ -20,7 +20,7 @@ TS_NETTLE_SOURCES = aes-test.c arcfour-test.c arctwo-test.c \
ripemd160-test.c \ ripemd160-test.c \
salsa20-test.c \ salsa20-test.c \
sha1-test.c sha224-test.c sha256-test.c \ sha1-test.c sha224-test.c sha256-test.c \
sha384-test.c sha512-test.c \ sha384-test.c sha512-test.c sha512-224-test.c sha512-256-test.c \
sha3-permute-test.c sha3-224-test.c sha3-256-test.c \ sha3-permute-test.c sha3-224-test.c sha3-256-test.c \
sha3-384-test.c sha3-512-test.c \ sha3-384-test.c sha3-512-test.c \
serpent-test.c twofish-test.c \ serpent-test.c twofish-test.c \
......
#include "testutils.h"
void
test_main(void)
{
/* From http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf */
test_hash(&nettle_sha512_224, SDATA("abc"),
SHEX("4634270F 707B6A54 DAAE7530 460842E2"
"0E37ED26 5CEEE9A4 3E8924AA"));
test_hash(&nettle_sha512_224, SDATA("abcdefghbcdefghicdefghijdefghijk"
"efghijklfghijklmghijklmnhijklmno"
"ijklmnopjklmnopqklmnopqrlmnopqrs"
"mnopqrstnopqrstu"),
SHEX("23FEC5BB 94D60B23 30819264 0B0C4533"
"35D66473 4FE40E72 68674AF9"));
}
#include "testutils.h"
void
test_main(void)
{
/* From http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf */
test_hash(&nettle_sha512_256, SDATA("abc"),
SHEX("53048E26 81941EF9 9B2E29B7 6B4C7DAB"
"E4C2D0C6 34FC6D46 E0E2F131 07E7AF23"));
test_hash(&nettle_sha512_256, SDATA("abcdefghbcdefghicdefghijdefghijk"
"efghijklfghijklmghijklmnhijklmno"
"ijklmnopjklmnopqklmnopqrlmnopqrs"
"mnopqrstnopqrstu"),
SHEX("3928E184 FB8690F8 40DA3988 121D31BE"
"65CB9D3E F83EE614 6FEAC861 E19B563A"));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment