Skip to content

Commit

Permalink
chore(ci): toolchain update
Browse files Browse the repository at this point in the history
  • Loading branch information
IceTDrinker committed Dec 2, 2024
1 parent 51fd605 commit e0111f6
Show file tree
Hide file tree
Showing 34 changed files with 91 additions and 84 deletions.
2 changes: 1 addition & 1 deletion tfhe-fft/src/unordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ impl Plan {
base_n: usize,
}

impl<'de, 'a> Visitor<'de> for SeqVisitor<'a> {
impl<'de> Visitor<'de> for SeqVisitor<'_> {
type Value = ();

fn expecting(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion tfhe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exclude = [
"/js_on_wasm_tests/",
"/web_wasm_parallel_tests/",
]
rust-version = "1.82"
rust-version = "1.83"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
1 change: 1 addition & 0 deletions tfhe/src/boolean/parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl BooleanKeySwitchingParameters {

/// Parameter sets given in TFHE-lib:
/// <https://github.com/tfhe/tfhe/blob/bc71bfae7ad9d5f8ce5f29bdfd691189bfe207f3/src/libtfhe/tfhe_gate_bootstrapping.cpp#L51>
///
/// Original security in 2020 was 129-bits, while it is currently around 120 bits.
pub const TFHE_LIB_PARAMETERS: BooleanParameters = BooleanParameters {
lwe_dimension: LweDimension(630),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ pub struct StandardMultiBitModulusSwitchedCt<
}

impl<
'a,
Scalar: UnsignedInteger + CastInto<usize> + CastFrom<usize>,
C: Container<Element = Scalar> + Sync,
> MultiBitModulusSwitchedCt for StandardMultiBitModulusSwitchedCt<'a, Scalar, C>
> MultiBitModulusSwitchedCt for StandardMultiBitModulusSwitchedCt<'_, Scalar, C>
{
fn lwe_dimension(&self) -> LweDimension {
self.input.lwe_size().to_lwe_dimension()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ pub fn fill_with_forward_fourier_scratch(fft: FftView<'_>) -> Result<StackReq, S
fft.forward_scratch()
}

impl<'a> PseudoFourierGgswCiphertextMutView<'a> {
impl PseudoFourierGgswCiphertextMutView<'_> {
/// Fill a GGSW ciphertext with the Fourier transform of a GGSW ciphertext in the standard
/// domain.
pub fn fill_with_forward_fourier<
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/core_crypto/fft_impl/fft128/math/fft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ fn convert_backward_torus<Scalar: UnsignedTorus>(
}
}

impl<'a> Fft128View<'a> {
impl Fft128View<'_> {
pub fn polynomial_size(self) -> PolynomialSize {
PolynomialSize(2 * self.plan.fft_size())
}
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/core_crypto/fft_impl/fft128_u128/math/fft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ pub fn convert_add_backward_torus(
);
}

impl<'a> Fft128View<'a> {
impl Fft128View<'_> {
pub fn forward_as_integer_split(
self,
fourier_re0: &mut [f64],
Expand Down
4 changes: 2 additions & 2 deletions tfhe/src/core_crypto/fft_impl/fft64/crypto/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub fn fill_with_forward_fourier_scratch(fft: FftView<'_>) -> Result<StackReq, S
fft.forward_scratch()
}

impl<'a> FourierLweBootstrapKeyMutView<'a> {
impl FourierLweBootstrapKeyMutView<'_> {
/// Fill a bootstrapping key with the Fourier transform of a bootstrapping key in the standard
/// domain.
pub fn fill_with_forward_fourier<Scalar: UnsignedTorus>(
Expand Down Expand Up @@ -281,7 +281,7 @@ pub fn batch_bootstrap_scratch<Scalar>(
)?)
}

impl<'a> FourierLweBootstrapKeyView<'a> {
impl FourierLweBootstrapKeyView<'_> {
// CastInto required for PBS modulus switch which returns a usize
pub fn blind_rotate_assign<InputScalar, OutputScalar>(
self,
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/core_crypto/fft_impl/fft64/crypto/ggsw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub fn fill_with_forward_fourier_scratch(fft: FftView<'_>) -> Result<StackReq, S
fft.forward_scratch()
}

impl<'a> FourierGgswCiphertextMutView<'a> {
impl FourierGgswCiphertextMutView<'_> {
/// Fill a GGSW ciphertext with the Fourier transform of a GGSW ciphertext in the standard
/// domain.
pub fn fill_with_forward_fourier<Scalar: UnsignedTorus>(
Expand Down
5 changes: 5 additions & 0 deletions tfhe/src/core_crypto/fft_impl/fft64/math/decomposition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ impl<'buffers, Scalar: UnsignedInteger> TensorSignedDecompositionLendingIter<'bu

// inlining this improves perf of external product by about 25%, even in LTO builds
#[inline]
#[allow(
clippy::type_complexity,
reason = "The type complexity would require a pub type = ...; \
but impl Trait is not stable in pub type so we tell clippy to leave us alone"
)]
pub fn next_term<'short>(
&'short mut self,
) -> Option<(
Expand Down
6 changes: 3 additions & 3 deletions tfhe/src/core_crypto/fft_impl/fft64/math/fft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ fn convert_add_backward_torus<Scalar: UnsignedTorus>(
convert_add_backward_torus_scalar::<Scalar>(out_re, out_im, inp, twisties);
}

impl<'a> FftView<'a> {
impl FftView<'_> {
/// Return the polynomial size that this FFT was made for.
pub fn polynomial_size(self) -> PolynomialSize {
PolynomialSize(2 * self.plan.fft_size())
Expand Down Expand Up @@ -629,7 +629,7 @@ impl<C: Container<Element = c64>> serde::Serialize for FourierPolynomialList<C>
buf: &'a [c64],
}

impl<'a> serde::Serialize for SingleFourierPolynomial<'a> {
impl serde::Serialize for SingleFourierPolynomial<'_> {
fn serialize<S: serde::Serializer>(
&self,
serializer: S,
Expand Down Expand Up @@ -701,7 +701,7 @@ impl<'de, C: IntoContainerOwned<Element = c64>> serde::Deserialize<'de>
buf: &'a mut [c64],
}

impl<'de, 'a> serde::de::DeserializeSeed<'de> for FillFourier<'a> {
impl<'de> serde::de::DeserializeSeed<'de> for FillFourier<'_> {
type Value = ();

fn deserialize<D: serde::Deserializer<'de>>(
Expand Down
4 changes: 2 additions & 2 deletions tfhe/src/core_crypto/gpu/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct CudaSliceMut<'a, T: Numeric> {
_phantom_2: PhantomData<&'a mut ()>,
}

impl<'a, T> CudaSlice<'a, T>
impl<T> CudaSlice<'_, T>
where
T: Numeric,
{
Expand Down Expand Up @@ -53,7 +53,7 @@ where
}
}

impl<'a, T> CudaSliceMut<'a, T>
impl<T> CudaSliceMut<'_, T>
where
T: Numeric,
{
Expand Down
10 changes: 5 additions & 5 deletions tfhe/src/high_level_api/array/cpu/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl ArrayBackend for CpuFheBoolArrayBackend {
type Owned = Vec<BooleanBlock>;
}

impl<'a> BackendDataContainer for &'a [BooleanBlock] {
impl BackendDataContainer for &[BooleanBlock] {
type Backend = CpuFheBoolArrayBackend;

fn len(&self) -> usize {
Expand All @@ -55,7 +55,7 @@ impl<'a> BackendDataContainer for &'a [BooleanBlock] {
}
}

impl<'a> BackendDataContainer for &'a mut [BooleanBlock] {
impl BackendDataContainer for &mut [BooleanBlock] {
type Backend = CpuFheBoolArrayBackend;

fn len(&self) -> usize {
Expand All @@ -74,7 +74,7 @@ impl<'a> BackendDataContainer for &'a mut [BooleanBlock] {
}
}

impl<'a> BackendDataContainerMut for &'a mut [BooleanBlock] {
impl BackendDataContainerMut for &mut [BooleanBlock] {
fn as_sub_slice_mut(
&mut self,
range: impl RangeBounds<usize>,
Expand Down Expand Up @@ -220,7 +220,7 @@ impl FheTryEncrypt<&[bool], ClientKey> for CpuFheBoolArray {
}
}

impl<'a> FheDecrypt<Vec<bool>> for CpuFheBoolSlice<'a> {
impl FheDecrypt<Vec<bool>> for CpuFheBoolSlice<'_> {
fn decrypt(&self, key: &ClientKey) -> Vec<bool> {
self.elems
.iter()
Expand All @@ -229,7 +229,7 @@ impl<'a> FheDecrypt<Vec<bool>> for CpuFheBoolSlice<'a> {
}
}

impl<'a> FheDecrypt<Vec<bool>> for CpuFheBoolSliceMut<'a> {
impl FheDecrypt<Vec<bool>> for CpuFheBoolSliceMut<'_> {
fn decrypt(&self, key: &ClientKey) -> Vec<bool> {
self.as_slice().decrypt(key)
}
Expand Down
14 changes: 7 additions & 7 deletions tfhe/src/high_level_api/array/cpu/integers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ where
}
}

impl<'a, T> BackendDataContainer for &'a [T]
impl<T> BackendDataContainer for &[T]
where
T: IntegerRadixCiphertext,
{
Expand All @@ -389,7 +389,7 @@ where
}
}

impl<'a, T> BackendDataContainer for &'a mut [T]
impl<T> BackendDataContainer for &mut [T]
where
T: IntegerRadixCiphertext,
{
Expand All @@ -411,7 +411,7 @@ where
}
}

impl<'a, T> BackendDataContainerMut for &'a mut [T]
impl<T> BackendDataContainerMut for &mut [T]
where
T: IntegerRadixCiphertext,
{
Expand Down Expand Up @@ -481,7 +481,7 @@ where
}
}

impl<'a, Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheUintSliceMut<'a, Id>
impl<Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheUintSliceMut<'_, Id>
where
Id: FheUintId,
Clear: RecomposableFrom<u64> + UnsignedNumeric,
Expand All @@ -491,7 +491,7 @@ where
}
}

impl<'a, Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheUintSlice<'a, Id>
impl<Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheUintSlice<'_, Id>
where
Id: FheUintId,
Clear: RecomposableFrom<u64> + UnsignedNumeric,
Expand Down Expand Up @@ -534,7 +534,7 @@ where
}
}

impl<'a, Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheIntSliceMut<'a, Id>
impl<Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheIntSliceMut<'_, Id>
where
Id: FheIntId,
Clear: RecomposableSignedInteger,
Expand All @@ -544,7 +544,7 @@ where
}
}

impl<'a, Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheIntSlice<'a, Id>
impl<Clear, Id> FheDecrypt<Vec<Clear>> for CpuFheIntSlice<'_, Id>
where
Id: FheIntId,
Clear: RecomposableSignedInteger,
Expand Down
6 changes: 3 additions & 3 deletions tfhe/src/high_level_api/array/cpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
type Owned = ClearContainer<Vec<T>>;
}

impl<'a, T> BackendDataContainer for ClearContainer<&'a [T]>
impl<T> BackendDataContainer for ClearContainer<&'_ [T]>
where
T: Copy,
{
Expand All @@ -79,7 +79,7 @@ where
}
}

impl<'a, T> BackendDataContainer for ClearContainer<&'a mut [T]>
impl<T> BackendDataContainer for ClearContainer<&mut [T]>
where
T: Copy,
{
Expand All @@ -101,7 +101,7 @@ where
}
}

impl<'a, T> BackendDataContainerMut for ClearContainer<&'a mut [T]>
impl<T> BackendDataContainerMut for ClearContainer<&mut [T]>
where
T: Copy,
{
Expand Down
8 changes: 4 additions & 4 deletions tfhe/src/high_level_api/array/dynamic/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ pub enum InnerBoolSlice<'a> {
Cpu(&'a [BooleanBlock]),
}

impl<'a> InnerBoolSlice<'a> {
impl InnerBoolSlice<'_> {
fn on_cpu(&self) -> Cow<'_, [BooleanBlock]> {
match self {
InnerBoolSlice::Cpu(cpu_slice) => Cow::Borrowed(cpu_slice),
}
}
}

impl<'a> BackendDataContainer for InnerBoolSlice<'a> {
impl BackendDataContainer for InnerBoolSlice<'_> {
type Backend = DynFheBoolArrayBackend;

fn len(&self) -> usize {
Expand Down Expand Up @@ -268,7 +268,7 @@ pub enum InnerBoolSliceMut<'a> {
Cpu(&'a mut [BooleanBlock]),
}

impl<'a> BackendDataContainer for InnerBoolSliceMut<'a> {
impl BackendDataContainer for InnerBoolSliceMut<'_> {
type Backend = DynFheBoolArrayBackend;

fn len(&self) -> usize {
Expand All @@ -295,7 +295,7 @@ impl<'a> BackendDataContainer for InnerBoolSliceMut<'a> {
}
}

impl<'a> BackendDataContainerMut for InnerBoolSliceMut<'a> {
impl BackendDataContainerMut for InnerBoolSliceMut<'_> {
fn as_sub_slice_mut(
&mut self,
range: impl RangeBounds<usize>,
Expand Down
8 changes: 4 additions & 4 deletions tfhe/src/high_level_api/array/dynamic/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ pub enum InnerIntSlice<'a> {
Cpu(&'a [SignedRadixCiphertext]),
}

impl<'a> InnerIntSlice<'a> {
impl InnerIntSlice<'_> {
pub(crate) fn on_cpu(&self) -> Cow<'_, [SignedRadixCiphertext]> {
match self {
Self::Cpu(cpu_slice) => Cow::Borrowed(cpu_slice),
}
}
}

impl<'a> BackendDataContainer for InnerIntSlice<'a> {
impl BackendDataContainer for InnerIntSlice<'_> {
type Backend = DynIntBackend;

fn len(&self) -> usize {
Expand Down Expand Up @@ -111,7 +111,7 @@ pub enum InnerIntSliceMut<'a> {
Cpu(&'a mut [SignedRadixCiphertext]),
}

impl<'a> BackendDataContainer for InnerIntSliceMut<'a> {
impl BackendDataContainer for InnerIntSliceMut<'_> {
type Backend = DynIntBackend;

fn len(&self) -> usize {
Expand All @@ -136,7 +136,7 @@ impl<'a> BackendDataContainer for InnerIntSliceMut<'a> {
}
}

impl<'a> BackendDataContainerMut for InnerIntSliceMut<'a> {
impl BackendDataContainerMut for InnerIntSliceMut<'_> {
fn as_sub_slice_mut(&mut self, range: impl RangeBounds<usize>) -> InnerIntSliceMut<'_> {
match self {
Self::Cpu(cpu_slice) => {
Expand Down
Loading

0 comments on commit e0111f6

Please sign in to comment.