From a129bbd944f717d00cff6ee099c47ecede4dbc3c Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 25 Jul 2018 21:56:39 +0100 Subject: [PATCH] multiexp: fix maxscalar off by one Reported by QuarksLab. --- src/ringct/multiexp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ringct/multiexp.cc b/src/ringct/multiexp.cc index b05840322..901b00edd 100644 --- a/src/ringct/multiexp.cc +++ b/src/ringct/multiexp.cc @@ -605,7 +605,7 @@ rct::key pippenger(const std::vector &data, const std::shared_ptr< maxscalar = data[i].scalar; } size_t groups = 0; - while (groups < 256 && pow2(groups) < maxscalar) + while (groups < 256 && !(maxscalar < pow2(groups))) ++groups; groups = (groups + c - 1) / c;