MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / share_node

Function share_node

ciphercore-base/src/mpc/mpc_compiler.rs:745–757  ·  view source on GitHub ↗
(g: Graph, node: Node, prf_keys: Node, status: IOStatus)

Source from the content-addressed store, hash-verified

743}
744
745fn share_node(g: Graph, node: Node, prf_keys: Node, status: IOStatus) -> Result<Node> {
746 let mut outputs = vec![];
747 let t = node.get_type()?;
748 let node_shares = get_node_shares(g.clone(), prf_keys, t, Some((node, status)))?;
749 // networking
750 for (i, node_share) in node_shares.iter().enumerate().take(PARTIES) {
751 let network_node = g.nop((*node_share).clone())?;
752 let im1 = ((i + PARTIES - 1) % PARTIES) as u64;
753 network_node.add_annotation(NodeAnnotation::Send(i as u64, im1))?;
754 outputs.push(network_node);
755 }
756 g.create_tuple(outputs)
757}
758
759fn share_input(g: Graph, node: Node, t: Type, prf_keys: Node, status: IOStatus) -> Result<Node> {
760 let plain_input = g.input(t)?;

Callers 2

share_inputFunction · 0.85
compile_to_mpc_contextFunction · 0.85

Calls 7

get_node_sharesFunction · 0.85
cloneMethod · 0.80
add_annotationMethod · 0.80
get_typeMethod · 0.45
nopMethod · 0.45
pushMethod · 0.45
create_tupleMethod · 0.45

Tested by

no test coverage detected