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

Function extern_bigint_to_nibbles

bitvm/src/chunk/helpers.rs:22–26  ·  view source on GitHub ↗
(msg: ark_ff::BigInt<4>)

Source from the content-addressed store, hash-verified

20}
21
22pub(crate) fn extern_bigint_to_nibbles(msg: ark_ff::BigInt<4>) -> [u8; 64] {
23 let v = fq_to_chunked_bits(msg, 4);
24 let vu8: Vec<u8> = v.iter().map(|x| (*x) as u8).collect();
25 vu8.try_into().unwrap()
26}
27
28fn fq_to_chunked_bits(fq: BigInt<4>, limb_size: usize) -> Vec<u32> {
29 let bits: Vec<bool> = ark_ff::BitIteratorBE::new(fq.as_ref()).collect();

Callers 2

Calls 1

fq_to_chunked_bitsFunction · 0.85

Tested by 1