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

Function wrap_hints_precompute_p_from_hash

bitvm/src/chunk/g16_runner_utils.rs:411–434  ·  view source on GitHub ↗
(
    skip: bool,
    segment_id: usize,
    in_p: &Segment,
)

Source from the content-addressed store, hash-verified

409}
410
411pub(crate) fn wrap_hints_precompute_p_from_hash(
412 skip: bool,
413 segment_id: usize,
414 in_p: &Segment,
415) -> Segment {
416 let input_segment_info = vec![(in_p.id, ElementType::G1)];
417
418 let (mut p3d, mut is_valid_input, mut scr, mut op_hints) =
419 (ark_bn254::G1Affine::identity(), true, script! {}, vec![]);
420 if !skip {
421 let in_p = in_p.result.0.try_into().unwrap();
422 (p3d, is_valid_input, scr, op_hints) = chunk_precompute_p_from_hash(in_p);
423 }
424
425 Segment {
426 id: segment_id as u32,
427 is_valid_input,
428 parameter_ids: input_segment_info,
429 result: (DataType::G1Data(p3d), ElementType::G1),
430 hints: op_hints,
431 scr_type: ScriptType::PreMillerPrecomputePFromHash,
432 scr: scr.compile(),
433 }
434}
435
436pub(crate) fn wrap_hint_hash_c(skip: bool, segment_id: usize, in_c: Vec<Segment>) -> Segment {
437 let mut input_segment_info: Vec<(SegmentID, ElementType)> = vec![];

Callers 1

Calls 1

Tested by

no test coverage detected