Refactor UInt{8,16,64,128} into one struct UInt (#121)

This commit is contained in:
Pratyush Mishra
2024-01-03 08:23:54 -05:00
committed by GitHub
parent 3cb9fdef00
commit d011859416
54 changed files with 5044 additions and 3081 deletions

View File

@@ -129,7 +129,10 @@ mod tests {
use ark_relations::r1cs::ConstraintSystem;
use ark_std::{rand::Rng, test_rng};
use crate::{alloc::AllocVar, fields::fp::FpVar, poly::domain::Radix2DomainVar, R1CSVar};
use crate::{
alloc::AllocVar, convert::ToBitsGadget, fields::fp::FpVar, poly::domain::Radix2DomainVar,
R1CSVar,
};
fn test_query_coset_template<F: PrimeField>() {
const COSET_DIM: u64 = 7;
@@ -145,9 +148,11 @@ mod tests {
let num_cosets = 1 << (COSET_DIM - LOCALIZATION);
let coset_index = rng.gen_range(0..num_cosets);
println!("{:0b}", coset_index);
let coset_index_var = UInt32::new_witness(cs.clone(), || Ok(coset_index))
.unwrap()
.to_bits_le()
.unwrap()
.into_iter()
.take(COSET_DIM as usize)
.collect::<Vec<_>>();