From cca75c7713fa2e883b7981ffa296a5f0a00e1d54 Mon Sep 17 00:00:00 2001 From: Dmitry Vagner Date: Tue, 27 Dec 2022 18:42:34 -0800 Subject: [PATCH] remove redundant definition --- evm/src/arithmetic/mod.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/evm/src/arithmetic/mod.rs b/evm/src/arithmetic/mod.rs index 1493b292..bb58edf3 100644 --- a/evm/src/arithmetic/mod.rs +++ b/evm/src/arithmetic/mod.rs @@ -1,7 +1,6 @@ -use std::str::FromStr; - use ethereum_types::U256; +use crate::bn254::BN_BASE; use crate::util::{addmod, mulmod, submod}; mod add; @@ -78,9 +77,9 @@ impl BinaryOperator { input1 >> input0 } } - BinaryOperator::AddFp254 => addmod(input0, input1, bn_base_order()), - BinaryOperator::MulFp254 => mulmod(input0, input1, bn_base_order()), - BinaryOperator::SubFp254 => submod(input0, input1, bn_base_order()), + BinaryOperator::AddFp254 => addmod(input0, input1, BN_BASE), + BinaryOperator::MulFp254 => mulmod(input0, input1, BN_BASE), + BinaryOperator::SubFp254 => submod(input0, input1, BN_BASE), } } } @@ -152,7 +151,3 @@ impl Operation { } } } - -fn bn_base_order() -> U256 { - U256::from_str("0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47").unwrap() -}