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

Function chunk_frob_fp12

bitvm/src/chunk/taps_ext_miller.rs:203–232  ·  view source on GitHub ↗

Assumes (1 + f) is valid Fp12 i.e. f != Fq6::ZERO power is in the range (0, 1, 2)

(
    f: ark_bn254::Fq6,
    power: usize,
)

Source from the content-addressed store, hash-verified

201// Assumes (1 + f) is valid Fp12 i.e. f != Fq6::ZERO
202// power is in the range (0, 1, 2)
203pub(crate) fn chunk_frob_fp12(
204 f: ark_bn254::Fq6,
205 power: usize,
206) -> (ark_bn254::Fq6, bool, Script, Vec<Hint>) {
207 let fp12 = ark_bn254::Fq12::new(ark_bn254::Fq6::ONE, f);
208 let (hinted_frob_scr, hints_frobenius_map) = Fq12::hinted_frobenius_map(power, fp12);
209 let g = fp12.frobenius_map(power);
210
211 let ops_scr = script! {
212 // [f]
213
214 // Validity checks
215 { Fq6::check_validity() }
216 { Fq6::fromaltstack() }
217
218 {Fq6::push(ark_bn254::Fq6::ONE)}
219 {Fq6::copy(6)}
220 // [f, (1, f)]
221 {hinted_frob_scr}
222 // [f, (1, g)]
223 {Fq6::roll(6)}
224 {Fq6::push(ark_bn254::Fq6::ONE)}
225 {Fq6::equalverify()}
226 // [f, g]
227 {1} // input was valid
228 };
229
230 let valid_input = true;
231 (g.c1, valid_input, ops_scr, hints_frobenius_map)
232}
233
234pub(crate) fn chunk_hash_c(
235 hint_in_c: Vec<ark_ff::BigInt<4>>,

Callers 3

verify_pairing_scriptedFunction · 0.85
wrap_hints_frob_fp12Function · 0.85
test_chunk_frob_fp12Function · 0.85

Calls

no outgoing calls

Tested by 1

test_chunk_frob_fp12Function · 0.68