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

Function wrap_hints_dense_dense_mul

bitvm/src/chunk/g16_runner_utils.rs:138–165  ·  view source on GitHub ↗

dmul

(
    skip: bool,
    segment_id: usize,
    in_a: &Segment,
    in_b: &Segment,
)

Source from the content-addressed store, hash-verified

136
137// dmul
138pub(crate) fn wrap_hints_dense_dense_mul(
139 skip: bool,
140 segment_id: usize,
141 in_a: &Segment,
142 in_b: &Segment,
143) -> Segment {
144 let input_segment_info: Vec<(SegmentID, ElementType)> =
145 vec![(in_b.id, ElementType::Fp6), (in_a.id, ElementType::Fp6)];
146
147 let a: ark_bn254::Fq6 = in_a.result.0.try_into().unwrap();
148 let b: ark_bn254::Fq6 = in_b.result.0.try_into().unwrap();
149
150 let (mut dmul0, mut is_valid_input, mut scr, mut op_hints) =
151 (ark_bn254::Fq6::ONE, true, script! {}, vec![]);
152 if !skip {
153 (dmul0, is_valid_input, scr, op_hints) = chunk_dense_dense_mul(a, b);
154 }
155
156 Segment {
157 id: segment_id as u32,
158 is_valid_input,
159 parameter_ids: input_segment_info,
160 result: (DataType::Fp6Data(dmul0), ElementType::Fp6),
161 hints: op_hints,
162 scr_type: ScriptType::FoldedFp12Multiply,
163 scr: scr.compile(),
164 }
165}
166
167// frob
168pub(crate) fn wrap_hints_frob_fp12(

Callers 1

Calls 1

chunk_dense_dense_mulFunction · 0.85

Tested by

no test coverage detected