mod factorize;
mod primes_mapping_table;
pub use factorize::*;
pub use primes_mapping_table::*;
use rust_ev_crypto_primitives::elgamal::EncryptionParameters;
use thiserror::Error;
#[derive(Error, Debug)]
#[error(transparent)]
pub struct ElectoralModelError(#[from] ElectoralModelErrorRepr);
#[derive(Error, Debug)]
enum ElectoralModelErrorRepr {
#[error("Error output in get_blank_correctness_information: {0}")]
GetBlankCorrectnessInformationOutput(String),
#[error("Error output in get_encoded_voting_options: {0}")]
GetEncodedVotingOptionsInput(String),
#[error("Error output in get_actual_voting_options: {0}")]
GetActualVotingOptionsInput(String),
#[error("Error output in get_correctness_information: {0}")]
GetCorrectnessInformationInput(String),
#[error("Error output in factorize: {0}")]
FactorizeInput(String),
}
pub struct EPPTableAsContext<'a, 'b> {
p_table: &'a PTable,
encryption_parameters: &'b EncryptionParameters,
}
impl<'a, 'b> EPPTableAsContext<'a, 'b> {
pub fn new(encryption_parameters: &'b EncryptionParameters, p_table: &'a PTable) -> Self {
Self {
p_table,
encryption_parameters,
}
}
pub fn p_table(&self) -> &'a PTable {
self.p_table
}
pub fn encryption_parameters(&self) -> &'b EncryptionParameters {
self.encryption_parameters
}
}