Skip to content

Commit

Permalink
Small fix in two_adic_valuation (#809)
Browse files Browse the repository at this point in the history
* Small fix in two_adic_valuation

* make clippy happy

* typo
  • Loading branch information
tcoratger authored Mar 25, 2024
1 parent f980e76 commit 96249a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ff/src/biginteger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ impl<const N: usize> BigInt<N> {
/// Compute the largest integer `s` such that `self = 2**s * t + 1` for odd `t`.
#[doc(hidden)]
pub const fn two_adic_valuation(mut self) -> u32 {
let mut two_adicity = 0;
assert!(self.const_is_odd());
let mut two_adicity = 0;
// Since `self` is odd, we can always subtract one
// without a borrow
self.0[0] -= 1;
Expand Down
2 changes: 2 additions & 0 deletions ff/src/fields/field_hashers/expander/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl DST {
DST(array)
}

#[allow(dead_code)]
pub fn new_xof<H: ExtendableOutput + Default>(dst: &[u8], k: usize) -> DST {
let array = if dst.len() > MAX_DST_LENGTH {
let mut long = H::default();
Expand All @@ -56,6 +57,7 @@ impl DST {
}
}

#[allow(dead_code)]
pub(super) struct ExpanderXof<H: ExtendableOutput + Clone + Default> {
pub(super) xofer: PhantomData<H>,
pub(super) dst: Vec<u8>,
Expand Down
2 changes: 1 addition & 1 deletion ff/src/fields/models/fp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub trait FpConfig<const N: usize>: Send + Sync + 'static + Sized {
/// Compute the inner product `<a, b>`.
fn sum_of_products<const T: usize>(a: &[Fp<Self, N>; T], b: &[Fp<Self, N>; T]) -> Fp<Self, N>;

/// Set a *= b.
/// Set a *= a.
fn square_in_place(a: &mut Fp<Self, N>);

/// Compute a^{-1} if `a` is not zero.
Expand Down

0 comments on commit 96249a5

Please sign in to comment.