2019-04-01 05:37:14 -07:00
|
|
|
use serde::{Deserialize, Serialize};
|
2018-11-19 05:51:32 -08:00
|
|
|
|
2018-11-18 01:18:14 -08:00
|
|
|
use super::{EncryptionSchedule, SubsetHandlingStrategy};
|
|
|
|
|
|
|
|
/// Parameters controlling Honey Badger's behavior and performance.
|
2018-11-19 05:51:32 -08:00
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
2018-11-18 01:18:14 -08:00
|
|
|
pub struct Params {
|
|
|
|
/// The maximum number of future epochs for which we handle messages simultaneously.
|
|
|
|
pub max_future_epochs: u64,
|
|
|
|
/// Strategy used to handle the output of the `Subset` algorithm.
|
|
|
|
pub subset_handling_strategy: SubsetHandlingStrategy,
|
|
|
|
/// Schedule for adding threshold encryption to some percentage of rounds
|
|
|
|
pub encryption_schedule: EncryptionSchedule,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for Params {
|
|
|
|
fn default() -> Params {
|
|
|
|
Params {
|
|
|
|
max_future_epochs: 3,
|
|
|
|
subset_handling_strategy: SubsetHandlingStrategy::Incremental,
|
|
|
|
encryption_schedule: EncryptionSchedule::Always,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|