From 12b52a7e7ac9a249fbe4117d767182f82c6eab8f Mon Sep 17 00:00:00 2001 From: Nicolas Sarlin Date: Thu, 7 Nov 2024 11:59:00 +0100 Subject: [PATCH] fix(zk): fix build with feature zk-pok without shortint --- Makefile | 6 ++++++ tfhe/src/zk.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 80578d1446..46cd7784ea 100644 --- a/Makefile +++ b/Makefile @@ -308,6 +308,9 @@ clippy_core: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ --features=$(TARGET_ARCH_FEATURE),experimental,nightly-avx512 \ -p $(TFHE_SPEC) -- --no-deps -D warnings + RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ + --features=$(TARGET_ARCH_FEATURE),zk-pok \ + -p $(TFHE_SPEC) -- --no-deps -D warnings .PHONY: clippy_boolean # Run clippy lints enabling the boolean features clippy_boolean: install_rs_check_toolchain @@ -323,6 +326,9 @@ clippy_shortint: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ --features=$(TARGET_ARCH_FEATURE),shortint,experimental \ -p $(TFHE_SPEC) -- --no-deps -D warnings + RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ + --features=$(TARGET_ARCH_FEATURE),zk-pok,shortint \ + -p $(TFHE_SPEC) -- --no-deps -D warnings .PHONY: clippy_integer # Run clippy lints enabling the integer features clippy_integer: install_rs_check_toolchain diff --git a/tfhe/src/zk.rs b/tfhe/src/zk.rs index e44b52ebd4..679c16a01f 100644 --- a/tfhe/src/zk.rs +++ b/tfhe/src/zk.rs @@ -2,6 +2,7 @@ use crate::conformance::ParameterSetConformant; use crate::core_crypto::commons::math::random::BoundedDistribution; use crate::core_crypto::prelude::*; use crate::named::Named; +#[cfg(feature = "shortint")] use crate::shortint::parameters::CompactPublicKeyEncryptionParameters; use rand_core::RngCore; use std::cmp::Ordering; @@ -44,6 +45,7 @@ pub struct CompactPkePublicParamsConformanceParams { } impl CompactPkePublicParamsConformanceParams { + #[cfg(feature = "shortint")] pub fn new>( value: P, max_num_message: usize,