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

Function utils_collect_mul_hints_per_segment

bitvm/src/chunk/api_runtime_utils.rs:360–387  ·  view source on GitHub ↗
(segments: &[Segment])

Source from the content-addressed store, hash-verified

358}
359
360fn utils_collect_mul_hints_per_segment(segments: &[Segment]) -> Vec<Vec<Hint>> {
361 let aux_hints: Vec<Vec<Hint>> = segments
362 .iter()
363 .map(|seg| {
364 let mut hints = seg.hints.clone();
365 // hashing preimage for input
366 seg.parameter_ids
367 .iter()
368 .rev()
369 .for_each(|(param_seg_id, param_seg_type)| {
370 let param_seg = &segments[*(param_seg_id) as usize];
371 if !param_seg.result.0.output_is_field_element() {
372 let preimage_hints = param_seg.result.0.to_witness(*param_seg_type);
373 hints.extend_from_slice(&preimage_hints);
374 }
375 });
376 // hashing preimage for output
377 if seg.scr_type == ScriptType::FoldedFp12Multiply
378 || seg.scr_type == ScriptType::MillerSquaring
379 || seg.scr_type == ScriptType::MillerPointOpsStep2
380 {
381 hints.extend_from_slice(&seg.result.0.to_witness(seg.result.1));
382 }
383 hints
384 })
385 .collect();
386 aux_hints
387}
388
389fn utils_execute_chunked_g16(
390 aux_hints: Vec<Vec<Hint>>,

Calls 3

cloneMethod · 0.80
to_witnessMethod · 0.80

Tested by

no test coverage detected