[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[[UNIKRAFT/LIBNETTLE] v3 3/3] Adding the patches



The patch is required to be able to run the test suite.

Signed-off-by: cristian-vijelie <cristianvijelie@xxxxxxxxx>
---
 patches/0001-Made-the-tests-runnable.patch | 838 +++++++++++++++++++++
 1 file changed, 838 insertions(+)
 create mode 100644 patches/0001-Made-the-tests-runnable.patch

diff --git a/patches/0001-Made-the-tests-runnable.patch 
b/patches/0001-Made-the-tests-runnable.patch
new file mode 100644
index 0000000..463d0c8
--- /dev/null
+++ b/patches/0001-Made-the-tests-runnable.patch
@@ -0,0 +1,838 @@
+From fb889864b018eb3ceae9dad5328984367dcb3ef3 Mon Sep 17 00:00:00 2001
+From: cristian-vijelie <cristianvijelie@xxxxxxxxx>
+Date: Fri, 4 Dec 2020 14:09:40 +0200
+Subject: [PATCH] Made the tests runnable
+
+The test suite provided for libnettle has a test_main() function for each of
+the test files, that is used in testsuite.c, which contains the main function
+of the test suite. So, for each test, a new executable is built. This cannot
+happen in unikraft.
+
+This patch removes the main() function from testutils.c and renames each
+test_main() function from the test sources, so they all have different names.
+This way is possible to call all the functions from the testing app.
+
+Signed-off-by: Cristian Vijelie <cristianvijelie@xxxxxxxxx>
+---
+ aes-test.c    |  2 +-
+ arcfour-test.c       |  2 +-
+ arctwo-test.c |  2 +-
+ base16-test.c |  2 +-
+ base64-test.c |  2 +-
+ blowfish-test.c      |  2 +-
+ camellia-test.c      |  2 +-
+ cbc-test.c    |  2 +-
+ ccm-test.c    |  2 +-
+ cfb-test.c    |  2 +-
+ chacha-poly1305-test.c          |  2 +-
+ chacha-test.c |  2 +-
+ cmac-test.c   |  2 +-
+ ctr-test.c    |  2 +-
+ des-test.c    |  2 +-
+ des3-test.c   |  2 +-
+ eax-test.c    |  2 +-
+ gcm-test.c    |  2 +-
+ gosthash94-test.c    |  2 +-
+ hkdf-test.c   |  2 +-
+ hmac-test.c   |  2 +-
+ knuth-lfib-test.c    |  2 +-
+ md2-test.c    |  2 +-
+ md4-test.c    |  2 +-
+ md5-compat-test.c    |  2 +-
+ md5-test.c    |  2 +-
+ meta-aead-test.c     |  2 +-
+ meta-armor-test.c    |  2 +-
+ meta-cipher-test.c   |  2 +-
+ meta-hash-test.c     |  2 +-
+ meta-mac-test.c      |  2 +-
+ pbkdf2-test.c |  2 +-
+ poly1305-test.c      |  2 +-
+ ripemd160-test.c     |  2 +-
+ salsa20-test.c       |  2 +-
+ serpent-test.c       |  2 +-
+ sha1-huge-test.c     |  2 +-
+ sha1-test.c   |  2 +-
+ sha224-test.c |  2 +-
+ sha256-test.c |  2 +-
+ sha3-224-test.c      |  2 +-
+ sha3-256-test.c      |  2 +-
+ sha3-384-test.c      |  2 +-
+ sha3-512-test.c      |  2 +-
+ sha3-permute-test.c  |  2 +-
+ sha384-test.c |  2 +-
+ sha512-224-test.c    |  2 +-
+ sha512-256-test.c    |  2 +-
+ sha512-test.c |  2 +-
+ shake256-test.c      |  2 +-
+ testutils.c   | 21 -------------------
+ twofish-test.c       |  2 +-
+ umac-test.c   |  2 +-
+ xts-test.c    |  2 +-
+ yarrow-test.c |  2 +-
+ buffer-test.c  | 2 +-
+ cast128-test.c | 2 +-
+ 57 files changed, 56 insertions(+), 77 deletions(-)
+
+diff --git a/aes-test.c b/aes-test.c
+index 078bd67..3cd0140 100644
+--- a/aes-test.c
++++ b/aes-test.c
+@@ -116,7 +116,7 @@ test_cipher2(const struct nettle_cipher *c1,
+ }
+ 
+ void
+-test_main(void)
++test_main_aes(void)
+ {
+   /* Test both the new interface and the older unified interface. */
+ 
+diff --git a/arcfour-test.c b/arcfour-test.c
+index b2b039b..bfea126 100644
+--- a/arcfour-test.c
++++ b/arcfour-test.c
+@@ -68,7 +68,7 @@ test_arcfour(const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_arcfour(void)
+ {
+   test_arcfour(SHEX("01234567 89ABCDEF 00000000 00000000"),
+              SHEX("01234567 89ABCDEF"),
+diff --git a/arctwo-test.c b/arctwo-test.c
+index d91d522..78a8235 100644
+--- a/arctwo-test.c
++++ b/arctwo-test.c
+@@ -62,7 +62,7 @@ test_arctwo(unsigned ekb,
+ }
+ 
+ void
+-test_main(void)
++test_main_arctwo(void)
+ {
+   /* Test vectors from Peter Gutmann's paper. */
+   test_cipher(&nettle_arctwo_gutmann128,
+diff --git a/base16-test.c b/base16-test.c
+index 820915b..305b123 100644
+--- a/base16-test.c
++++ b/base16-test.c
+@@ -2,7 +2,7 @@
+ #include "base16.h"
+ 
+ void
+-test_main(void)
++test_main_base16(void)
+ {
+   ASSERT(BASE16_ENCODE_LENGTH(0) == 0);
+   ASSERT(BASE16_ENCODE_LENGTH(1) == 2);
+diff --git a/base64-test.c b/base64-test.c
+index cc45c47..3522277 100644
+--- a/base64-test.c
++++ b/base64-test.c
+@@ -81,7 +81,7 @@ base64_decode_in_place (struct base64_decode_ctx *ctx, 
size_t *dst_length,
+ }
+ 
+ void
+-test_main(void)
++test_main_base64(void)
+ {
+   ASSERT(BASE64_ENCODE_LENGTH(0) == 0);   /* At most   4 bits */
+   ASSERT(BASE64_ENCODE_LENGTH(1) == 2);   /* At most  12 bits */
+diff --git a/blowfish-test.c b/blowfish-test.c
+index cadeda5..eeb91e5 100644
+--- a/blowfish-test.c
++++ b/blowfish-test.c
+@@ -46,7 +46,7 @@ test_blowfish(const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_blowfish(void)
+ {
+   /* 208 bit key. Test from GNUPG. */
+   test_blowfish(SDATA("abcdefghijklmnopqrstuvwxyz"),
+diff --git a/camellia-test.c b/camellia-test.c
+index f6c850a..fbd4858 100644
+--- a/camellia-test.c
++++ b/camellia-test.c
+@@ -73,7 +73,7 @@ test_invert(const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_camellia(void)
+ {
+   /* Test vectors from RFC 3713 */
+   /* 128 bit keys */
+diff --git a/cbc-test.c b/cbc-test.c
+index 9394f1c..96bf81c 100644
+--- a/cbc-test.c
++++ b/cbc-test.c
+@@ -65,7 +65,7 @@ test_cbc_bulk(void)
+ }
+ 
+ void
+-test_main(void)
++test_main_cbc(void)
+ {
+   /* Intermediate values:
+    *   iv XOR first message block:
+diff --git a/ccm-test.c b/ccm-test.c
+index 4176cc7..a1d0245 100644
+--- a/ccm-test.c
++++ b/ccm-test.c
+@@ -249,7 +249,7 @@ test_cipher_ccm(const struct nettle_cipher *cipher,
+ }
+ 
+ void
+-test_main(void)
++test_main_ccm(void)
+ {
+   /* Create a pattern of 00010203 04050607 08090a00b 0c0d0e0f ... */
+   struct tstring *adata;
+diff --git a/cfb-test.c b/cfb-test.c
+index dbb24e8..f99be6c 100644
+--- a/cfb-test.c
++++ b/cfb-test.c
+@@ -123,7 +123,7 @@ test_cfb8_bulk(void)
+ }
+ 
+ void
+-test_main(void)
++test_main_cfb(void)
+ {
+   /* From NIST spec 800-38a on AES modes.
+    *
+diff --git a/chacha-poly1305-test.c b/chacha-poly1305-test.c
+index 313e822..5afb54b 100644
+--- a/chacha-poly1305-test.c
++++ b/chacha-poly1305-test.c
+@@ -2,7 +2,7 @@
+ #include "nettle-internal.h"
+ 
+ void
+-test_main(void)
++test_main_chacha_poly1305(void)
+ {
+   /* From draft-irtf-cfrg-chacha20-poly1305-08 */
+   test_aead (&nettle_chacha_poly1305, NULL,
+diff --git a/chacha-test.c b/chacha-test.c
+index fb8f1db..d5bdd08 100644
+--- a/chacha-test.c
++++ b/chacha-test.c
+@@ -153,7 +153,7 @@ test_chacha_with_counter(const struct tstring *key, const 
struct tstring *nonce,
+ }
+ 
+ void
+-test_main(void)
++test_main_chacha(void)
+ {
+   /* Test vectors from draft-strombergson-chacha-test-vectors */
+ #if 0
+diff --git a/cmac-test.c b/cmac-test.c
+index a71baa0..b37efb1 100644
+--- a/cmac-test.c
++++ b/cmac-test.c
+@@ -12,7 +12,7 @@
+   test_mac(&nettle_cmac_des3, key, msg, ref)
+ 
+ void
+-test_main(void)
++test_main_cmac(void)
+ {
+   /*
+    * CMAC-AES Test Vectors from RFC4493.
+diff --git a/ctr-test.c b/ctr-test.c
+index 28f9c38..f9729de 100644
+--- a/ctr-test.c
++++ b/ctr-test.c
+@@ -2,7 +2,7 @@
+ #include "nettle-internal.h"
+ 
+ void
+-test_main(void)
++test_main_ctr(void)
+ {
+   /* From NIST spec 800-38a on AES modes,
+    *
+diff --git a/des-test.c b/des-test.c
+index a9c0eb9..bb3e4c8 100644
+--- a/des-test.c
++++ b/des-test.c
+@@ -63,7 +63,7 @@ test_weak(const struct tstring *key)
+ }
+ 
+ void
+-test_main(void)
++test_main_des(void)
+ {
+   /* From Applied Cryptography */
+   test_des(SHEX("01234567 89ABCDEF"), 1,
+diff --git a/des3-test.c b/des3-test.c
+index f0437ff..d806a75 100644
+--- a/des3-test.c
++++ b/des3-test.c
+@@ -3,7 +3,7 @@
+ #include "des.h"
+ 
+ void
+-test_main(void)
++test_main_des3(void)
+ {
+   /* Intermediate values:
+    *   After first DES encryption:  "cd ea 2a 20 c2 e0 9e 48"
+diff --git a/eax-test.c b/eax-test.c
+index f516df6..9e74c63 100644
+--- a/eax-test.c
++++ b/eax-test.c
+@@ -2,7 +2,7 @@
+ #include "nettle-internal.h"
+ 
+ void
+-test_main(void)
++test_main_eax(void)
+ {
+   /* From the EAX specification,
+      http://www.cs.ucdavis.edu/~rogaway/papers/eax.pdf */
+diff --git a/gcm-test.c b/gcm-test.c
+index c817401..9567668 100644
+--- a/gcm-test.c
++++ b/gcm-test.c
+@@ -57,7 +57,7 @@ nettle_gcm_unified_aes128 = {
+     
+ 
+ void
+-test_main(void)
++test_main_gcm(void)
+ {
+   /* 
+    * GCM-AES Test Vectors from
+diff --git a/gosthash94-test.c b/gosthash94-test.c
+index d4e5015..f3a971e 100644
+--- a/gosthash94-test.c
++++ b/gosthash94-test.c
+@@ -4,7 +4,7 @@
+ /* Using test vectors from Wikipedia article on GOST */
+ 
+ void
+-test_main(void)
++test_main_gosthash94(void)
+ {
+   test_hash(&nettle_gosthash94, SDATA("The quick brown fox jumps over the 
lazy dog"),
+           
SHEX("77b7fa410c9ac58a25f49bca7d0468c9296529315eaca76bd1a10f376d1f4294"));
+diff --git a/hkdf-test.c b/hkdf-test.c
+index 80f4c81..788c281 100644
+--- a/hkdf-test.c
++++ b/hkdf-test.c
+@@ -96,7 +96,7 @@ test_hkdf_sha1(const struct tstring *ikm,
+ }
+ 
+ void
+-test_main(void)
++test_main_hkdf(void)
+ {
+   /* HKDF test vectors from RFC5869 */
+   test_hkdf_sha256(SHEX("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"),
+diff --git a/hmac-test.c b/hmac-test.c
+index de1b6bf..1758903 100644
+--- a/hmac-test.c
++++ b/hmac-test.c
+@@ -14,7 +14,7 @@
+   } while (0)
+ 
+ void
+-test_main(void)
++test_main_hmac(void)
+ {
+   /* sha512's digests are longest */
+   uint8_t digest[SHA512_DIGEST_SIZE+1];
+diff --git a/knuth-lfib-test.c b/knuth-lfib-test.c
+index 3e8bfdd..38fdfa0 100644
+--- a/knuth-lfib-test.c
++++ b/knuth-lfib-test.c
+@@ -2,7 +2,7 @@
+ #include "knuth-lfib.h"
+ 
+ void
+-test_main(void)
++test_main_knuth(void)
+ {
+   struct knuth_lfib_ctx ctx;
+ 
+diff --git a/md2-test.c b/md2-test.c
+index af14857..239e751 100644
+--- a/md2-test.c
++++ b/md2-test.c
+@@ -2,7 +2,7 @@
+ #include "md2.h"
+ 
+ void
+-test_main(void)
++test_main_md2(void)
+ {
+   /* Testcases from RFC 1319 */
+   test_hash(&nettle_md2, SDATA(""),
+diff --git a/md4-test.c b/md4-test.c
+index d46693d..928129b 100644
+--- a/md4-test.c
++++ b/md4-test.c
+@@ -2,7 +2,7 @@
+ #include "md4.h"
+ 
+ void
+-test_main(void)
++test_main_md4(void)
+ {
+   /* Testcases from RFC 1320 */
+   test_hash(&nettle_md4, SDATA(""),
+diff --git a/md5-compat-test.c b/md5-compat-test.c
+index e223400..7d13ea1 100644
+--- a/md5-compat-test.c
++++ b/md5-compat-test.c
+@@ -2,7 +2,7 @@
+ #include "md5-compat.h"
+ 
+ void
+-test_main(void)
++test_main_md5_compat(void)
+ {
+   MD5_CTX ctx;
+   unsigned char digest[MD5_DIGEST_SIZE];
+diff --git a/md5-test.c b/md5-test.c
+index 37c2fb1..6eed05e 100644
+--- a/md5-test.c
++++ b/md5-test.c
+@@ -2,7 +2,7 @@
+ #include "md5.h"
+ 
+ void
+-test_main(void)
++test_main_md5(void)
+ {
+   test_hash(&nettle_md5, SDATA(""),
+           SHEX("D41D8CD98F00B204 E9800998ECF8427E"));
+diff --git a/meta-aead-test.c b/meta-aead-test.c
+index 1fcede4..e402720 100644
+--- a/meta-aead-test.c
++++ b/meta-aead-test.c
+@@ -13,7 +13,7 @@ const char* aeads[] = {
+ };
+ 
+ void
+-test_main(void)
++test_main_meta_aead(void)
+ {
+   int i,j;
+   int count = sizeof(aeads)/sizeof(*aeads);
+diff --git a/meta-armor-test.c b/meta-armor-test.c
+index 406c8d0..4c21585 100644
+--- a/meta-armor-test.c
++++ b/meta-armor-test.c
+@@ -8,7 +8,7 @@ const char* armors[] = {
+ };
+ 
+ void
+-test_main(void)
++test_main_meta_armor(void)
+ {
+   int i,j;
+   int count = sizeof(armors)/sizeof(*armors);
+diff --git a/meta-cipher-test.c b/meta-cipher-test.c
+index f949fd7..883a19a 100644
+--- a/meta-cipher-test.c
++++ b/meta-cipher-test.c
+@@ -22,7 +22,7 @@ const char* ciphers[] = {
+ };
+ 
+ void
+-test_main(void)
++test_main_meta_ciphers(void)
+ {
+   int i,j;
+   int count = sizeof(ciphers)/sizeof(*ciphers);
+diff --git a/meta-hash-test.c b/meta-hash-test.c
+index 7d863a7..95c79af 100644
+--- a/meta-hash-test.c
++++ b/meta-hash-test.c
+@@ -23,7 +23,7 @@ const char* hashes[] = {
+ };
+ 
+ void
+-test_main(void)
++test_main_meta_hash(void)
+ {
+   int i;
+   int count = sizeof(hashes)/sizeof(*hashes);
+diff --git a/meta-mac-test.c b/meta-mac-test.c
+index 5533944..8fb11c3 100644
+--- a/meta-mac-test.c
++++ b/meta-mac-test.c
+@@ -15,7 +15,7 @@ const char* macs[] = {
+ };
+ 
+ void
+-test_main(void)
++test_main_meta_mac(void)
+ {
+   int i, j;
+   int count = sizeof(macs)/sizeof(*macs);
+diff --git a/pbkdf2-test.c b/pbkdf2-test.c
+index e64a20d..90f42ce 100644
+--- a/pbkdf2-test.c
++++ b/pbkdf2-test.c
+@@ -22,7 +22,7 @@
+ #define MAX_DKLEN SHA512_DIGEST_SIZE
+ 
+ void
+-test_main (void)
++test_main_pbkdf2 (void)
+ {
+   uint8_t dk[MAX_DKLEN + 1];
+   struct hmac_sha1_ctx sha1ctx;
+diff --git a/poly1305-test.c b/poly1305-test.c
+index ee70b3c..c580a13 100644
+--- a/poly1305-test.c
++++ b/poly1305-test.c
+@@ -52,7 +52,7 @@ test_poly1305 (const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_poly1305(void)
+ {
+   /* From Bernstein's paper. */
+   test_poly1305
+diff --git a/ripemd160-test.c b/ripemd160-test.c
+index 85518e6..c3f5d4c 100644
+--- a/ripemd160-test.c
++++ b/ripemd160-test.c
+@@ -2,7 +2,7 @@
+ #include "ripemd160.h"
+ 
+ void
+-test_main(void)
++test_main_ripemd160(void)
+ {
+   test_hash(&nettle_ripemd160, SDATA(""),
+           SHEX("9c1185a5c5e9fc54612808977ee8f548b2258d31"));
+diff --git a/salsa20-test.c b/salsa20-test.c
+index 3a1b8ea..07f7284 100644
+--- a/salsa20-test.c
++++ b/salsa20-test.c
+@@ -189,7 +189,7 @@ _test_salsa20(salsa20_func *crypt,
+ 
+   
+ void
+-test_main(void)
++test_main_salsa20(void)
+ {
+   /* 
http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/reduced/12-rounds/verified.test-vectors?logsort=rev&rev=210&view=markup
 */
+   test_salsa20r12(SHEX("80000000 00000000 00000000 00000000"),
+diff --git a/serpent-test.c b/serpent-test.c
+index 4b89a1e..dd3c354 100644
+--- a/serpent-test.c
++++ b/serpent-test.c
+@@ -67,7 +67,7 @@ test_serpent(const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_serpent(void)
+ {
+   /* From libgcrypt */
+   test_cipher(&nettle_serpent128,
+diff --git a/sha1-huge-test.c b/sha1-huge-test.c
+index 156a762..9898187 100644
+--- a/sha1-huge-test.c
++++ b/sha1-huge-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha1_huge(void)
+ {
+   /* Hashes 10 000 000 x 30 000 bytes > 64 * 2^32. This overflows the
+      low word of the block counter. This test vector is not cross
+diff --git a/sha1-test.c b/sha1-test.c
+index 8356555..d47b055 100644
+--- a/sha1-test.c
++++ b/sha1-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha1(void)
+ {
+   test_hash(&nettle_sha1, SDATA(""),
+           SHEX("DA39A3EE5E6B4B0D 3255BFEF95601890 AFD80709")); 
+diff --git a/sha224-test.c b/sha224-test.c
+index eb20c30..1731081 100644
+--- a/sha224-test.c
++++ b/sha224-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha224(void)
+ {
+   /* From FIPS180-2 addendum
+      
(http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf)
 */
+diff --git a/sha256-test.c b/sha256-test.c
+index 551b140..664f894 100644
+--- a/sha256-test.c
++++ b/sha256-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha256(void)
+ {
+   /* From FIPS180-2 */
+   test_hash(&nettle_sha256, SDATA("abc"),
+diff --git a/sha3-224-test.c b/sha3-224-test.c
+index 627f4cb..39229f0 100644
+--- a/sha3-224-test.c
++++ b/sha3-224-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha3_224(void)
+ {
+   /* Extracted from ShortMsgKAT_224.txt using sha3.awk. */
+   test_hash(&nettle_sha3_224, /* 0 octets */
+diff --git a/sha3-256-test.c b/sha3-256-test.c
+index f0dad08..ee4c249 100644
+--- a/sha3-256-test.c
++++ b/sha3-256-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha3_256(void)
+ {
+   /* Extracted from ShortMsgKAT_256.txt using sha3.awk. */
+   test_hash(&nettle_sha3_256, /* 0 octets */
+diff --git a/sha3-384-test.c b/sha3-384-test.c
+index e973cf8..af30e31 100644
+--- a/sha3-384-test.c
++++ b/sha3-384-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha3_384(void)
+ {
+   /* Extracted from ShortMsgKAT_384.txt using sha3.awk. */
+   test_hash(&nettle_sha3_384, /* 0 octets */
+diff --git a/sha3-512-test.c b/sha3-512-test.c
+index b323a7f..7a42039 100644
+--- a/sha3-512-test.c
++++ b/sha3-512-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha3_512(void)
+ {
+   /* Extracted from ShortMsgKAT_512.txt using sha3.awk. */
+   test_hash(&nettle_sha3_512, /* 0 octets */
+diff --git a/sha3-permute-test.c b/sha3-permute-test.c
+index 1e4e9de..c2d65cd 100644
+--- a/sha3-permute-test.c
++++ b/sha3-permute-test.c
+@@ -17,7 +17,7 @@ display (const struct sha3_state *state)
+ }
+ 
+ void
+-test_main(void)
++test_main_sha3_permute(void)
+ {
+   /* From KeccakPermutationIntermediateValues.txt */
+   static const struct sha3_state s1 =
+diff --git a/sha384-test.c b/sha384-test.c
+index 13a0214..88a43da 100644
+--- a/sha384-test.c
++++ b/sha384-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha384(void)
+ {
+   test_hash(&nettle_sha384, SDATA("abc"),
+           SHEX("cb00753f45a35e8b b5a03d699ac65007"
+diff --git a/sha512-224-test.c b/sha512-224-test.c
+index 6b81184..7517477 100644
+--- a/sha512-224-test.c
++++ b/sha512-224-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha512_224(void)
+ {
+   /* From 
http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf */
+   test_hash(&nettle_sha512_224, SDATA("abc"),
+diff --git a/sha512-256-test.c b/sha512-256-test.c
+index c0613ed..539408a 100644
+--- a/sha512-256-test.c
++++ b/sha512-256-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha512_256(void)
+ {
+   /* From 
http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf */
+   test_hash(&nettle_sha512_256, SDATA("abc"),
+diff --git a/sha512-test.c b/sha512-test.c
+index c501e09..f7ed230 100644
+--- a/sha512-test.c
++++ b/sha512-test.c
+@@ -1,7 +1,7 @@
+ #include "testutils.h"
+ 
+ void
+-test_main(void)
++test_main_sha512(void)
+ {
+   test_hash(&nettle_sha512, SDATA("abc"),
+           SHEX("ddaf35a193617aba cc417349ae204131"
+diff --git a/shake256-test.c b/shake256-test.c
+index b91417c..3feace8 100644
+--- a/shake256-test.c
++++ b/shake256-test.c
+@@ -46,7 +46,7 @@ const struct nettle_hash nettle_shake256 =
+   };
+ 
+ void
+-test_main(void)
++test_main_shake256(void)
+ {
+   /* Extracted from ShortMsgKAT_SHAKE256.txt. */
+   test_hash (&nettle_shake256, /* 0 octets */
+diff --git a/testutils.c b/testutils.c
+index 1f279e9..a0dae33 100644
+--- a/testutils.c
++++ b/testutils.c
+@@ -117,27 +117,6 @@ print_hex(size_t length, const uint8_t *data)
+ 
+ int verbose = 0;
+ 
+-int
+-main(int argc, char **argv)
+-{
+-  if (argc > 1)
+-    {
+-      if (argc == 2 && !strcmp(argv[1], "-v"))
+-      verbose = 1;
+-      else
+-      {
+-        fprintf(stderr, "Invalid argument `%s', only accepted option is 
`-v'.\n",
+-                argv[1]);
+-        return 1;
+-      }
+-    }
+-
+-  test_main();
+-
+-  tstring_clear();
+-  return EXIT_SUCCESS;
+-}
+-
+ void
+ test_cipher(const struct nettle_cipher *cipher,
+           const struct tstring *key,
+diff --git a/twofish-test.c b/twofish-test.c
+index 2bef44c..187ac46 100644
+--- a/twofish-test.c
++++ b/twofish-test.c
+@@ -2,7 +2,7 @@
+ #include "twofish.h"
+ 
+ void
+-test_main(void)
++test_main_twofish(void)
+ {
+   /* 128 bit key */
+   test_cipher(&nettle_twofish128,
+diff --git a/umac-test.c b/umac-test.c
+index 0fb97cb..af42b2e 100644
+--- a/umac-test.c
++++ b/umac-test.c
+@@ -211,7 +211,7 @@ test_incr (const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_umac(void)
+ {
+   /* From RFC 4418 (except that it lacks the last 32 bits of 128-bit
+      tags) */
+diff --git a/xts-test.c b/xts-test.c
+index 723a5a1..49e66f2 100644
+--- a/xts-test.c
++++ b/xts-test.c
+@@ -108,7 +108,7 @@ test_cipher_xts(const struct nettle_cipher *cipher,
+ }
+ 
+ void
+-test_main(void)
++test_main_xts(void)
+ {
+   /* From NIST CAVS 11.0,
+    *
+diff --git a/yarrow-test.c b/yarrow-test.c
+index facc4fd..57a05b5 100644
+--- a/yarrow-test.c
++++ b/yarrow-test.c
+@@ -59,7 +59,7 @@ open_file(const char *name)
+ }
+ 
+ void
+-test_main(void)
++test_main_yarrow(void)
+ {
+   FILE *input;
+   
+diff --git a/buffer-test.c b/buffer-test.c
+index fe2e222..7585054 100644
+--- a/buffer-test.c
++++ b/buffer-test.c
+@@ -2,7 +2,7 @@
+ #include "buffer.h"
+ 
+ void
+-test_main(void)
++test_main_buffer(void)
+ {
+   struct nettle_buffer buffer;
+   uint8_t s[5];
+diff --git a/cast128-test.c b/cast128-test.c
+index 534eb17..af171a6 100644
+--- a/cast128-test.c
++++ b/cast128-test.c
+@@ -45,7 +45,7 @@ test_cast5(const struct tstring *key,
+ }
+ 
+ void
+-test_main(void)
++test_main_cast128(void)
+ {
+   /* Test vectors from B.1. Single Plaintext-Key-Ciphertext Sets, RFC
+    * 2144 */
+-- 
+2.25.1
+
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.