Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit f33d9cd

Browse files
authored
Assert le is second arc excluded (#412)
* Add assert_le_is_second_excluded hint * Reverse order for clarity
1 parent 1fb6600 commit f33d9cd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/cairo-1-hint-processor/src/hint_processor.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,23 @@ impl Cairo1HintProcessor {
262262

263263
Ok(())
264264
}
265+
266+
fn assert_le_is_second_excluded(
267+
&self,
268+
vm: &mut VirtualMachine,
269+
skip_exclude_b_minus_a: &CellRef,
270+
exec_scopes: &mut ExecutionScopes,
271+
) -> Result<(), HintError> {
272+
let excluded_arc: i32 = exec_scopes.get("excluded_arc")?;
273+
let val = if excluded_arc != 1 {
274+
Felt252::from(1)
275+
} else {
276+
Felt252::from(0)
277+
};
278+
279+
vm.insert_value(cell_ref_to_relocatable(skip_exclude_b_minus_a, vm), val)?;
280+
Ok(())
281+
}
265282
}
266283

267284
impl HintProcessor for Cairo1HintProcessor {
@@ -323,6 +340,9 @@ impl HintProcessor for Cairo1HintProcessor {
323340
Hint::AssertLeIsFirstArcExcluded {
324341
skip_exclude_a_flag,
325342
} => self.assert_le_if_first_arc_exclueded(vm, skip_exclude_a_flag, exec_scopes),
343+
Hint::AssertLeIsSecondArcExcluded {
344+
skip_exclude_b_minus_a,
345+
} => self.assert_le_is_second_excluded(vm, skip_exclude_b_minus_a, exec_scopes),
326346
Hint::LinearSplit {
327347
value,
328348
scalar,

0 commit comments

Comments
 (0)