MCPcopy Create free account
hub / github.com/BitVM/BitVM / compare

Function compare

bitvm/src/chunk/g16_runner_core.rs:68–86  ·  view source on GitHub ↗
(hint_out: &DataType, claimed_assertions: &mut Option<Vec<HashBytes>>)

Source from the content-addressed store, hash-verified

66}
67
68fn compare(hint_out: &DataType, claimed_assertions: &mut Option<Vec<HashBytes>>) -> Option<bool> {
69 if claimed_assertions.is_none() {
70 return None;
71 }
72 assert!(!hint_out.output_is_field_element());
73
74 let hint_out_hash = hint_out.to_hash();
75 let matches = if let CompressedStateObject::Hash(hash) = hint_out_hash {
76 if let Some(claimed_assertions) = claimed_assertions {
77 claimed_assertions.pop().unwrap() == hash
78 } else {
79 unreachable!(); // verified that claimed_assertions is_some()
80 }
81 } else {
82 unreachable!(); // verified that hint_out is hash above
83 };
84
85 Some(matches)
86}
87
88pub(crate) fn groth16_generate_segments(
89 skip_evaluation: bool,

Callers

nothing calls this directly

Calls 1

to_hashMethod · 0.80

Tested by

no test coverage detected