aboutsummaryrefslogtreecommitdiffstats
path: root/include/mcl/bn.hpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-07-24 07:50:57 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-07-24 07:50:57 +0800
commit6eb7d1bdc890aa0346064d6dcb328a3637ab86c7 (patch)
tree59c7d8af0ecbab3cc4223a9ad7c6062a537f0406 /include/mcl/bn.hpp
parenta85cc8eaa91b1600f0cb9ccc8b2a51cec0df24b3 (diff)
downloaddexon-mcl-6eb7d1bdc890aa0346064d6dcb328a3637ab86c7.tar.gz
dexon-mcl-6eb7d1bdc890aa0346064d6dcb328a3637ab86c7.tar.zst
dexon-mcl-6eb7d1bdc890aa0346064d6dcb328a3637ab86c7.zip
fix mapTo function throws exception if t = 0
Diffstat (limited to 'include/mcl/bn.hpp')
-rw-r--r--include/mcl/bn.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mcl/bn.hpp b/include/mcl/bn.hpp
index 90c3bf4..ca39c99 100644
--- a/include/mcl/bn.hpp
+++ b/include/mcl/bn.hpp
@@ -66,6 +66,7 @@ struct MapToT {
{
F x, y, w;
bool negative = legendre(t) < 0;
+ if (t.isZero()) goto ERR_POINT;
F::sqr(w, t);
w += G::b_;
*w.getFp0() += Fp::one();