mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-02-05 01:56:41 +01:00
Refactor UInt{8,16,64,128} into one struct UInt (#121)
This commit is contained in:
@@ -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<_>>();
|
||||
|
||||
Reference in New Issue
Block a user