use rug::Integer;
use crate::key::PrivateKey;
#[derive(Debug, Clone)]
pub struct Solution {
pub attack: &'static str,
pub pk: Option<PrivateKey>,
pub m: Option<Integer>,
pub ms: Vec<Integer>,
}
impl Solution {
pub fn new(attack: &'static str, pk: PrivateKey, m: Integer) -> Self {
Self {
attack,
pk: Some(pk),
m: Some(m),
ms: vec![],
}
}
pub fn new_pk(attack: &'static str, pk: PrivateKey) -> Self {
Self {
attack,
pk: Some(pk),
m: None,
ms: vec![],
}
}
pub fn new_m(attack: &'static str, m: Integer) -> Self {
Self {
attack,
pk: None,
m: Some(m),
ms: vec![],
}
}
pub fn new_ms(attack: &'static str, ms: Vec<Integer>) -> Self {
Self {
attack,
pk: None,
m: None,
ms,
}
}
}