Skip to content

Commit

Permalink
feat(starknet_os): integrate secp hints
Browse files Browse the repository at this point in the history
  • Loading branch information
dorimedini-starkware committed Jan 28, 2025
1 parent 447e70f commit cc77447
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/starknet_os/src/hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ pub mod math;
pub mod os;
pub mod output;
pub mod patricia;
pub mod secp;
pub mod stateless_compression;
pub mod types;
6 changes: 6 additions & 0 deletions crates/starknet_os/src/hints/enum_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ use crate::hints::patricia::{
split_descend,
write_case_not_left_to_ap,
};
use crate::hints::secp::read_ec_point_from_address;
use crate::hints::stateless_compression::{
compression_hint,
dictionary_from_bucket,
Expand Down Expand Up @@ -1171,6 +1172,11 @@ else:
common_args['common_args'] = common_args"#
}
),
(
ReadEcPointFromAddress,
read_ec_point_from_address,
r#"memory[ap] = to_felt_or_relocatable(ids.response.ec_point.address_ if ids.not_on_curve == 0 else segments.add())"#
)
);

define_hint_extension_enum!(
Expand Down
19 changes: 19 additions & 0 deletions crates/starknet_os/src/hints/secp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use std::collections::HashMap;

use cairo_vm::hint_processor::hint_processor_definition::HintReference;
use cairo_vm::serde::deserialize_program::ApTracking;
use cairo_vm::types::exec_scope::ExecutionScopes;
use cairo_vm::vm::vm_core::VirtualMachine;
use starknet_types_core::felt::Felt;

use crate::hints::error::HintResult;

pub fn read_ec_point_from_address(
_vm: &mut VirtualMachine,
_exec_scopes: &mut ExecutionScopes,
_ids_data: &HashMap<String, HintReference>,
_ap_tracking: &ApTracking,
_constants: &HashMap<String, Felt>,
) -> HintResult {
todo!()
}

0 comments on commit cc77447

Please sign in to comment.