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

Function test_malformed

ciphercore-base/src/mpc/mpc_compiler.rs:1263–1298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1261
1262 #[test]
1263 fn test_malformed() {
1264 || -> Result<()> {
1265 let c = create_context()?;
1266 assert!(compile_to_mpc(
1267 c.clone(),
1268 vec![vec![IOStatus::Public]],
1269 vec![vec![IOStatus::Party(0)]]
1270 )
1271 .is_err());
1272 let g = c.create_graph()?;
1273 g.input(scalar_type(BIT))?.set_as_output()?;
1274 g.finalize()?;
1275 c.set_main_graph(g)?;
1276 c.finalize()?;
1277 assert!(compile_to_mpc(
1278 c.clone(),
1279 vec![vec![IOStatus::Party(3)]],
1280 vec![vec![IOStatus::Party(0)]]
1281 )
1282 .is_err());
1283 assert!(compile_to_mpc(
1284 c.clone(),
1285 vec![vec![IOStatus::Public]],
1286 vec![vec![IOStatus::Party(5)]]
1287 )
1288 .is_err());
1289 assert!(compile_to_mpc(
1290 c.clone(),
1291 vec![vec![IOStatus::Public]],
1292 vec![vec![IOStatus::Shared]]
1293 )
1294 .is_err());
1295 Ok(())
1296 }()
1297 .unwrap();
1298 }
1299
1300 fn reveal_private_value(value: Value, t: Type) -> Result<Value> {
1301 let shares = value.to_vector()?;

Callers

nothing calls this directly

Calls 7

create_contextFunction · 0.50
scalar_typeFunction · 0.50
create_graphMethod · 0.45
set_as_outputMethod · 0.45
inputMethod · 0.45
finalizeMethod · 0.45
set_main_graphMethod · 0.45

Tested by

no test coverage detected