From bcd4c5fd2acf52a10b6885b4054d933d69a46903 Mon Sep 17 00:00:00 2001 From: Tom Godden Date: Tue, 29 Nov 2022 11:58:21 +0100 Subject: [PATCH 1/2] Issue #23 --- src/bits/uint.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bits/uint.rs b/src/bits/uint.rs index c2fa303c..03e98003 100644 --- a/src/bits/uint.rs +++ b/src/bits/uint.rs @@ -175,7 +175,8 @@ macro_rules! make_uint { assert!($size <= 128); assert!(operands.len() >= 1); - assert!($size * operands.len() <= F::MODULUS_BIT_SIZE as usize); + assert!($size + (operands.len() as f32).log(2.).ceil() as usize + <= F::MODULUS_BIT_SIZE as usize); if operands.len() == 1 { return Ok(operands[0].clone()); From 46a89ad1ee25891f1ed0d213f8c64680766ab324 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Thu, 19 Jan 2023 15:30:26 -0800 Subject: [PATCH 2/2] fmt + use `ark_std::log2` --- src/bits/uint.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bits/uint.rs b/src/bits/uint.rs index 03e98003..b575af43 100644 --- a/src/bits/uint.rs +++ b/src/bits/uint.rs @@ -175,8 +175,7 @@ macro_rules! make_uint { assert!($size <= 128); assert!(operands.len() >= 1); - assert!($size + (operands.len() as f32).log(2.).ceil() as usize - <= F::MODULUS_BIT_SIZE as usize); + assert!($size + ark_std::log2(operands.len()) <= F::MODULUS_BIT_SIZE); if operands.len() == 1 { return Ok(operands[0].clone());