[gnutls-devel] GnuTLS | pk: implement deterministic ECDSA/DSA for provable signing (!1051)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Sat Aug 3 11:21:48 CEST 2019
Daiki Ueno commented on a discussion on lib/nettle/int/dsa-compute-k.c: https://gitlab.com/gnutls/gnutls/merge_requests/1051#note_199765012
> + 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);
If the maximum size of q is limited (e.g., max. 521 in ECDSA, 512 in DSA), we can avoid those allocations altogether, though GnuTLS seems to allow arbitrary size through `GNUTLS_SUBGROUP_TO_BITS`. What do you think?
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1051#note_199765012
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/20190803/68bc37dd/attachment-0001.html>
More information about the Gnutls-devel
mailing list