fix: incorrectly prevented to_radix_2w_size_hint on u32e

This function should be able to be enabled by feature
selection.
This commit is contained in:
David Kotval 2024-03-21 16:35:12 -05:00
parent 4fdd15c3af
commit 0a0a972dfa

View file

@ -1026,9 +1026,7 @@ impl Scalar {
output output
} }
cfg_if::cfg_if!{ #[cfg(any(feature = "alloc", all(test, feature = "precomputed-tables")))]
if #[cfg(curve25519_dalek_backend = "u32e_backend")]{}
else if #[cfg(any(feature = "alloc", all(test, feature = "precomputed-tables")))] {
/// Returns a size hint indicating how many entries of the return /// Returns a size hint indicating how many entries of the return
/// value of `to_radix_2w` are nonzero. /// value of `to_radix_2w` are nonzero.
pub(crate) fn to_radix_2w_size_hint(w: usize) -> usize { pub(crate) fn to_radix_2w_size_hint(w: usize) -> usize {
@ -1045,8 +1043,6 @@ impl Scalar {
debug_assert!(digits_count <= 64); debug_assert!(digits_count <= 64);
digits_count digits_count
} }
}
}
/// Creates a representation of a Scalar in radix \\( 2^w \\) with \\(w = 4, 5, 6, 7, 8\\) for /// Creates a representation of a Scalar in radix \\( 2^w \\) with \\(w = 4, 5, 6, 7, 8\\) for
/// use with the Pippenger algorithm. Higher radixes are not supported to save cache space. /// use with the Pippenger algorithm. Higher radixes are not supported to save cache space.