(n: num_bigint::BigInt, n_bits: u32)
| 139 | |
| 140 | let r: ark_ff::BigInt<4> = BigInt::from_bits_be(&bit_array); |
| 141 | fn bigint_to_limbs(n: num_bigint::BigInt, n_bits: u32) -> Vec<u32> { |
| 142 | let mut limbs = vec![]; |
| 143 | let mut limb: u32 = 0; |
| 144 | for i in 0..n_bits as u64 { |
| 145 | if i > 0 && i % (LIMB_SIZE as u64) == 0 { |
| 146 | limbs.push(limb); |
| 147 | limb = 0; |
| 148 | } |
| 149 | if n.bit(i) { |
| 150 | limb += 1 << (i % (LIMB_SIZE as u64)); |
| 151 | } |
| 152 | } |
| 153 | limbs.push(limb); |
| 154 | limbs |
| 155 | } |
| 156 | |
| 157 | let mut limbs = bigint_to_limbs(r.into(), 256); |
| 158 | limbs.reverse(); |
no test coverage detected