X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/92a7d254975db245c3320855515bffc1aebda9e4..7c9ca4bd3cf857d45d931f224fe6415b36d1cffe:/dh.c diff --git a/dh.c b/dh.c index 2383192..c37b538 100644 --- a/dh.c +++ b/dh.c @@ -125,6 +125,10 @@ static list_t *dh_apply(closure_t *self, struct cloc loc, dict_t *context, st->ops.len=sz; + st->ops.ceil_len=(mpz_sizeinbase(&st->p,2)+7)/8; + /* According to the docs, mpz_sizeinbase(,256) is allowed to return + * an answer which is 1 too large. But mpz_sizeinbase(,2) isn't. */ + return new_closure(&st->cl); }