From 30445273a33b46466a261d8cdc3c922abb6a88ef Mon Sep 17 00:00:00 2001 From: Nacho Avecilla Date: Fri, 22 Sep 2023 09:51:33 -0300 Subject: [PATCH] Store zero before returning in ecmul trivial cases (#123) --- precompiles/EcMul.yul | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/precompiles/EcMul.yul b/precompiles/EcMul.yul index eff56e20..82a8c8a5 100644 --- a/precompiles/EcMul.yul +++ b/precompiles/EcMul.yul @@ -373,6 +373,8 @@ object "EcMul" { if affinePointIsInfinity(x, y) { // Infinity * scalar = Infinity + mstore(0x00, 0x00) + mstore(0x20, 0x00) return(0x00, 0x40) } @@ -386,6 +388,8 @@ object "EcMul" { if eq(scalar, 0) { // P * 0 = Infinity + mstore(0x00, 0x00) + mstore(0x20, 0x00) return(0x00, 0x40) } if eq(scalar, 1) {