Build the aggregation-guest stdin: the allowed program-vk set (count + 32-byte vks) the agg guest pins each child against, then the proof blobs (count + `Vec `s). Build the agg guest's stdin. `witness = None` selects mode 0 (legacy join fold). `witness = Some(per-child (subject set, assumption set))` selects mode 1 (set discharge): the guest verifies each list's canonical root against the child
( allowed_vks: &[Vec<u8>], proofs: &[Vec<u8>], witness: Option<&[(Vec<u8>, Vec<u8>)]>, )
| 499 | check_list: &[u8], |
| 500 | ) -> ZiskStdin { |
| 501 | let stdin = ZiskStdin::new(); |
| 502 | let mut range_buf = [0u8; 8]; |
| 503 | range_buf[0..4].copy_from_slice(&start.to_le_bytes()); |
| 504 | range_buf[4..8].copy_from_slice(&end.to_le_bytes()); |
| 505 | stdin.write_slice(&range_buf); |
| 506 | stdin.write_slice(env_bytes); |
| 507 | stdin.write_slice(check_list); |
| 508 | stdin |
| 509 | } |
| 510 | |
| 511 | /// Build the aggregation-guest stdin: the allowed program-vk set (count + |
| 512 | /// 32-byte vks) the agg guest pins each child against, then the proof blobs |
| 513 | /// (count + `Vec<u8>`s). |
| 514 | /// Build the agg guest's stdin. `witness = None` selects mode 0 (legacy join |
| 515 | /// fold). `witness = Some(per-child (subject set, assumption set))` selects |
| 516 | /// mode 1 (set discharge): the guest verifies each list's canonical root |
| 517 | /// against the child's committed publics, then discharges assumptions proven |
| 518 | /// by sibling subjects. Witness order must match `proofs` order. |
| 519 | fn agg_stdin( |
| 520 | allowed_vks: &[Vec<u8>], |
| 521 | proofs: &[Vec<u8>], |
| 522 | witness: Option<&[(Vec<u8>, Vec<u8>)]>, |
| 523 | ) -> ZiskStdin { |
| 524 | let stdin = ZiskStdin::new(); |
| 525 | stdin.write(&u32::from(witness.is_some())); // mode |
| 526 | stdin.write(&(allowed_vks.len() as u32)); |
| 527 | for vk in allowed_vks { |
no test coverage detected