Skip to content

Commit 9186c8a

Browse files
Fix compute_ids_high_low hint constant path (#2193)
* Add test * Fix hardcoded constant path, and remove fallback * Add fallback * Update changelog
1 parent fd23bca commit 9186c8a

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#### Upcoming Changes
44

5+
* fix: Fix compute_ids_high_low hint constant path [#2193](https://github.com/lambdaclass/cairo-vm/pull/2193)
6+
57
#### [2.4.0] - 2025-27-29
68

79
* chore: Bump types-rs to 0.2.0 [#2186](https://github.com/lambdaclass/cairo-vm/pull/2186)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
%builtins range_check
2+
3+
from starkware.cairo.common.secp256r1.field import assert_165_bit
4+
5+
func main{range_check_ptr: felt}() {
6+
let value = 10;
7+
assert_165_bit(value);
8+
return ();
9+
}

vm/src/hint_processor/builtin_hint_processor/secp/cairo0_hints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ pub fn compute_ids_high_low(
170170
) -> Result<(), HintError> {
171171
exec_scopes.insert_value::<BigInt>("SECP256R1_P", SECP256R1_P.clone());
172172

173-
const UPPER_BOUND: &str = "starkware.cairo.common.math.assert_250_bit.UPPER_BOUND";
174-
const SHIFT: &str = "starkware.cairo.common.math.assert_250_bit.SHIFT";
173+
const UPPER_BOUND: &str = "starkware.cairo.common.secp256r1.field.assert_165_bit.UPPER_BOUND";
174+
const SHIFT: &str = "starkware.cairo.common.secp256r1.field.assert_165_bit.SHIFT";
175175

176176
let upper_bound = constants
177177
.get(UPPER_BOUND)

vm/src/tests/cairo_run_test.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,15 @@ fn cairo_run_secp_cairo0_negative_points() {
13531353
run_program_simple(program_data.as_slice());
13541354
}
13551355

1356+
#[test]
1357+
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
1358+
#[cfg(feature = "cairo-0-secp-hints")]
1359+
fn cairo_run_secp_cairo0_assert_165_bits() {
1360+
let program_data =
1361+
include_bytes!("../../../cairo_programs/cairo-0-secp-hints-feature/assert_165_bit.json");
1362+
run_program_simple(program_data.as_slice());
1363+
}
1364+
13561365
#[test]
13571366
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
13581367
#[cfg(feature = "cairo-0-data-availability-hints")]

0 commit comments

Comments
 (0)