Multiply the column by the mask/null column Assumes that column mask is binary and it has the same number of rows as the column
(column: Node, column_mask: Node, prf_keys: Node)
| 455 | // Multiply the column by the mask/null column |
| 456 | // Assumes that column mask is binary and it has the same number of rows as the column |
| 457 | fn apply_mask(column: Node, column_mask: Node, prf_keys: Node) -> Result<Node> { |
| 458 | let t = get_column_type(&column)?; |
| 459 | let column_shape = t.get_shape(); |
| 460 | // Reshape the mask to multiply row-wise |
| 461 | let mut mask_shape = vec![column_shape[0]]; |
| 462 | if column_shape.len() > 1 { |
| 463 | mask_shape.extend(vec![1; column_shape.len() - 1]); |
| 464 | } |
| 465 | let column_mask = reshape_shared_array(column_mask, array_type(mask_shape, BIT))?; |
| 466 | |
| 467 | if t.get_scalar_type() == BIT { |
| 468 | multiply_mpc(column, column_mask, prf_keys, true) |
| 469 | } else { |
| 470 | mixed_multiply_mpc(column, column_mask, prf_keys) |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | // Share a column if it is public |
| 475 | fn share_column(column: Node, prf_keys: Node) -> Result<Node> { |
no test coverage detected