Commit 98e309be authored by Simo Sorce's avatar Simo Sorce Committed by Niels Möller
Browse files

Add convenience macro for size calculation



Returns number of limbs needed to contain N bytes long number.
Signed-off-by: default avatarSimo Sorce <simo@redhat.com>
parent 51b64bb8
......@@ -81,6 +81,9 @@
# define cnd_sub_n(cnd, rp, ap, n) mpn_submul_1 ((rp), (ap), (n), (cnd) != 0)
#endif
#define NETTLE_OCTET_SIZE_TO_LIMB_SIZE(n) \
(((n) * 8 + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS)
/* Some functions for interfacing between mpz and mpn code. Signs of
the mpz numbers are generally ignored. */
......
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