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

Function prepare_input

ciphercore-base/src/mpc/mpc_compiler.rs:1485–1503  ·  view source on GitHub ↗
(
        input_types: Vec<Type>,
        is_input_shared: Vec<bool>,
    )

Source from the content-addressed store, hash-verified

1483 }
1484
1485 fn prepare_input(
1486 input_types: Vec<Type>,
1487 is_input_shared: Vec<bool>,
1488 ) -> Result<(Vec<Value>, Vec<Value>)> {
1489 let seed: [u8; 16] = [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
1490 let mut prng = PRNG::new(Some(seed))?;
1491 let mut plain_inputs = vec![];
1492 let mut mpc_inputs = vec![];
1493 for i in 0..input_types.len() {
1494 let random_value = prng.get_random_value(input_types[i].clone())?;
1495 plain_inputs.push(random_value.clone());
1496 mpc_inputs.push(prepare_value(
1497 random_value,
1498 input_types[i].clone(),
1499 is_input_shared[i].clone(),
1500 )?);
1501 }
1502 Ok((plain_inputs, mpc_inputs))
1503 }
1504
1505 fn check_output(
1506 plain_graph: Graph,

Callers 2

helper_one_inputFunction · 0.70
helper_create_opsFunction · 0.70

Calls 4

prepare_valueFunction · 0.85
get_random_valueMethod · 0.80
cloneMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected