From 344a56c87215ee4761e603fd0bc7f93c11907513 Mon Sep 17 00:00:00 2001 From: DesWurstes Date: Sun, 4 Oct 2020 12:39:21 +0100 Subject: [PATCH] Fix wrong result due to overflowing --- interactive/ec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interactive/ec.js b/interactive/ec.js index e82d6437a96..b8b4f2f48f7 100644 --- a/interactive/ec.js +++ b/interactive/ec.js @@ -1094,6 +1094,8 @@ } } + m %= this.k; + var x3 = ( m * m - x1 - x2 ) % this.k; var y3 = ( m * ( x1 - x3 ) - y1 ) % this.k;