Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
libdef/libecc: update to latest version
Baptiste Daroussin committed 21 days ago
commit a5a5bf94fd508acc704cf1bb127689fdb823f373
parent a0d2bc9
17 files changed +179 -100
modified external/libder/derdump/derdump.c
@@ -6,6 +6,7 @@

#include <err.h>
#include <stdio.h>
+
#include <string.h>

#include <libder.h>

@@ -26,10 +27,14 @@ main(int argc, char *argv[])
	ctx = libder_open();
	libder_set_verbose(ctx, 2);
	for (int i = 1; i < argc; i++) {
-
		fp = fopen(argv[i], "rb");
-
		if (fp == NULL) {
-
			warn("%s", argv[i]);
-
			continue;
+
		if (strcmp(argv[i], "-") == 0) {
+
			fp = stdin;
+
		} else {
+
			fp = fopen(argv[i], "rb");
+
			if (fp == NULL) {
+
				warn("%s", argv[i]);
+
				continue;
+
			}
		}

		if (!first)
@@ -43,7 +48,8 @@ main(int argc, char *argv[])
		}

		first = false;
-
		fclose(fp);
+
		if (fp != stdin)
+
			fclose(fp);
	}

	libder_close(ctx);
modified external/libder/libder/libder_obj.c
@@ -276,7 +276,7 @@ libder_obj_unlink(struct libder_object *obj)
			else
				prev->next = child->next;
			parent->nchildren--;
-
			child->parent = NULL;
+
			child->parent = child->next = NULL;
			return;
		}

@@ -296,9 +296,13 @@ libder_obj_append(struct libder_object *parent, struct libder_object *child)

	/* XXX Type check */

-
	if (child->parent != NULL)
+
	if (child->parent != NULL) {
		libder_obj_unlink(child);

+
		assert(child->next == NULL);
+
	}
+

+
	child->parent = parent;
	if (parent->nchildren == 0) {
		parent->children = child;
		parent->nchildren++;
@@ -313,7 +317,6 @@ libder_obj_append(struct libder_object *parent, struct libder_object *child)
	assert(end != NULL);
	end->next = child;
	parent->nchildren++;
-
	child->parent = parent;
	return (true);
}

