(
context: Context,
type1: Type,
type2: Type,
key_header: String,
is_input1_private: bool,
is_input2_private: bool,
)
| 272 | } |
| 273 | |
| 274 | fn get_equality_graph( |
| 275 | context: Context, |
| 276 | type1: Type, |
| 277 | type2: Type, |
| 278 | key_header: String, |
| 279 | is_input1_private: bool, |
| 280 | is_input2_private: bool, |
| 281 | ) -> Result<Graph> { |
| 282 | let eq_context = simple_context(|g| { |
| 283 | let i0 = g.input(type1)?; |
| 284 | let i1 = g.input(type2)?; |
| 285 | |
| 286 | let key_columns_0 = i0.named_tuple_get(key_header.clone())?; |
| 287 | let key_columns_1 = i1.named_tuple_get(key_header)?; |
| 288 | |
| 289 | let eq_bits = g.custom_op( |
| 290 | CustomOperation::new(Equal {}), |
| 291 | vec![key_columns_0, key_columns_1], |
| 292 | )?; |
| 293 | |
| 294 | let null_0 = i0.named_tuple_get(NULL_HEADER.to_owned())?; |
| 295 | let null_1 = i1.named_tuple_get(NULL_HEADER.to_owned())?; |
| 296 | |
| 297 | null_0.multiply(null_1)?.multiply(eq_bits) |
| 298 | })?; |
| 299 | |
| 300 | convert_main_graph_to_mpc( |
| 301 | eq_context, |
| 302 | context, |
| 303 | vec![is_input1_private, is_input2_private], |
| 304 | ) |
| 305 | } |
| 306 | |
| 307 | // Extracts the null column and the column masks of key headers, and computes their product. |
| 308 | // The Boolean output indicates whether PRF keys are needed. |
no test coverage detected