Skip to content

Commit 865bb5e

Browse files
authored
fix: correct secp256r1 gas deduction for New and GetPointFromX syscalls (#8711)
1 parent 1d69946 commit 865bb5e

File tree

1 file changed

+2
-2
lines changed
  • crates/cairo-lang-runner/src/casm_run

1 file changed

+2
-2
lines changed

crates/cairo-lang-runner/src/casm_run/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ fn secp256r1_new(
16081608
y: BigUint,
16091609
exec_scopes: &mut ExecutionScopes,
16101610
) -> Result<SyscallResult, HintError> {
1611-
deduct_gas!(gas_counter, SECP256R1_GET_POINT_FROM_X);
1611+
deduct_gas!(gas_counter, SECP256R1_NEW);
16121612
let modulus = <secp256r1::Fq as PrimeField>::MODULUS.into();
16131613
if x >= modulus || y >= modulus {
16141614
fail_syscall!(b"Coordinates out of range");
@@ -1671,7 +1671,7 @@ fn secp256r1_get_point_from_x(
16711671
y_parity: bool,
16721672
exec_scopes: &mut ExecutionScopes,
16731673
) -> Result<SyscallResult, HintError> {
1674-
deduct_gas!(gas_counter, SECP256R1_NEW);
1674+
deduct_gas!(gas_counter, SECP256R1_GET_POINT_FROM_X);
16751675
if x >= <secp256r1::Fq as PrimeField>::MODULUS.into() {
16761676
fail_syscall!(b"Coordinates out of range");
16771677
}

0 commit comments

Comments
 (0)