pub mod atomic_pattern;
pub mod backward_compatibility;
pub mod ciphertext;
pub mod client_key;
pub(crate) mod encoding;
pub mod engine;
pub mod key_switching_key;
#[cfg(any(test, doctest, feature = "internal-keycache"))]
pub mod keycache;
pub mod list_compression;
pub mod noise_squashing;
pub mod oprf;
pub mod parameters;
pub mod prelude;
pub mod public_key;
pub mod server_key;
#[cfg(feature = "experimental")]
pub mod wopbs;
#[cfg(all(
not(feature = "experimental"),
any(test, doctest, feature = "internal-keycache")
))]
pub(crate) mod wopbs;
pub use ciphertext::{Ciphertext, CompressedCiphertext, PBSOrder};
pub use client_key::ClientKey;
pub(crate) use encoding::{PaddingBit, ShortintEncoding};
pub use key_switching_key::{CompressedKeySwitchingKey, KeySwitchingKey, KeySwitchingKeyView};
pub use oprf::OprfSeed;
pub use parameters::{
AtomicPatternKind, AtomicPatternParameters, CarryModulus, CiphertextModulus,
ClassicPBSParameters, EncryptionKeyChoice, MaxNoiseLevel, MessageModulus,
MultiBitPBSParameters, PBSParameters, ShortintParameterSet, WopbsParameters,
};
pub use public_key::{
CompactPrivateKey, CompactPublicKey, CompressedCompactPublicKey, CompressedPublicKey, PublicKey,
};
pub use server_key::{CheckError, CompressedServerKey, ServerKey};
pub fn gen_keys<P>(parameters_set: P) -> (ClientKey, ServerKey)
where
P: TryInto<ShortintParameterSet>,
<P as TryInto<ShortintParameterSet>>::Error: std::fmt::Debug,
{
let cks = ClientKey::new(parameters_set);
let sks = ServerKey::new(&cks);
(cks, sks)
}