chiark
/
gitweb
/
~ianmdlvl
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
secnet: provide will_droppriv
[secnet.git]
/
dh.c
diff --git
a/dh.c
b/dh.c
index 2383192fdc4ea2e807fc353e30b67e9a1a9130cd..c37b5386359294f856fb08eaf156a4c2ca586856 100644
(file)
--- 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.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);
}
return new_closure(&st->cl);
}