use crate::stdlib::{borrow::Cow, collections::HashMap, prelude::*};
use crate::types::errors::math_errors::MathError;
use crate::Felt252;
use crate::{
hint_processor::{
builtin_hint_processor::{
blake2s_hash::{blake2s_compress, IV},
hint_utils::{get_ptr_from_var_name, get_relocatable_from_var_name},
},
hint_processor_definition::HintReference,
hint_processor_utils::felt_to_u32,
},
math_utils::pow2_const_nz,
serde::deserialize_program::ApTracking,
types::relocatable::{MaybeRelocatable, Relocatable},
vm::{errors::hint_errors::HintError, vm_core::VirtualMachine},
};
use num_traits::ToPrimitive;
use super::hint_utils::get_integer_from_var_name;
fn get_fixed_size_u32_array<const T: usize>(
h_range: &Vec<Cow<Felt252>>,
) -> Result<[u32; T], HintError> {
let mut u32_vec = Vec::<u32>::with_capacity(h_range.len());
for num in h_range {
u32_vec.push(num.to_u32().ok_or(HintError::BigintToU32Fail)?);
}
u32_vec
.try_into()
.map_err(|_| HintError::FixedSizeArrayFail(T))
}
fn get_maybe_relocatable_array_from_u32(array: &Vec<u32>) -> Vec<MaybeRelocatable> {
let mut new_array = Vec::<MaybeRelocatable>::with_capacity(array.len());
for element in array {
new_array.push(MaybeRelocatable::from(Felt252::from(*element)));
}
new_array
}
fn compute_blake2s_func(vm: &mut VirtualMachine, output_ptr: Relocatable) -> Result<(), HintError> {
let h = get_fixed_size_u32_array::<8>(&vm.get_integer_range((output_ptr - 26)?, 8)?)?;
let message = get_fixed_size_u32_array::<16>(&vm.get_integer_range((output_ptr - 18)?, 16)?)?;
let t = felt_to_u32(vm.get_integer((output_ptr - 2)?)?.as_ref())?;
let f = felt_to_u32(vm.get_integer((output_ptr - 1)?)?.as_ref())?;
let new_state =
get_maybe_relocatable_array_from_u32(&blake2s_compress(&h, &message, t, 0, f, 0));
vm.load_data(output_ptr, &new_state)
.map_err(HintError::Memory)?;
Ok(())
}
pub fn compute_blake2s(
vm: &mut VirtualMachine,
ids_data: &HashMap<String, HintReference>,
ap_tracking: &ApTracking,
) -> Result<(), HintError> {
let output = get_ptr_from_var_name("output", vm, ids_data, ap_tracking)?;
compute_blake2s_func(vm, output)
}
pub fn finalize_blake2s(
vm: &mut VirtualMachine,
ids_data: &HashMap<String, HintReference>,
ap_tracking: &ApTracking,
) -> Result<(), HintError> {
const N_PACKED_INSTANCES: usize = 7;
let blake2s_ptr_end = get_ptr_from_var_name("blake2s_ptr_end", vm, ids_data, ap_tracking)?;
let message: [u32; 16] = [0; 16];
let mut modified_iv = IV;
modified_iv[0] = IV[0] ^ 0x01010020;
let output = blake2s_compress(&modified_iv, &message, 0, 0, 0xffffffff, 0);
let mut padding = modified_iv.to_vec();
padding.extend(message);
padding.extend([0, 0xffffffff]);
padding.extend(output);
let padding = padding.as_slice();
let mut full_padding = Vec::<u32>::with_capacity(padding.len() * N_PACKED_INSTANCES);
for _ in 0..N_PACKED_INSTANCES - 1 {
full_padding.extend_from_slice(padding);
}
let data = get_maybe_relocatable_array_from_u32(&full_padding);
vm.load_data(blake2s_ptr_end, &data)
.map_err(HintError::Memory)?;
Ok(())
}
pub fn finalize_blake2s_v3(
vm: &mut VirtualMachine,
ids_data: &HashMap<String, HintReference>,
ap_tracking: &ApTracking,
) -> Result<(), HintError> {
const N_PACKED_INSTANCES: usize = 7;
let blake2s_ptr_end = get_ptr_from_var_name("blake2s_ptr_end", vm, ids_data, ap_tracking)?;
let message: [u32; 16] = [0; 16];
let mut modified_iv = IV;
modified_iv[0] = IV[0] ^ 0x01010020;
let output = blake2s_compress(&modified_iv, &message, 0, 0, 0xffffffff, 0);
let mut padding = message.to_vec();
padding.extend(modified_iv);
padding.extend([0, 0xffffffff]);
padding.extend(output);
let padding = padding.as_slice();
let mut full_padding = Vec::<u32>::with_capacity(padding.len() * N_PACKED_INSTANCES);
for _ in 0..N_PACKED_INSTANCES - 1 {
full_padding.extend_from_slice(padding);
}
let data = get_maybe_relocatable_array_from_u32(&full_padding);
vm.load_data(blake2s_ptr_end, &data)
.map_err(HintError::Memory)?;
Ok(())
}
pub fn blake2s_add_uint256(
vm: &mut VirtualMachine,
ids_data: &HashMap<String, HintReference>,
ap_tracking: &ApTracking,
) -> Result<(), HintError> {
let data_ptr = get_ptr_from_var_name("data", vm, ids_data, ap_tracking)?;
let low_addr = get_relocatable_from_var_name("low", vm, ids_data, ap_tracking)?;
let high_addr = get_relocatable_from_var_name("high", vm, ids_data, ap_tracking)?;
let mut low = vm.get_integer(low_addr)?.into_owned();
let mut high = vm.get_integer(high_addr)?.into_owned();
let b = pow2_const_nz(32);
let mut data = Vec::<MaybeRelocatable>::with_capacity(8);
for _ in 0..4 {
let (q, r) = low.div_rem(b);
data.push(r.into());
low = q;
}
for _ in 0..4 {
let (q, r) = high.div_rem(b);
data.push(r.into());
high = q;
}
vm.load_data(data_ptr, &data).map_err(HintError::Memory)?;
Ok(())
}
pub fn blake2s_add_uint256_bigend(
vm: &mut VirtualMachine,
ids_data: &HashMap<String, HintReference>,
ap_tracking: &ApTracking,
) -> Result<(), HintError> {
let data_ptr = get_ptr_from_var_name("data", vm, ids_data, ap_tracking)?;
let low_addr = get_relocatable_from_var_name("low", vm, ids_data, ap_tracking)?;
let high_addr = get_relocatable_from_var_name("high", vm, ids_data, ap_tracking)?;
let mut low = vm.get_integer(low_addr)?.into_owned();
let mut high = vm.get_integer(high_addr)?.into_owned();
let b = pow2_const_nz(32);
let mut data = Vec::<MaybeRelocatable>::with_capacity(8);
for _ in 0..4 {
let (q, r) = low.div_rem(b);
data.push(r.into());
low = q;
}
for _ in 0..4 {
let (q, r) = high.div_rem(b);
data.push(r.into());
high = q;
}
data.reverse();
vm.load_data(data_ptr, &data).map_err(HintError::Memory)?;
Ok(())
}
pub fn example_blake2s_compress(
vm: &mut VirtualMachine,
ids_data: &HashMap<String, HintReference>,
ap_tracking: &ApTracking,
) -> Result<(), HintError> {
let blake2s_start = get_ptr_from_var_name("blake2s_start", vm, ids_data, ap_tracking)?;
let output = get_ptr_from_var_name("output", vm, ids_data, ap_tracking)?;
let n_bytes = get_integer_from_var_name("n_bytes", vm, ids_data, ap_tracking).map(|x| {
x.to_u32()
.ok_or_else(|| HintError::Math(MathError::Felt252ToU32Conversion(Box::new(x))))
})??;
let message = get_fixed_size_u32_array::<16>(&vm.get_integer_range(blake2s_start, 16)?)?;
let mut modified_iv = IV;
modified_iv[0] = IV[0] ^ 0x01010020;
let new_state = blake2s_compress(&modified_iv, &message, n_bytes, 0, 0xffffffff, 0);
let new_state: Vec<MaybeRelocatable> = new_state
.iter()
.map(|x| MaybeRelocatable::from(*x as usize))
.collect();
vm.segments.write_arg(output, &new_state)?;
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use crate::hint_processor::builtin_hint_processor::hint_code;
use crate::types::errors::math_errors::MathError;
use crate::{
any_box,
hint_processor::{
builtin_hint_processor::builtin_hint_processor_definition::{
BuiltinHintProcessor, HintProcessorData,
},
hint_processor_definition::HintProcessorLogic,
},
relocatable,
utils::test_utils::*,
vm::errors::memory_errors::MemoryError,
};
use assert_matches::assert_matches;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::*;
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn compute_blake2s_output_offset_zero() {
let hint_code = "from starkware.cairo.common.cairo_blake2s.blake2s_utils import compute_blake2s_func\ncompute_blake2s_func(segments=segments, output_ptr=ids.output)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![((1, 0), (2, 5))];
let ids_data = ids_data!["output"];
assert_matches!(
run_hint!(vm, ids_data, hint_code),
Err(HintError::Math(MathError::RelocatableSubUsizeNegOffset(bx)))
if *bx == (relocatable!(2,5), 26)
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn compute_blake2s_output_empty_segment() {
let hint_code = "from starkware.cairo.common.cairo_blake2s.blake2s_utils import compute_blake2s_func\ncompute_blake2s_func(segments=segments, output_ptr=ids.output)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![((1, 0), (2, 26))];
add_segments!(vm, 1);
let ids_data = ids_data!["output"];
assert_matches!(
run_hint!(vm, ids_data, hint_code),
Err(HintError::Memory(MemoryError::UnknownMemoryCell(
bx
))) if *bx == Relocatable::from((2, 0))
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn compute_blake2s_output_not_relocatable() {
let hint_code = "from starkware.cairo.common.cairo_blake2s.blake2s_utils import compute_blake2s_func\ncompute_blake2s_func(segments=segments, output_ptr=ids.output)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![((1, 0), 12)];
let ids_data = ids_data!["output"];
assert_matches!(
run_hint!(vm, ids_data, hint_code),
Err(HintError::IdentifierNotRelocatable(bx))
if bx.as_ref() == "output"
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn compute_blake2s_output_input_bigger_than_u32() {
let hint_code = "from starkware.cairo.common.cairo_blake2s.blake2s_utils import compute_blake2s_func\ncompute_blake2s_func(segments=segments, output_ptr=ids.output)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![
((1, 0), (2, 26)),
((2, 0), 7842562439562793675803603603688959_i128),
((2, 1), 7842562439562793675803603603688959_i128),
((2, 2), 7842562439562793675803603603688959_i128),
((2, 3), 7842562439562793675803603603688959_i128),
((2, 4), 7842562439562793675803603603688959_i128),
((2, 5), 7842562439562793675803603603688959_i128),
((2, 6), 7842562439562793675803603603688959_i128),
((2, 7), 7842562439562793675803603603688959_i128)
];
let ids_data = ids_data!["output"];
assert_matches!(
run_hint!(vm, ids_data, hint_code),
Err(HintError::BigintToU32Fail)
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn compute_blake2s_output_input_relocatable() {
let hint_code = "from starkware.cairo.common.cairo_blake2s.blake2s_utils import compute_blake2s_func\ncompute_blake2s_func(segments=segments, output_ptr=ids.output)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![((1, 0), (2, 26)), ((2, 0), (5, 5))];
let ids_data = ids_data!["output"];
assert_matches!(
run_hint!(vm, ids_data, hint_code),
Err(HintError::Memory(MemoryError::ExpectedInteger(
bx
))) if *bx == Relocatable::from((2, 0))
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn finalize_blake2s_valid() {
let hint_code = "# Add dummy pairs of input and output.\nfrom starkware.cairo.common.cairo_blake2s.blake2s_utils import IV, blake2s_compress\n\n_n_packed_instances = int(ids.N_PACKED_INSTANCES)\nassert 0 <= _n_packed_instances < 20\n_blake2s_input_chunk_size_felts = int(ids.INPUT_BLOCK_FELTS)\nassert 0 <= _blake2s_input_chunk_size_felts < 100\n\nmessage = [0] * _blake2s_input_chunk_size_felts\nmodified_iv = [IV[0] ^ 0x01010020] + IV[1:]\noutput = blake2s_compress(\n message=message,\n h=modified_iv,\n t0=0,\n t1=0,\n f0=0xffffffff,\n f1=0,\n)\npadding = (modified_iv + message + [0, 0xffffffff] + output) * (_n_packed_instances - 1)\nsegments.write_arg(ids.blake2s_ptr_end, padding)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![((1, 0), (2, 0))];
add_segments!(vm, 1);
let ids_data = ids_data!["blake2s_ptr_end"];
assert_matches!(run_hint!(vm, ids_data, hint_code), Ok(()));
let expected_data: [u32; 204] = [
1795745351, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635,
1541459225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967295, 813310313,
2491453561, 3491828193, 2085238082, 1219908895, 514171180, 4245497115, 4193177630,
1795745351, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635,
1541459225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967295, 813310313,
2491453561, 3491828193, 2085238082, 1219908895, 514171180, 4245497115, 4193177630,
1795745351, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635,
1541459225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967295, 813310313,
2491453561, 3491828193, 2085238082, 1219908895, 514171180, 4245497115, 4193177630,
1795745351, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635,
1541459225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967295, 813310313,
2491453561, 3491828193, 2085238082, 1219908895, 514171180, 4245497115, 4193177630,
1795745351, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635,
1541459225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967295, 813310313,
2491453561, 3491828193, 2085238082, 1219908895, 514171180, 4245497115, 4193177630,
1795745351, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635,
1541459225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967295, 813310313,
2491453561, 3491828193, 2085238082, 1219908895, 514171180, 4245497115, 4193177630,
];
let data = get_fixed_size_u32_array::<204>(
&vm.segments
.memory
.get_integer_range(relocatable!(2, 0), 204)
.unwrap(),
)
.unwrap();
assert_eq!(expected_data, data);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn finalize_blake2s_invalid_segment_taken() {
let hint_code = "# Add dummy pairs of input and output.\nfrom starkware.cairo.common.cairo_blake2s.blake2s_utils import IV, blake2s_compress\n\n_n_packed_instances = int(ids.N_PACKED_INSTANCES)\nassert 0 <= _n_packed_instances < 20\n_blake2s_input_chunk_size_felts = int(ids.INPUT_BLOCK_FELTS)\nassert 0 <= _blake2s_input_chunk_size_felts < 100\n\nmessage = [0] * _blake2s_input_chunk_size_felts\nmodified_iv = [IV[0] ^ 0x01010020] + IV[1:]\noutput = blake2s_compress(\n message=message,\n h=modified_iv,\n t0=0,\n t1=0,\n f0=0xffffffff,\n f1=0,\n)\npadding = (modified_iv + message + [0, 0xffffffff] + output) * (_n_packed_instances - 1)\nsegments.write_arg(ids.blake2s_ptr_end, padding)";
let mut vm = vm!();
vm.run_context.fp = 1;
vm.segments = segments![((1, 0), (2, 0)), ((2, 0), (2, 0))];
let ids_data = ids_data!["blake2s_ptr_end"];
assert_matches!(
run_hint!(vm, ids_data, hint_code),
Err(HintError::Memory(
MemoryError::InconsistentMemory(bx)
)) if *bx == (Relocatable::from((2, 0)),
MaybeRelocatable::from((2, 0)),
MaybeRelocatable::from(Felt252::from(1795745351)))
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn finalize_blake2s_invalid_no_ids() {
let hint_code = "# Add dummy pairs of input and output.\nfrom starkware.cairo.common.cairo_blake2s.blake2s_utils import IV, blake2s_compress\n\n_n_packed_instances = int(ids.N_PACKED_INSTANCES)\nassert 0 <= _n_packed_instances < 20\n_blake2s_input_chunk_size_felts = int(ids.INPUT_BLOCK_FELTS)\nassert 0 <= _blake2s_input_chunk_size_felts < 100\n\nmessage = [0] * _blake2s_input_chunk_size_felts\nmodified_iv = [IV[0] ^ 0x01010020] + IV[1:]\noutput = blake2s_compress(\n message=message,\n h=modified_iv,\n t0=0,\n t1=0,\n f0=0xffffffff,\n f1=0,\n)\npadding = (modified_iv + message + [0, 0xffffffff] + output) * (_n_packed_instances - 1)\nsegments.write_arg(ids.blake2s_ptr_end, padding)";
let mut vm = vm!();
vm.run_context.fp = 1;
assert_matches!(
run_hint!(vm, HashMap::new(), hint_code),
Err(HintError::UnknownIdentifier(bx)) if bx.as_ref() == "blake2s_ptr_end"
);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn blake2s_add_uint256_valid_zero() {
let hint_code = "B = 32\nMASK = 2 ** 32 - 1\nsegments.write_arg(ids.data, [(ids.low >> (B * i)) & MASK for i in range(4)])\nsegments.write_arg(ids.data + 4, [(ids.high >> (B * i)) & MASK for i in range(4)])";
let mut vm = vm!();
vm.run_context.fp = 3;
vm.segments = segments![((1, 0), (2, 0)), ((1, 1), 0), ((1, 2), 0)];
vm.segments.add();
let ids_data = ids_data!["data", "high", "low"];
assert_matches!(run_hint!(vm, ids_data, hint_code), Ok(()));
check_memory![
vm.segments.memory,
((2, 0), 0),
((2, 1), 0),
((2, 2), 0),
((2, 3), 0),
((2, 4), 0),
((2, 5), 0),
((2, 6), 0),
((2, 7), 0)
];
assert!(vm
.segments
.memory
.get(&MaybeRelocatable::from((2, 8)))
.is_none());
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn blake2s_add_uint256_valid_non_zero() {
let hint_code = "B = 32\nMASK = 2 ** 32 - 1\nsegments.write_arg(ids.data, [(ids.low >> (B * i)) & MASK for i in range(4)])\nsegments.write_arg(ids.data + 4, [(ids.high >> (B * i)) & MASK for i in range(4)])";
let mut vm = vm!();
vm.run_context.fp = 3;
vm.segments = segments![((1, 0), (2, 0)), ((1, 1), 25), ((1, 2), 20)];
vm.segments.add();
let ids_data = ids_data!["data", "high", "low"];
assert_matches!(run_hint!(vm, ids_data, hint_code), Ok(()));
check_memory![
vm.segments.memory,
((2, 0), 20),
((2, 1), 0),
((2, 2), 0),
((2, 3), 0),
((2, 4), 25),
((2, 5), 0),
((2, 6), 0),
((2, 7), 0)
];
assert!(vm
.segments
.memory
.get(&MaybeRelocatable::from((2, 8)))
.is_none());
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn blake2s_add_uint256_bigend_valid_zero() {
let hint_code = "B = 32\nMASK = 2 ** 32 - 1\nsegments.write_arg(ids.data, [(ids.high >> (B * (3 - i))) & MASK for i in range(4)])\nsegments.write_arg(ids.data + 4, [(ids.low >> (B * (3 - i))) & MASK for i in range(4)])";
let mut vm = vm!();
vm.run_context.fp = 3;
vm.segments = segments![((1, 0), (2, 0)), ((1, 1), 0), ((1, 2), 0)];
add_segments!(vm, 1);
let ids_data = ids_data!["data", "high", "low"];
assert_matches!(run_hint!(vm, ids_data, hint_code), Ok(()));
check_memory![
vm.segments.memory,
((2, 0), 0),
((2, 1), 0),
((2, 2), 0),
((2, 3), 0),
((2, 4), 0),
((2, 5), 0),
((2, 6), 0),
((2, 7), 0)
];
assert!(vm
.segments
.memory
.get(&MaybeRelocatable::from((2, 8)))
.is_none());
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn blake2s_add_uint256_bigend_valid_non_zero() {
let hint_code = "B = 32\nMASK = 2 ** 32 - 1\nsegments.write_arg(ids.data, [(ids.high >> (B * (3 - i))) & MASK for i in range(4)])\nsegments.write_arg(ids.data + 4, [(ids.low >> (B * (3 - i))) & MASK for i in range(4)])";
let mut vm = vm!();
vm.run_context.fp = 3;
vm.segments = segments![((1, 0), (2, 0)), ((1, 1), 25), ((1, 2), 20)];
vm.segments.add();
let ids_data = ids_data!["data", "high", "low"];
assert_matches!(run_hint!(vm, ids_data, hint_code), Ok(()));
check_memory![
vm.segments.memory,
((2, 0), 0),
((2, 1), 0),
((2, 2), 0),
((2, 3), 25),
((2, 4), 0),
((2, 5), 0),
((2, 6), 0),
((2, 7), 20)
];
assert!(vm
.segments
.memory
.get(&MaybeRelocatable::from((2, 8)))
.is_none());
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn example_blake2s_compress_n_bytes_over_u32() {
let mut vm = vm!();
vm.run_context.fp = 3;
vm.segments = segments![((1, 0), 9999999999_u64), ((1, 1), (1, 0)), ((1, 2), (2, 0))];
let ids_data = ids_data!["n_bytes", "output", "blake2s_start"];
assert_matches!(run_hint!(vm, ids_data, hint_code::EXAMPLE_BLAKE2S_COMPRESS), Err(HintError::Math(MathError::Felt252ToU32Conversion(bx))) if *bx == Felt252::from(9999999999_u64));
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn example_blake2s_empty_input() {
let mut vm = vm!();
vm.run_context.fp = 3;
vm.segments = segments![((1, 0), 9), ((1, 1), (1, 0)), ((1, 2), (2, 0))];
let ids_data = ids_data!["n_bytes", "output", "blake2s_start"];
assert_matches!(run_hint!(vm, ids_data, hint_code::EXAMPLE_BLAKE2S_COMPRESS), Err(HintError::Memory(MemoryError::UnknownMemoryCell(bx))) if *bx == (2, 0).into());
}
}