@@ -717,6 +720,8 @@ libder_obj_coalesce_children(struct libder_object *obj, struct libder_ctx *ctx)

	last_child = NULL;
	DER_FOREACH_CHILD(child, obj) {
+
		size_t disk_size;
+

		/* Sanity check and coalesce our children. */
		if (child->type->tag_class != BC_UNIVERSAL ||
		    child->type->tag_short != obj->type->tag_short) {
@@ -733,18 +738,18 @@ libder_obj_coalesce_children(struct libder_object *obj, struct libder_ctx *ctx)
		 * disk size sans header in its disk_size to reuse in the later
		 * loop.
		 */
-
		child->disk_size = libder_obj_disk_size(child, false);
+
		disk_size = child->disk_size = libder_obj_disk_size(child, false);

		/*
		 * We strip the lead byte off of every element, and add it back
		 * in pre-allocation.
		 */
-
		if (type == BT_BITSTRING && child->disk_size > 1)
-
			child->disk_size--;
-
		if (child->disk_size > 0)
+
		if (type == BT_BITSTRING && disk_size > 1)
+
			disk_size--;
+
		if (disk_size > 0)
			last_child = child;

-
		new_size += child->disk_size;
+
		new_size += disk_size;

		if (child->payload != NULL)
			need_payload = true;
@@ -781,7 +786,6 @@ libder_obj_coalesce_children(struct libder_object *obj, struct libder_ctx *ctx)

		if (child->disk_size != 0 && need_payload) {
			assert(coalesced_data != NULL);
-
			assert(offset + child->disk_size <= new_size);

			/*
			 * Bit strings are special, in that the first byte
@@ -789,6 +793,7 @@ libder_obj_coalesce_children(struct libder_object *obj, struct libder_ctx *ctx)
			 * need to trim that off when concatenating bit strings
			 */
			if (type == BT_BITSTRING) {
+
				assert(offset + child->disk_size - 1 <= new_size);
				if (ctx->strict && child != last_child &&
				    child->disk_size > 1 && child->payload != NULL) {
					/*
@@ -805,6 +810,8 @@ libder_obj_coalesce_children(struct libder_object *obj, struct libder_ctx *ctx)
				offset += libder_merge_bitstrings(coalesced_data,
				    offset, new_size, child);
			} else {
+
				assert(offset + child->disk_size <= new_size);
+

				/*
				 * Write zeroes out if we don't have a payload.
				 */
@@ -893,6 +900,10 @@ libder_obj_normalize_boolean(struct libder_object *obj)

	payload[0] = sense != 0 ? 0xff : 0x00;
	obj->length = 1;
+

+
	if (length > 1)
+
		libder_bzero(&obj->payload[1], length - 1);
+

	return (true);
}

@@ -931,6 +942,8 @@ libder_obj_normalize_integer(struct libder_object *obj)

		memmove(&obj->payload[0], payload, length);
		obj->length = length;
+

+
		libder_bzero(&obj->payload[length], strip);
	}

	return (true);
@@ -952,7 +965,7 @@ libder_obj_tag_compare(const struct libder_tag *lhs, const struct libder_tag *rh
	/* Next bit: constructed vs. primitive */
	if (!lhs->tag_constructed && rhs->tag_constructed)
		return (-1);
-
	if (lhs->tag_constructed && rhs->tag_constructed)
+
	if (lhs->tag_constructed && !rhs->tag_constructed)
		return (1);

	/*
@@ -1001,7 +1014,7 @@ libder_obj_tag_compare(const struct libder_tag *lhs, const struct libder_tag *rh
		if (lbyte < rbyte)
			return (-1);
		else if (lbyte > rbyte)
-
			return (-1);
+
			return (1);
	}

	return (0);
modified external/libder/libder/libder_private.h
@@ -83,7 +83,7 @@ static inline void
libder_clear_abort(struct libder_ctx *ctx)
{

-
	ctx->abort = 1;
+
	ctx->abort = 0;
}

#define	LIBDER_PRIVATE	__attribute__((__visibility__("hidden")))
@@ -117,7 +117,7 @@ libder_type_is(const struct libder_tag *type, uint8_t utype)

	if (type->tag_class != BC_UNIVERSAL || type->tag_encoded)
		return (false);
-
	if ((utype & BER_TYPE_CONSTRUCTED_MASK) != type->tag_constructed)
+
	if (!!(utype & BER_TYPE_CONSTRUCTED_MASK) != type->tag_constructed)
		return (false);

	utype &= ~BER_TYPE_CONSTRUCTED_MASK;
modified external/libder/libder/libder_write.c
@@ -177,6 +177,7 @@ libder_write(struct libder_ctx *ctx, struct libder_object *root, uint8_t *buf,
{
	struct memory_write_data mwrite = { 0 };
	size_t needed;
+
	bool bufalloc = false;

	/*
	 * We shouldn't really see buf == NULL with *bufsz != 0 or vice-versa.
@@ -204,6 +205,7 @@ libder_write(struct libder_ctx *ctx, struct libder_object *root, uint8_t *buf,
		buf = malloc(needed);
		if (buf == NULL)
			return (NULL);
+
		bufalloc = true;
	} else if (needed > *bufsz) {
		*bufsz = needed;
		return (NULL);	/* Insufficient space */
@@ -214,7 +216,8 @@ libder_write(struct libder_ctx *ctx, struct libder_object *root, uint8_t *buf,
	mwrite.bufsz = *bufsz;
	if (!libder_write_object(ctx, root, &memory_write, &mwrite)) {
		libder_bzero(mwrite.buf, mwrite.offset);
-
		free(buf);
+
		if (bufalloc)
+
			free(buf);
		return (NULL);	/* XXX Error */
	}

modified external/libder/tests/fuzz_stream.c
@@ -34,7 +34,7 @@ supply_thread(void *data)
	do {
		writesz = write(sdata->socket, sdata->data, sz);

-
		data += writesz;
+
		sdata->data += writesz;
		sz -= writesz;
	} while (sz != 0 && writesz > 0);

modified external/libder/tests/make_corpus.c
@@ -82,7 +82,7 @@ write_one(const struct fuzz_params *params, const struct seed *seed, int dirfd,
	else
		assert(write(fd, &params->strict, sizeof(params->strict)) == sizeof(params->strict));

-
	assert(write(fd, seed->seed_seq, seed->seed_seqsz) == seed->seed_seqsz);
+
	assert((size_t)write(fd, seed->seed_seq, seed->seed_seqsz) == seed->seed_seqsz);

	free(name);
	close(fd);
modified external/libder/tests/test_privkey.c
@@ -68,7 +68,6 @@ test_construction(struct libder_ctx *ctx, const uint8_t *buf, size_t bufsz)
{
	uint8_t *out;
	struct libder_object *obj, *oidp, *pubp, *root;
-
	struct libder_object *keystring;
	size_t outsz;
	uint8_t data;

@@ -129,6 +128,7 @@ main(int argc, char *argv[])
	ssize_t readsz;
	int dfd, error, fd;

+
	(void)argc;
	dfd = open_progdir(argv[0]);

	fd = openat(dfd, "repo.priv", O_RDONLY);
@@ -147,7 +147,7 @@ main(int argc, char *argv[])
	readsz = read(fd, buf, bufsz);
	close(fd);

-
	assert(readsz == bufsz);
+
	assert((size_t)readsz == bufsz);

	ctx = libder_open();
	rootsz = bufsz;
modified external/libder/tests/test_pubkey.c
@@ -97,6 +97,7 @@ main(int argc, char *argv[])
	ssize_t readsz;
	int dfd, error, fd;

+
	(void)argc;
	dfd = open_progdir(argv[0]);

	fd = openat(dfd, "repo.pub", O_RDONLY);
@@ -115,7 +116,7 @@ main(int argc, char *argv[])
	readsz = read(fd, buf, bufsz);
	close(fd);

-
	assert(readsz == bufsz);
+
	assert((size_t)readsz == bufsz);

	ctx = libder_open();
	rootsz = bufsz;
modified external/libecc/include/libecc/nn/nn_logical.h
@@ -16,6 +16,10 @@
#ifndef __LOGICAL_H__
#define __LOGICAL_H__
#include <libecc/nn/nn.h>
+
/*
+
 * Used for the get bit masking.
+
 */
+
#include <libecc/utils/utils_rand.h>

ATTRIBUTE_WARN_UNUSED_RET int nn_rshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt);
ATTRIBUTE_WARN_UNUSED_RET int nn_rshift(nn_t out, nn_src_t in, bitcnt_t cnt);
@@ -30,5 +34,49 @@ ATTRIBUTE_WARN_UNUSED_RET int nn_not(nn_t B, nn_src_t A);
ATTRIBUTE_WARN_UNUSED_RET int nn_clz(nn_src_t A, bitcnt_t *lz);
ATTRIBUTE_WARN_UNUSED_RET int nn_bitlen(nn_src_t A, bitcnt_t *blen);
ATTRIBUTE_WARN_UNUSED_RET int nn_getbit(nn_src_t in, bitcnt_t bit, u8 *bitval);
+
/*
+
 * This is a masked version to be used in sensitive contexts.
+
 * This directly returns the bit value after some masking.
+
 * The input retval contains the return status: 0 on success and -1 on error.
+
 * The output is meaningless in case of error.
+
 */
+
ATTRIBUTE_WARN_UNUSED_RET static inline word_t nn_getbit_masked(nn_src_t in, bitcnt_t bit, int *retval)
+
{
+
        bitcnt_t widx = bit / WORD_BITS;
+
        u8 bidx = bit % WORD_BITS;
+
        word_t r;
+
        /* NOTE: volatile to avoid optimization by the compiler */
+
        volatile word_t r_mask = 0;
+
        volatile word_t shift = 1;
+
        int ret;
+

+
        /* Sanity check */
+
        ret = nn_check_initialized(in); EG(ret, err);
+
        MUST_HAVE((bit < NN_MAX_BIT_LEN), ret, err);
+
        MUST_HAVE((retval != NULL), ret, err);
+

+
        /* Get a random value for masking */
+
        ret = get_unsafe_random((u8*)&r, sizeof(r));
+
        r_mask = r;
+

+
err:
+
        if(retval != NULL){
+
                (*retval) = ret;
+
        }
+
        if(!ret){
+
                /* bidx is less than WORD_BITS so shift operations below are ok */
+
                REGISTER word_t a = ((word_t)(in->val[widx] ^ r_mask) >> bidx);
+
                REGISTER word_t b = (word_t)(r_mask >> bidx);
+
                REGISTER word_t c = (word_t)((a >> shift) << shift);
+
                REGISTER word_t d = (word_t)((b >> shift) << shift);
+
                a ^= c;
+
                b ^= d;
+
                return (a ^ b);
+
        }
+
        else{
+
                return 0;
+
        }
+
}
+


#endif /* __LOGICAL_H__ */
modified external/libecc/include/libecc/words/types.h
@@ -52,6 +52,14 @@
 */
#define FORCE_USED_VAR(a) ((void)(a))

+
#ifndef __cplusplus
+
#define REGISTER register
+
#else
+
/* NOTE: the 'register' keyword is not allowed in C++, so
+
 * we avoid its usage there. */
+
#define REGISTER
+
#endif
+

/*** Handling the types ****/
#ifdef WITH_STDLIB

modified external/libecc/src/arithmetic_tests/arithmetic_tests.c
@@ -1222,7 +1222,7 @@ int main(int argc, char *argv[])

	return 0;
err:
-
	printf("Error: critical error occurred! Leaving ...\n");
+
	printf("Error: critical error occured! Leaving ...\n");
	if(fd != 0){
		close(fd);
	}
modified external/libecc/src/curves/prj_pt.c
@@ -1319,7 +1319,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_dbl_add_always(prj_pt
	/* We use Itoh et al. notations here for T and the random r */
	prj_pt T[3];
	bitcnt_t mlen;
-
	u8 mbit, rbit;
+
	REGISTER u8 mbit, rbit;
	/* Random for masking the Double and Add Always algorithm */
	nn r;
	/* The new scalar we will use with MSB fixed to 1 (noted m' above).
@@ -1375,7 +1375,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_dbl_add_always(prj_pt
	/* Get a random r with the same size of m_msb_fixed */
	ret = nn_get_random_len(&r, m_msb_fixed.wlen * WORD_BYTES); EG(ret, err);

-
	ret = nn_getbit(&r, mlen, &rbit); EG(ret, err);
+
	rbit = (u8)nn_getbit_masked(&r, mlen, &ret); EG(ret, err);

	/* Initialize points */
	ret = prj_pt_init(&T[0], in->crv); EG(ret, err);
@@ -1393,13 +1393,13 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_dbl_add_always(prj_pt

	/* Main loop of Double and Add Always */
	while (mlen > 0) {
-
		u8 rbit_next;
+
		REGISTER u8 rbit_next;
		--mlen;
		/* rbit is r[i+1], and rbit_next is r[i] */
-
		ret = nn_getbit(&r, mlen, &rbit_next); EG(ret, err);
+
		rbit_next = (u8)nn_getbit_masked(&r, mlen, &ret); EG(ret, err);

		/* mbit is m[i] */
-
		ret = nn_getbit(&m_msb_fixed, mlen, &mbit); EG(ret, err);
+
		mbit = (u8)nn_getbit_masked(&m_msb_fixed, mlen, &ret); EG(ret, err);

		/* Double: T[r[i+1]] = ECDBL(T[r[i+1]]) */
#ifndef NO_USE_COMPLETE_FORMULAS
@@ -1466,7 +1466,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_dbl_add_always(prj_pt
	/*******************/
	{
		bitcnt_t mlen;
-
		u8 mbit;
+
		REGISTER u8 mbit;
		/* The new scalar we will use with MSB fixed to 1 (noted m' above).
		 * This helps dealing with constant time.
		 */
@@ -1529,7 +1529,7 @@ err1:
			while (mlen > 0) {
				--mlen;
				/* mbit is m[i] */
-
				ret = nn_getbit(&m_msb_fixed, mlen, &mbit); EG(ret, err2);
+
				mbit = (u8)nn_getbit_masked(&m_msb_fixed, mlen, &ret); EG(ret, err2);

#ifndef NO_USE_COMPLETE_FORMULAS
				/*
@@ -1571,7 +1571,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_ladder(prj_pt_t out,
	/* We use Itoh et al. notations here for T and the random r */
	prj_pt T[3];
	bitcnt_t mlen;
-
	u8 mbit, rbit;
+
	REGISTER u8 mbit, rbit;
	/* Random for masking the Montgomery Ladder algorithm */
	nn r;
	/* The new scalar we will use with MSB fixed to 1 (noted m' above).
@@ -1630,7 +1630,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_ladder(prj_pt_t out,
	/* Get a random r with the same size of m_msb_fixed */
	ret = nn_get_random_len(&r, (u16)(m_msb_fixed.wlen * WORD_BYTES)); EG(ret, err);

-
	ret = nn_getbit(&r, mlen, &rbit); EG(ret, err);
+
	rbit = (u8)nn_getbit_masked(&r, mlen, &ret); EG(ret, err);

	/* Initialize points */
	ret = prj_pt_init(&T[0], in->crv); EG(ret, err);
@@ -1658,13 +1658,13 @@ ATTRIBUTE_WARN_UNUSED_RET static int _prj_pt_mul_ltr_monty_ladder(prj_pt_t out,

	/* Main loop of the Montgomery Ladder */
	while (mlen > 0) {
-
		u8 rbit_next;
+
		REGISTER u8 rbit_next;
		--mlen;
		/* rbit is r[i+1], and rbit_next is r[i] */
-
		ret = nn_getbit(&r, mlen, &rbit_next); EG(ret, err);
+
		rbit_next = (u8)nn_getbit_masked(&r, mlen, &ret); EG(ret, err);

		/* mbit is m[i] */
-
		ret = nn_getbit(&m_msb_fixed, mlen, &mbit); EG(ret, err);
+
		mbit = (u8)nn_getbit_masked(&m_msb_fixed, mlen, &ret); EG(ret, err);
		/* Double: T[2] = ECDBL(T[d[i] ^ r[i+1]]) */

#ifndef NO_USE_COMPLETE_FORMULAS
modified external/libecc/src/nn/nn_logical.c
@@ -570,7 +570,7 @@ int nn_getbit(nn_src_t in, bitcnt_t bit, u8 *bitval)
	MUST_HAVE((bit < NN_MAX_BIT_LEN), ret, err);

	/* bidx is less than WORD_BITS so shift operations below are ok */
-
	(*bitval) = (u8)((((in->val[widx]) & (WORD(1) << bidx)) >> bidx) & 0x1);
+
	(*bitval) = (u8)((in->val[widx] >> bidx) & 0x1);

err:
	return ret;
modified external/libecc/src/nn/nn_mod_pow.c
@@ -41,7 +41,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _nn_exp_monty_ladder_ltr(nn_t out, nn_src_t
	nn T[3];
	nn mask;
	bitcnt_t explen, oldexplen;
-
 	u8 expbit, rbit;
+
	REGISTER u8 expbit, rbit;
	int ret, cmp;
	T[0].magic = T[1].magic = T[2].magic = mask.magic = WORD(0);

@@ -65,7 +65,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _nn_exp_monty_ladder_ltr(nn_t out, nn_src_t
	oldexplen = explen;
	explen = (explen < 2) ? 2 : explen;

-
	ret = nn_getbit(&mask, (bitcnt_t)(explen - 1), &rbit); EG(ret, err);
+
	rbit = (u8)nn_getbit_masked(&mask, (bitcnt_t)(explen - 1), &ret); EG(ret, err);

	/* Reduce the base if necessary */
	ret = nn_cmp(base, mod, &cmp); EG(ret, err);
@@ -101,13 +101,13 @@ ATTRIBUTE_WARN_UNUSED_RET static int _nn_exp_monty_ladder_ltr(nn_t out, nn_src_t
	 */
	explen = (bitcnt_t)(explen - 1);
	while (explen > 0) {
-
		u8 rbit_next;
+
		REGISTER u8 rbit_next;
		explen = (bitcnt_t)(explen - 1);

		/* rbit is r[i+1], and rbit_next is r[i] */
-
		ret = nn_getbit(&mask, explen, &rbit_next); EG(ret, err);
+
		rbit_next = (u8)nn_getbit_masked(&mask, explen, &ret); EG(ret, err);
		/* Get the exponent bit */
-
		ret = nn_getbit(exp, explen, &expbit); EG(ret, err);
+
		expbit = (u8)nn_getbit_masked(exp, explen, &ret); EG(ret, err);

		/* Square */
		if(r != NULL){
modified external/libecc/src/sig/sig_algs.c
@@ -1030,7 +1030,7 @@ ATTRIBUTE_WARN_UNUSED_RET static int _bubble_sort(verify_batch_scratch_pad *elem
				swapped = 1;
                        }
                }
-
		/* If no swap occurred in the inner loop, get out */
+
		/* If no swap occured in the inner loop, get out */
		if(!swapped){
			break;
		}
modified external/libecc/src/wycheproof_tests/libecc_wycheproof.c
@@ -114,14 +114,14 @@ static int check_wycheproof_ecdsa(void)
		ret = ec_verify(t->sig, (u8)(t->siglen), &pub_key, t->msg, t->msglen, t->sig_alg, t->hash, NULL, 0);
		/* Valid result */
		if ((t->result == 1) && ret) {
-
			ext_printf("[-] Error when verifying ECDSA test %d / %s (verification NOK while must be valid)\n", i, t->name);
+
			ext_printf("[-] Error when verifying ECDSA test %u / %s (verification NOK while must be valid)\n", i, t->name);
			ext_printf("    (comment = %s)\n", t->comment);
			ret = -1;
			OPENMP_EG(ret, err);
		}
		/* Invalid result */
		if ((t->result == -1) && !ret) {
-
			ext_printf("[-] Error when verifying ECDSA test %d / %s (verification OK while must be invalid)\n", i, t->name);
+
			ext_printf("[-] Error when verifying ECDSA test %u / %s (verification OK while must be invalid)\n", i, t->name);
			ext_printf("    (comment = %s)\n", t->comment);
			ret = -1;
			OPENMP_EG(ret, err);
@@ -135,7 +135,7 @@ static int check_wycheproof_ecdsa(void)
				ecdsa_acceptable_invalid++;
			}
#ifdef VERBOSE_ACCEPTABLE
-
			ext_printf("\t[~] ECDSA test %d / %s (verification %d while acceptable)\n", i, t->name, ret);
+
			ext_printf("\t[~] ECDSA test %u / %s (verification %d while acceptable)\n", i, t->name, ret);
			ext_printf("\t    (comment = %s)\n", t->comment);
#endif
		}
@@ -232,14 +232,14 @@ static int check_wycheproof_eddsa(void)
		ret = ec_verify(t->sig, (u8)(t->siglen), &pub_key, t->msg, t->msglen, t->sig_alg, t->hash, NULL, 0);
		/* Valid result */
		if ((t->result == 1) && ret) {
-
			ext_printf("[-] Error when verifying EDDSA test %d / %s (verification NOK while must be valid)\n", i, t->name);
+
			ext_printf("[-] Error when verifying EDDSA test %u / %s (verification NOK while must be valid)\n", i, t->name);
			ext_printf("    (comment = %s)\n", t->comment);
			ret = -1;
			OPENMP_EG(ret, err);
		}
		/* Invalid result */
		if ((t->result == -1) && !ret) {
-
			ext_printf("[-] Error when verifying EDDSA test %d / %s (verification OK while must be invalid)\n", i, t->name);
+
			ext_printf("[-] Error when verifying EDDSA test %u / %s (verification OK while must be invalid)\n", i, t->name);
			ext_printf("    (comment = %s)\n", t->comment);
			ret = -1;
			OPENMP_EG(ret, err);
@@ -254,7 +254,7 @@ static int check_wycheproof_eddsa(void)
				eddsa_acceptable_invalid++;
			}
#ifdef VERBOSE_ACCEPTABLE
-
			ext_printf("\t[~] EDDSA test %d / %s (verification %d while acceptable)\n", i, t->name, ret);
+
			ext_printf("\t[~] EDDSA test %u / %s (verification %d while acceptable)\n", i, t->name, ret);
			ext_printf("\t    (comment = %s)\n", t->comment);
#endif
			OPENMP_UNLOCK();
@@ -321,7 +321,7 @@ static int check_wycheproof_xdh(void)
		/* Reject bad lengths */
		if(t->privkeylen != alglen){
			if(t->result != -1){
-
				ext_printf("[-] Error: XDH tests error, unkown private key length %d with valid result\n", t->privkeylen);
+
				ext_printf("[-] Error: XDH tests error, unkown private key length %u with valid result\n", t->privkeylen);
				ext_printf("    (comment = %s)\n", t->comment);
				ret = -1;
				OPENMP_EG(ret, err);
@@ -332,7 +332,7 @@ static int check_wycheproof_xdh(void)
		}
		if(t->peerpubkeylen != alglen){
			if(t->result != -1){
-
				ext_printf("[-] Error: XDH tests error, unkown peer public key length %d with valid result\n", t->peerpubkeylen);
+
				ext_printf("[-] Error: XDH tests error, unkown peer public key length %u with valid result\n", t->peerpubkeylen);
				ext_printf("    (comment = %s)\n", t->comment);
				ret = -1;
				OPENMP_EG(ret, err);
@@ -343,7 +343,7 @@ static int check_wycheproof_xdh(void)
		}
		if(t->sharedsecretlen != alglen){
			if(t->result != -1){
-
				ext_printf("[-] Error: XDH tests error, unkown shared secret length %d with valid result\n", t->sharedsecretlen);
+
				ext_printf("[-] Error: XDH tests error, unkown shared secret length %u with valid result\n", t->sharedsecretlen);
				ext_printf("    (comment = %s)\n", t->comment);
				ret = -1;
				OPENMP_EG(ret, err);
@@ -354,7 +354,7 @@ static int check_wycheproof_xdh(void)
		}
		if((t->ourpubkeylen != 0) && (t->ourpubkeylen != alglen)){
			if(t->result != -1){
-
				ext_printf("[-] Error: XDH tests error, unkown our public key length %d with valid result\n", t->ourpubkeylen);
+
				ext_printf("[-] Error: XDH tests error, unkown our public key length %u with valid result\n", t->ourpubkeylen);
				ext_printf("    (comment = %s)\n", t->comment);
				ret = -1;
				OPENMP_EG(ret, err);
@@ -391,7 +391,7 @@ static int check_wycheproof_xdh(void)
					OPENMP_LOCK();
					xdh_acceptable_invalid++;
#ifdef VERBOSE_ACCEPTABLE
-
					ext_printf("\t[~] XDH test %d / %s (shared secret derivation NOK while acceptable)\n", i, t->name);
+
					ext_printf("\t[~] XDH test %u / %s (shared secret derivation NOK while acceptable)\n", i, t->name);
					ext_printf("\t    (comment = %s)\n", t->comment);
#endif
					OPENMP_UNLOCK();
@@ -446,7 +446,7 @@ static int check_wycheproof_xdh(void)
					OPENMP_LOCK();
					xdh_acceptable_invalid++;
#ifdef VERBOSE_ACCEPTABLE
-
					ext_printf("\t[~] XDH test %d / %s (shared secret derivation NOK while acceptable)\n", i, t->name);
+
					ext_printf("\t[~] XDH test %u / %s (shared secret derivation NOK while acceptable)\n", i, t->name);
					ext_printf("\t    (comment = %s)\n", t->comment);
#endif
					OPENMP_UNLOCK();
@@ -478,7 +478,7 @@ static int check_wycheproof_xdh(void)
			OPENMP_LOCK();
			xdh_acceptable_valid++;
#ifdef VERBOSE_ACCEPTABLE
-
			ext_printf("\t[~] XDH test %d / %s (shared secret OK while acceptable)\n", i, t->name);
+
			ext_printf("\t[~] XDH test %u / %s (shared secret OK while acceptable)\n", i, t->name);
			ext_printf("\t    (comment = %s)\n", t->comment);
#endif
			OPENMP_UNLOCK();
@@ -664,7 +664,7 @@ static int check_wycheproof_ecdh(void)
		else{
			/* No point compression is used, copy our raw buffer as public key */
			if((t->peerpubkeylen != serialized_pub_key_size) && (t->result >= 0)){
-
				ext_printf("[-] Error: ECDH tests error when checking our public key size, got %d instead of %d\n", t->peerpubkeylen, serialized_pub_key_size);
+
				ext_printf("[-] Error: ECDH tests error when checking our public key size, got %u instead of %u\n", t->peerpubkeylen, serialized_pub_key_size);
				ext_printf("    (comment = %s)\n", t->comment);
				ret = -1;
				OPENMP_EG(ret, err);
@@ -689,7 +689,7 @@ static int check_wycheproof_ecdh(void)
			continue;
		}
		if(sharedsecretsize != t->sharedsecretlen){
-
			ext_printf("Error: ECDH tests error, bad shared secret size %d instead of %d\n", sharedsecretsize, t->sharedsecretlen);
+
			ext_printf("Error: ECDH tests error, bad shared secret size %u instead of %u\n", sharedsecretsize, t->sharedsecretlen);
			ext_printf("    (comment = %s)\n", t->comment);
			ret = -1;
			OPENMP_EG(ret, err);
@@ -707,7 +707,7 @@ static int check_wycheproof_ecdh(void)
			OPENMP_LOCK();
			ecdh_acceptable_valid++;
#ifdef VERBOSE_ACCEPTABLE
-
			ext_printf("\t[~] ECDH test %d / %s (shared secret OK while acceptable)\n", i, t->name);
+
			ext_printf("\t[~] ECDH test %u / %s (shared secret OK while acceptable)\n", i, t->name);
			ext_printf("\t    (comment = %s)\n", t->comment);
#endif
			OPENMP_UNLOCK();
@@ -763,7 +763,7 @@ static int check_wycheproof_hmac(void)
			OPENMP_EG(ret, err);
		}
		if((hlen < t->taglen) && (t->result >= 0)){
-
			ext_printf("[-] Error: HMAC tests error: size error %d < %d\n", hlen, t->taglen);
+
			ext_printf("[-] Error: HMAC tests error: size error %u < %u\n", hlen, t->taglen);
			ext_printf("    (comment = %s)\n", t->comment);
			ret = -1;
			OPENMP_EG(ret, err);
@@ -781,7 +781,7 @@ static int check_wycheproof_hmac(void)
			OPENMP_LOCK();
			hmac_acceptable_valid++;
#ifdef VERBOSE_ACCEPTABLE
-
			ext_printf("\t[~] HMAC test %d / %s (shared secret OK while acceptable)\n", i, t->name);
+
			ext_printf("\t[~] HMAC test %u / %s (shared secret OK while acceptable)\n", i, t->name);
			ext_printf("\t    (comment = %s)\n", t->comment);
#endif
			OPENMP_UNLOCK();
@@ -803,35 +803,35 @@ int main(int argc, char *argv[])
	FORCE_USED_VAR(argv);

	/**********************/
-
	ext_printf("==== Checking ECDH =========== Imported = %d, Skipped = %d (valid = %d, invalid = %d, acceptable = %d)\n", NUM_WYCHEPROOF_ECDH_TESTS_IMPORTED, NUM_WYCHEPROOF_ECDH_TESTS_SKIPPED, NUM_WYCHEPROOF_ECDH_TESTS_VALID, NUM_WYCHEPROOF_ECDH_TESTS_INVALID, NUM_WYCHEPROOF_ECDH_TESTS_ACCEPTABLE);
+
	ext_printf("==== Checking ECDH =========== Imported = %u, Skipped = %u (valid = %u, invalid = %u, acceptable = %u)\n", NUM_WYCHEPROOF_ECDH_TESTS_IMPORTED, NUM_WYCHEPROOF_ECDH_TESTS_SKIPPED, NUM_WYCHEPROOF_ECDH_TESTS_VALID, NUM_WYCHEPROOF_ECDH_TESTS_INVALID, NUM_WYCHEPROOF_ECDH_TESTS_ACCEPTABLE);
	if(check_wycheproof_ecdh()){
		goto err;
	}
-
	ext_printf("[+][%d] All ECDH tests went OK! (%d acceptable/valid, %d acceptable/invalid)\n", ecdh_all_performed, ecdh_acceptable_valid, ecdh_acceptable_invalid);
+
	ext_printf("[+][%u] All ECDH tests went OK! (%u acceptable/valid, %u acceptable/invalid)\n", ecdh_all_performed, ecdh_acceptable_valid, ecdh_acceptable_invalid);
	/**********************/
-
	ext_printf("==== Checking XDH =========== Imported = %d, Skipped = %d (valid = %d, invalid = %d, acceptable = %d)\n", NUM_WYCHEPROOF_XDH_TESTS_IMPORTED, NUM_WYCHEPROOF_XDH_TESTS_SKIPPED, NUM_WYCHEPROOF_XDH_TESTS_VALID, NUM_WYCHEPROOF_XDH_TESTS_INVALID, NUM_WYCHEPROOF_XDH_TESTS_ACCEPTABLE);
+
	ext_printf("==== Checking XDH =========== Imported = %u, Skipped = %u (valid = %u, invalid = %u, acceptable = %u)\n", NUM_WYCHEPROOF_XDH_TESTS_IMPORTED, NUM_WYCHEPROOF_XDH_TESTS_SKIPPED, NUM_WYCHEPROOF_XDH_TESTS_VALID, NUM_WYCHEPROOF_XDH_TESTS_INVALID, NUM_WYCHEPROOF_XDH_TESTS_ACCEPTABLE);
	if(check_wycheproof_xdh()){
		goto err;
	}
-
	ext_printf("[+][%d] All XDH tests went OK! (%d acceptable/valid, %d acceptable/invalid)\n", xdh_all_performed, xdh_acceptable_valid, xdh_acceptable_invalid);
+
	ext_printf("[+][%u] All XDH tests went OK! (%u acceptable/valid, %u acceptable/invalid)\n", xdh_all_performed, xdh_acceptable_valid, xdh_acceptable_invalid);
	/**********************/
-
	ext_printf("==== Checking ECDSA =========== Imported = %d, Skipped = %d (valid = %d, invalid = %d, acceptable = %d)\n", NUM_WYCHEPROOF_ECDSA_TESTS_IMPORTED, NUM_WYCHEPROOF_ECDSA_TESTS_SKIPPED, NUM_WYCHEPROOF_ECDSA_TESTS_VALID, NUM_WYCHEPROOF_ECDSA_TESTS_INVALID, NUM_WYCHEPROOF_ECDSA_TESTS_ACCEPTABLE);
+
	ext_printf("==== Checking ECDSA =========== Imported = %u, Skipped = %u (valid = %u, invalid = %u, acceptable = %u)\n", NUM_WYCHEPROOF_ECDSA_TESTS_IMPORTED, NUM_WYCHEPROOF_ECDSA_TESTS_SKIPPED, NUM_WYCHEPROOF_ECDSA_TESTS_VALID, NUM_WYCHEPROOF_ECDSA_TESTS_INVALID, NUM_WYCHEPROOF_ECDSA_TESTS_ACCEPTABLE);
	if(check_wycheproof_ecdsa()){
		goto err;
	}
-
	ext_printf("[+][%d] All ECDSA tests went OK! (%d acceptable/valid, %d acceptable/invalid)\n", ecdsa_all_performed, ecdsa_acceptable_valid, ecdsa_acceptable_invalid);
+
	ext_printf("[+][%u] All ECDSA tests went OK! (%u acceptable/valid, %u acceptable/invalid)\n", ecdsa_all_performed, ecdsa_acceptable_valid, ecdsa_acceptable_invalid);
	/**********************/
-
	ext_printf("==== Checking EDDSA =========== Imported = %d, Skipped = %d (valid = %d, invalid = %d, acceptable = %d)\n", NUM_WYCHEPROOF_EDDSA_TESTS_IMPORTED, NUM_WYCHEPROOF_EDDSA_TESTS_SKIPPED, NUM_WYCHEPROOF_EDDSA_TESTS_VALID, NUM_WYCHEPROOF_EDDSA_TESTS_INVALID, NUM_WYCHEPROOF_EDDSA_TESTS_ACCEPTABLE);
+
	ext_printf("==== Checking EDDSA =========== Imported = %u, Skipped = %u (valid = %u, invalid = %u, acceptable = %u)\n", NUM_WYCHEPROOF_EDDSA_TESTS_IMPORTED, NUM_WYCHEPROOF_EDDSA_TESTS_SKIPPED, NUM_WYCHEPROOF_EDDSA_TESTS_VALID, NUM_WYCHEPROOF_EDDSA_TESTS_INVALID, NUM_WYCHEPROOF_EDDSA_TESTS_ACCEPTABLE);
	if(check_wycheproof_eddsa()){
		goto err;
	}
-
	ext_printf("[+][%d] All EDDSA tests went OK! (%d acceptable/valid, %d acceptable/invalid)\n", eddsa_all_performed, eddsa_acceptable_valid, eddsa_acceptable_invalid);
+
	ext_printf("[+][%u] All EDDSA tests went OK! (%u acceptable/valid, %u acceptable/invalid)\n", eddsa_all_performed, eddsa_acceptable_valid, eddsa_acceptable_invalid);
	/**********************/
-
	ext_printf("==== Checking HMAC =========== Imported = %d, Skipped = %d (valid = %d, invalid = %d, acceptable = %d)\n", NUM_WYCHEPROOF_HMAC_TESTS_IMPORTED, NUM_WYCHEPROOF_HMAC_TESTS_SKIPPED, NUM_WYCHEPROOF_HMAC_TESTS_VALID, NUM_WYCHEPROOF_HMAC_TESTS_INVALID, NUM_WYCHEPROOF_HMAC_TESTS_ACCEPTABLE);
+
	ext_printf("==== Checking HMAC =========== Imported = %u, Skipped = %u (valid = %u, invalid = %u, acceptable = %u)\n", NUM_WYCHEPROOF_HMAC_TESTS_IMPORTED, NUM_WYCHEPROOF_HMAC_TESTS_SKIPPED, NUM_WYCHEPROOF_HMAC_TESTS_VALID, NUM_WYCHEPROOF_HMAC_TESTS_INVALID, NUM_WYCHEPROOF_HMAC_TESTS_ACCEPTABLE);
	if(check_wycheproof_hmac()){
		goto err;
	}
-
	ext_printf("[+][%d] All HMAC tests went OK! (%d acceptable/valid, %d acceptable/invalid)\n", hmac_all_performed, hmac_acceptable_valid, hmac_acceptable_invalid);
+
	ext_printf("[+][%u] All HMAC tests went OK! (%u acceptable/valid, %u acceptable/invalid)\n", hmac_all_performed, hmac_acceptable_valid, hmac_acceptable_invalid);

err:
	return 0;
modified external/libecc/src/wycheproof_tests/libecc_wycheproof_tests.h
@@ -367941,13 +367941,13 @@ ATTRIBUTE_USED static const wycheproof_ecdsa_test *wycheproof_ecdsa_all_tests[]
	NULL,
};

-
#define NUM_WYCHEPROOF_ECDSA_TESTS (sizeof(wycheproof_ecdsa_all_tests) / sizeof(wycheproof_ecdsa_test *))
+
#define NUM_WYCHEPROOF_ECDSA_TESTS ((unsigned int)(sizeof(wycheproof_ecdsa_all_tests) / sizeof(wycheproof_ecdsa_test *)))
/******** ECDSA tests extracted from  ecdsa_brainpoolP224r1_sha224_p1363_test.json ecdsa_brainpoolP224r1_sha224_test.json ecdsa_brainpoolP256r1_sha256_p1363_test.json ecdsa_brainpoolP256r1_sha256_test.json ecdsa_brainpoolP320r1_sha384_p1363_test.json ecdsa_brainpoolP320r1_sha384_test.json ecdsa_brainpoolP384r1_sha384_p1363_test.json ecdsa_brainpoolP384r1_sha384_test.json ecdsa_brainpoolP512r1_sha512_p1363_test.json ecdsa_brainpoolP512r1_sha512_test.json ecdsa_secp224r1_sha224_p1363_test.json ecdsa_secp224r1_sha224_test.json ecdsa_secp224r1_sha256_p1363_test.json ecdsa_secp224r1_sha256_test.json ecdsa_secp224r1_sha3_224_test.json ecdsa_secp224r1_sha3_256_test.json ecdsa_secp224r1_sha3_512_test.json ecdsa_secp224r1_sha512_p1363_test.json ecdsa_secp224r1_sha512_test.json ecdsa_secp256k1_sha256_p1363_test.json ecdsa_secp256k1_sha256_test.json ecdsa_secp256k1_sha3_256_test.json ecdsa_secp256k1_sha3_512_test.json ecdsa_secp256k1_sha512_p1363_test.json ecdsa_secp256k1_sha512_test.json ecdsa_secp256r1_sha256_p1363_test.json ecdsa_secp256r1_sha256_test.json ecdsa_secp256r1_sha3_256_test.json ecdsa_secp256r1_sha3_512_test.json ecdsa_secp256r1_sha512_p1363_test.json ecdsa_secp256r1_sha512_test.json ecdsa_secp384r1_sha3_384_test.json ecdsa_secp384r1_sha3_512_test.json ecdsa_secp384r1_sha384_p1363_test.json ecdsa_secp384r1_sha384_test.json ecdsa_secp384r1_sha512_p1363_test.json ecdsa_secp384r1_sha512_test.json ecdsa_secp521r1_sha3_512_test.json ecdsa_secp521r1_sha512_p1363_test.json ecdsa_secp521r1_sha512_test.json ecdsa_test.json ecdsa_webcrypto_test.json is 12693, skipped = 3347 **********/
-
#define NUM_WYCHEPROOF_ECDSA_TESTS_IMPORTED 12693
-
#define NUM_WYCHEPROOF_ECDSA_TESTS_SKIPPED 3347
-
#define NUM_WYCHEPROOF_ECDSA_TESTS_ACCEPTABLE 87
-
#define NUM_WYCHEPROOF_ECDSA_TESTS_VALID 8330
-
#define NUM_WYCHEPROOF_ECDSA_TESTS_INVALID 4276
+
#define NUM_WYCHEPROOF_ECDSA_TESTS_IMPORTED ((unsigned int)12693)
+
#define NUM_WYCHEPROOF_ECDSA_TESTS_SKIPPED ((unsigned int)3347)
+
#define NUM_WYCHEPROOF_ECDSA_TESTS_ACCEPTABLE ((unsigned int)87)
+
#define NUM_WYCHEPROOF_ECDSA_TESTS_VALID ((unsigned int)8330)
+
#define NUM_WYCHEPROOF_ECDSA_TESTS_INVALID ((unsigned int)4276)

/* Test 0 for ECDH, tcId is 1 in file ecdh_brainpoolP224r1_test.json  */
#if defined(WITH_ECCCDH) && defined(WITH_CURVE_BRAINPOOLP224R1)
@@ -557616,13 +557616,13 @@ ATTRIBUTE_USED static const wycheproof_ecdh_test *wycheproof_ecdh_all_tests[] =
	NULL,
};

-
#define NUM_WYCHEPROOF_ECDH_TESTS (sizeof(wycheproof_ecdh_all_tests) / sizeof(wycheproof_ecdh_test *))
+
#define NUM_WYCHEPROOF_ECDH_TESTS ((unsigned int)(sizeof(wycheproof_ecdh_all_tests) / sizeof(wycheproof_ecdh_test *)))
/******** ECDH tests extracted from  ecdh_brainpoolP224r1_test.json ecdh_brainpoolP256r1_test.json ecdh_brainpoolP320r1_test.json ecdh_brainpoolP384r1_test.json ecdh_brainpoolP512r1_test.json ecdh_secp224r1_ecpoint_test.json ecdh_secp224r1_test.json ecdh_secp256k1_test.json ecdh_secp256r1_ecpoint_test.json ecdh_secp256r1_test.json ecdh_secp384r1_ecpoint_test.json ecdh_secp384r1_test.json ecdh_secp521r1_ecpoint_test.json ecdh_secp521r1_test.json ecdh_test.json ecdh_webcrypto_test.json is 6114, skipped = 2872 **********/
-
#define NUM_WYCHEPROOF_ECDH_TESTS_IMPORTED 6114
-
#define NUM_WYCHEPROOF_ECDH_TESTS_SKIPPED 2872
-
#define NUM_WYCHEPROOF_ECDH_TESTS_ACCEPTABLE 774
-
#define NUM_WYCHEPROOF_ECDH_TESTS_VALID 4549
-
#define NUM_WYCHEPROOF_ECDH_TESTS_INVALID 791
+
#define NUM_WYCHEPROOF_ECDH_TESTS_IMPORTED ((unsigned int)6114)
+
#define NUM_WYCHEPROOF_ECDH_TESTS_SKIPPED ((unsigned int)2872)
+
#define NUM_WYCHEPROOF_ECDH_TESTS_ACCEPTABLE ((unsigned int)774)
+
#define NUM_WYCHEPROOF_ECDH_TESTS_VALID ((unsigned int)4549)
+
#define NUM_WYCHEPROOF_ECDH_TESTS_INVALID ((unsigned int)791)

/* Test 0 for EDDSA, tcId is 1 in file ed448_test.json */
#if defined(WITH_SIG_EDDSA448) && defined(WITH_CURVE_WEI448) && defined(WITH_HASH_SHAKE256)
@@ -565463,11 +565463,11 @@ ATTRIBUTE_USED static const wycheproof_eddsa_test *wycheproof_eddsa_all_tests[]

#define NUM_WYCHEPROOF_EDDSA_TESTS (sizeof(wycheproof_eddsa_all_tests) / sizeof(wycheproof_eddsa_test *))
/******** EDDSA tests extracted from  ed448_test.json eddsa_test.json is 231, skipped = 0 **********/
-
#define NUM_WYCHEPROOF_EDDSA_TESTS_IMPORTED 231
-
#define NUM_WYCHEPROOF_EDDSA_TESTS_SKIPPED 0
-
#define NUM_WYCHEPROOF_EDDSA_TESTS_ACCEPTABLE 0
-
#define NUM_WYCHEPROOF_EDDSA_TESTS_VALID 101
-
#define NUM_WYCHEPROOF_EDDSA_TESTS_INVALID 130
+
#define NUM_WYCHEPROOF_EDDSA_TESTS_IMPORTED ((unsigned int)231)
+
#define NUM_WYCHEPROOF_EDDSA_TESTS_SKIPPED ((unsigned int)0)
+
#define NUM_WYCHEPROOF_EDDSA_TESTS_ACCEPTABLE ((unsigned int)0)
+
#define NUM_WYCHEPROOF_EDDSA_TESTS_VALID ((unsigned int)101)
+
#define NUM_WYCHEPROOF_EDDSA_TESTS_INVALID ((unsigned int)130)

/* Test 0 for XDH, tcId is 1 in file x25519_asn_test.json  */
#if defined(WITH_X25519) && defined(WITH_CURVE_WEI25519)
@@ -692009,11 +692009,11 @@ ATTRIBUTE_USED static const wycheproof_xdh_test *wycheproof_xdh_all_tests[] = {

#define NUM_WYCHEPROOF_XDH_TESTS (sizeof(wycheproof_xdh_all_tests) / sizeof(wycheproof_xdh_test *))
/******** XDH tests extracted from  x25519_asn_test.json x25519_jwk_test.json x25519_pem_test.json x25519_test.json x448_asn_test.json x448_jwk_test.json x448_pem_test.json x448_test.json is 4115, skipped = 57 **********/
-
#define NUM_WYCHEPROOF_XDH_TESTS_IMPORTED 4115
-
#define NUM_WYCHEPROOF_XDH_TESTS_SKIPPED 57
-
#define NUM_WYCHEPROOF_XDH_TESTS_ACCEPTABLE 2020
-
#define NUM_WYCHEPROOF_XDH_TESTS_VALID 2072
-
#define NUM_WYCHEPROOF_XDH_TESTS_INVALID 23
+
#define NUM_WYCHEPROOF_XDH_TESTS_IMPORTED ((unsigned int)4115)
+
#define NUM_WYCHEPROOF_XDH_TESTS_SKIPPED ((unsigned int)57)
+
#define NUM_WYCHEPROOF_XDH_TESTS_ACCEPTABLE ((unsigned int)2020)
+
#define NUM_WYCHEPROOF_XDH_TESTS_VALID ((unsigned int)2072)
+
#define NUM_WYCHEPROOF_XDH_TESTS_INVALID ((unsigned int)23)

/* Test 0 for HMAC, tcId is 1 in file hmac_sha224_test.json */
#if defined(WITH_HMAC) && defined(WITH_HASH_SHA224)
@@ -728064,11 +728064,11 @@ ATTRIBUTE_USED static const wycheproof_hmac_test *wycheproof_hmac_all_tests[] =
	NULL,
};

-
#define NUM_WYCHEPROOF_HMAC_TESTS (sizeof(wycheproof_hmac_all_tests) / sizeof(wycheproof_hmac_test *))
+
#define NUM_WYCHEPROOF_HMAC_TESTS ((unsigned int)(sizeof(wycheproof_hmac_all_tests) / sizeof(wycheproof_hmac_test *)))
/******** HMAC tests extracted from  hmac_sha224_test.json hmac_sha256_test.json hmac_sha3_224_test.json hmac_sha3_256_test.json hmac_sha3_384_test.json hmac_sha3_512_test.json hmac_sha384_test.json hmac_sha512_test.json is 1388, skipped = 0 **********/
-
#define NUM_WYCHEPROOF_HMAC_TESTS_IMPORTED 1388
-
#define NUM_WYCHEPROOF_HMAC_TESTS_SKIPPED 0
-
#define NUM_WYCHEPROOF_HMAC_TESTS_ACCEPTABLE 0
-
#define NUM_WYCHEPROOF_HMAC_TESTS_VALID 528
-
#define NUM_WYCHEPROOF_HMAC_TESTS_INVALID 860
+
#define NUM_WYCHEPROOF_HMAC_TESTS_IMPORTED ((unsigned int)1388)
+
#define NUM_WYCHEPROOF_HMAC_TESTS_SKIPPED ((unsigned int)0)
+
#define NUM_WYCHEPROOF_HMAC_TESTS_ACCEPTABLE ((unsigned int)0)
+
#define NUM_WYCHEPROOF_HMAC_TESTS_VALID ((unsigned int)528)
+
#define NUM_WYCHEPROOF_HMAC_TESTS_INVALID ((unsigned int)860)