[gnutls-devel] GnuTLS | pk: implement deterministic ECDSA/DSA for provable signing (!1051)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Mon Aug 5 10:46:40 CEST 2019




Nikos Mavrogiannopoulos commented on a discussion on lib/nettle/int/dsa-compute-k.c: https://gitlab.com/gnutls/gnutls/merge_requests/1051#note_200058306

> +	uint8_t *xp = NULL;
> +	uint8_t *hp = NULL;
> +	uint8_t *tp = NULL;
> +	mp_limb_t *h = NULL;
> +	mp_size_t qn = mpz_size(q);
> +	mp_size_t hn = (length + sizeof(mp_limb_t) - 1) / sizeof(mp_limb_t);
> +	mp_bitcnt_t q_bits = mpz_sizeinbase (q, 2);
> +	mp_bitcnt_t h_bits = length * 8;
> +	size_t nbytes = (q_bits + 7) / 8;
> +	const uint8_t c0 = 0x00;
> +	const uint8_t c1 = 0x01;
> +	mp_limb_t cy;
> +	gnutls_hmac_hd_t hd;
> +	int ret = 0;
> +
> +	xp = gnutls_malloc(nbytes);

True, it seems that for DSA the maximum subgroup bits can be up to 512 (checking `algorithms/secparams.c` table), and that's close with the 521 in ECDSA. If we introduce such a maximum value we'd need an assert somewhere in sec-params.c so that any violation is caught early (e.g., in `tests/sec-params.c`).

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1051#note_200058306
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190805/7c9fafc6/attachment-0001.html>


More information about the Gnutls-devel mailing list