PR feedback

This commit is contained in:
wborgeaud 2021-07-23 08:15:13 +02:00
parent e87aa2c90b
commit 47b9936487
2 changed files with 4 additions and 5 deletions

View File

@ -192,7 +192,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
pub fn exp_from_complement_bits(
&mut self,
base: Target,
exponent_bits: impl ExactSizeIterator<Item = impl Borrow<Target>>,
exponent_bits: impl Iterator<Item = impl Borrow<Target>>,
) -> Target {
let mut current = base;
let one_ext = self.one_extension();

View File

@ -14,11 +14,10 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
self.route(x, sum);
}
/// Returns the first `n_log` little-endian bits of `x`.
/// Note: `x` is assumed to be range-checked for having `num_bits` bits.
pub fn low_bits(&mut self, x: Target, n_log: usize, num_bits: usize) -> Vec<Target> {
/// Returns the first `num_low_bits` little-endian bits of `x`.
pub fn low_bits(&mut self, x: Target, num_low_bits: usize, num_bits: usize) -> Vec<Target> {
let mut res = self.split_le(x, num_bits);
res.truncate(n_log);
res.truncate(num_low_bits);
res
}