(num_ot: u16, num_messages: u16)
| 20 | |
| 21 | impl OTConfig { |
| 22 | pub fn new(num_ot: u16, num_messages: u16) -> Result<Self, OTError> { |
| 23 | if num_ot == 0 { |
| 24 | return Err(OTError::NeedNonZeroNumberOfOTs); |
| 25 | } |
| 26 | if num_messages < 2 { |
| 27 | return Err(OTError::OTShouldHaveAtLeast2Messages(num_messages)); |
| 28 | } |
| 29 | Ok(Self { |
| 30 | num_ot, |
| 31 | num_messages, |
| 32 | }) |
| 33 | } |
| 34 | |
| 35 | /// For 1-of-2 OT |
| 36 | pub fn new_2_message(num_ot: u16) -> Result<Self, OTError> { |
nothing calls this directly
no test coverage detected