MCPcopy Create free account
hub / github.com/docknetwork/crypto / new

Method new

oblivious_transfer/src/configs.rs:22–33  ·  view source on GitHub ↗
(num_ot: u16, num_messages: u16)

Source from the content-addressed store, hash-verified

20
21impl 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> {

Callers

nothing calls this directly

Calls 1

is_multiple_of_8Function · 0.85

Tested by

no test coverage detected