Skip to content

Commit

Permalink
chore(strings): support multi bit params in test
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeul-zama committed Nov 20, 2024
1 parent 7dcb5bd commit 11a0fe2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tfhe/src/strings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ pub(crate) use test::TestKeys;

#[cfg(test)]
mod test {
use super::ciphertext::FheString;
use super::client_key::EncU16;
use crate::integer::keycache::KEY_CACHE;
use crate::integer::{ClientKey, ServerKey};
use crate::shortint::parameters::{
PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64, PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
};
use crate::shortint::ClassicPBSParameters;

use super::ciphertext::FheString;
use super::client_key::EncU16;
use crate::shortint::PBSParameters;

#[test]
fn test_all() {
Expand All @@ -51,8 +50,8 @@ mod test {
}

#[allow(clippy::too_many_arguments)]
pub fn test_all_impl(
params: ClassicPBSParameters,
pub fn test_all_impl<P: Into<PBSParameters>>(
params: P,
str: &str,
str_pad: Option<u32>,
pat: &str,
Expand Down Expand Up @@ -131,7 +130,7 @@ mod test {
}

impl TestKeys {
pub fn new(params: ClassicPBSParameters, test_kind: TestKind) -> Self {
pub fn new<P: Into<PBSParameters>>(params: P, test_kind: TestKind) -> Self {
let (ck, sk) = KEY_CACHE.get_from_params(params, crate::integer::IntegerKeyKind::Radix);

Self { ck, sk, test_kind }
Expand Down

0 comments on commit 11a0fe2

Please sign in to comment.