Skip to content

Commit

Permalink
Fix add copy/pasta
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Jan 24, 2025
1 parent cb47f55 commit 3fbc6fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cairo/src/precompiles/ecmul.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ from src.utils.utils import Helpers
from src.utils.bytes import uint256_to_bytes32
from src.utils.uint384 import UInt384, uint256_to_uint384, uint384_to_uint256

namespace PrecompileEcAdd {
const PRECOMPILE_ADDRESS = 0x06;
const GAS_COST_EC_ADD = 150;
namespace PrecompileEcMul {
const PRECOMPILE_ADDRESS = 0x07;
const GAS_COST_EC_MUL = 6000;
const G1POINT_BYTES_LEN = 32;
// @notice Run the precompile.
Expand Down Expand Up @@ -45,7 +45,7 @@ namespace PrecompileEcAdd {
tempvar a_ptr = UInt384(alt_bn128.A0, alt_bn128.A1, alt_bn128.A2, alt_bn128.A3);
tempvar modulus_ptr = UInt384(alt_bn128.P0, alt_bn128.P1, alt_bn128.P2, alt_bn128.P3);

with_attr error_message("Kakarot: ec_add failed") {
with_attr error_message("Kakarot: ec_mul failed") {
let result: G1Point = ec_mul(p, q, g_ptr, a_ptr, modulus_ptr);
}

Expand All @@ -56,6 +56,6 @@ namespace PrecompileEcAdd {
uint256_to_bytes32(output, x_u256);
uint256_to_bytes32(output + G1POINT_BYTES_LEN, y_u256);

return (G1POINT_BYTES_LEN * 2, output, GAS_COST_EC_ADD, 0);
return (G1POINT_BYTES_LEN * 2, output, GAS_COST_EC_MUL, 0);
}
}

0 comments on commit 3fbc6fa

Please sign in to comment.