feat(integer): construct proven ct list conformance from another source

- allows to use ZK parameters directly
This commit is contained in:
Arthur Meyre
2024-10-08 12:34:23 +02:00
parent 55f265bd3d
commit a307e1eaa1

View File

@@ -1008,6 +1008,16 @@ impl IntegerProvenCompactCiphertextListConformanceParams {
pub fn from_crs_and_parameters(
value: CompactPublicKeyEncryptionParameters,
crs_params: &CompactPkeCrs,
) -> Self {
Self::from_public_key_encryption_parameters_and_crs_parameters(
value,
crs_params.public_params(),
)
}
pub fn from_public_key_encryption_parameters_and_crs_parameters(
value: CompactPublicKeyEncryptionParameters,
crs_params: &crate::zk::CompactPkePublicParams,
) -> Self {
Self {
encryption_lwe_dimension: value.encryption_lwe_dimension,
@@ -1015,7 +1025,7 @@ impl IntegerProvenCompactCiphertextListConformanceParams {
carry_modulus: value.carry_modulus,
ciphertext_modulus: value.ciphertext_modulus,
expansion_kind: value.expansion_kind,
max_elements_per_compact_list: crs_params.public_params().k,
max_elements_per_compact_list: crs_params.k,
}
}
}