Keep comments within the comment-guard limits

Function notes become item docs; the per-unit request note is shorter.
This commit is contained in:
Matthew Jackson
2026-10-07 09:59:53 -07:00
parent 15f7829468
commit 61b9c31c86
3 changed files with 28 additions and 29 deletions
+10 -10
View File
@@ -1778,12 +1778,12 @@ impl DiscId {
}
}
// Whether a live scan parses the file at `path` (absolute, any case), so the metadata
// prefetch bulk-loads it. On a BD tree only what the scan reads: the nav and clip files,
// BD-J objects, jar archives and the config files the labels read beside them, META XML,
// and the AACS files the capture reads first. Not /BDMV/BACKUP, BD-J image assets,
// /AACS/DUPLICATE or the other AACS files: a fallback read of one still works, unprefetched.
// Any other tree (DVD, HD DVD) keeps every file.
/// Whether a live scan parses the file at `path` (absolute, any case), so the metadata
/// prefetch bulk-loads it. On a BD tree only what the scan reads: the nav and clip files,
/// BD-J objects, jar archives and the config files the labels read beside them, META XML,
/// and the AACS files the capture reads first. Not /BDMV/BACKUP, BD-J image assets,
/// /AACS/DUPLICATE or the other AACS files: a fallback read of one still works, unprefetched.
/// Any other tree (DVD, HD DVD) keeps every file.
pub(crate) fn scan_parses(bd: bool, path: &str) -> bool {
if !bd {
return true;
@@ -2339,10 +2339,10 @@ impl Disc {
Ok(crate::aacs::mkb::resolve_aacs_version(cert_major, mkb, index).major())
}
// Reads the AACS MKB's real record stream — NOT its ~128 MiB zero padding. Reads a bounded
// prefix (4 MiB holds a real MKB, ~4 MB on a UHD) and walks the record headers: a stream
// the prefix cuts is re-read with room for the record it cuts, never returned short. Also
// avoids the read_file MAX_FILE_BYTES cap.
/// Reads the AACS MKB's real record stream — NOT its ~128 MiB zero padding. Reads a bounded
/// prefix (4 MiB holds a real MKB, ~4 MB on a UHD) and walks the record headers: a stream
/// the prefix cuts is re-read with room for the record it cuts, never returned short. Also
/// avoids the read_file MAX_FILE_BYTES cap.
fn read_mkb_content(reader: &mut dyn SectorSource, udf_fs: &udf::UdfFs) -> Result<Vec<u8>> {
const START_BYTES: usize = 4 * 1024 * 1024;
const MAX_BYTES: usize = 64 * 1024 * 1024;
+4 -4
View File
@@ -5867,10 +5867,10 @@ fn read_capacity_rejects_a_short_transfer_instead_of_reporting_one_sector() {
));
}
// The scan's metadata prefetch on a BD tree loads only what the scan parses: nav, clip,
// BD-J object, jar, META XML, the label config files beside the jars and the primary AACS
// files. Backups, duplicates, image assets and unread AACS files stay on the disc (a
// fallback read of one still works, unprefetched). Other trees keep every file.
/// The scan's metadata prefetch on a BD tree loads only what the scan parses: nav, clip,
/// BD-J object, jar, META XML, the label config files beside the jars and the primary AACS
/// files. Backups, duplicates, image assets and unread AACS files stay on the disc (a
/// fallback read of one still works, unprefetched). Other trees keep every file.
#[test]
fn scan_prefetches_only_the_files_a_bd_scan_parses() {
for p in [
+14 -15
View File
@@ -551,12 +551,12 @@ fn scope_layout(ev: &KeyEvidence) -> (Option<&super::fmts::Layout>, Vec<(u32, u3
(layout, clip)
}
// KS-14 [BD] §3.9.3: one declared CPS unit is one Unit Key for every stream file, so the disc
// is trusted as declared: the main title's samples ask the sources once, and the key that
// opens them keys every piece in scope. No per-piece probing (32 reads a piece: minutes of
// seeks on a many-clip disc). FMTS segment units are never samples; the segments are keyed
// by their forensic set. `None` (no ciphertext found, or no key opens it) falls back to the
// probed path, which decides clear content and refusals.
/// KS-14 [BD] §3.9.3: one declared CPS unit is one Unit Key for every stream file, so the disc
/// is trusted as declared: the main title's samples ask the sources once, and the key that
/// opens them keys every piece in scope. No per-piece probing (32 reads a piece: minutes of
/// seeks on a many-clip disc). FMTS segment units are never samples; the segments are keyed
/// by their forensic set. `None` (no ciphertext found, or no key opens it) falls back to the
/// probed path, which decides clear content and refusals.
fn resolve_one_unit(
ev: &KeyEvidence,
sampler: &mut Sampler,
@@ -643,12 +643,12 @@ fn resolve_one_unit(
Ok(Some(inner))
}
// Several declared CPS units: each stream file sits in exactly one (KS-10), so one encrypted
// unit per piece (the first its probe grid finds, FMTS segment units skipped) names its key.
// The main title's samples ask first; pieces no held key opens then ask with their own units,
// at most `n_decl` requests. Every piece read clear and so do the forensic segments in scope:
// content in the clear, no source asked. `None` (a piece unreadable, or one no key opens)
// falls back to the probed path.
/// Several declared CPS units: each stream file sits in exactly one (KS-10), so one encrypted
/// unit per piece (the first its probe grid finds, FMTS segment units skipped) names its key.
/// The main title's samples ask first; pieces no held key opens then ask with their own units,
/// at most `n_decl` requests. Every piece read clear and so do the forensic segments in scope:
/// content in the clear, no source asked. `None` (a piece unreadable, or one no key opens)
/// falls back to the probed path.
fn resolve_per_unit(
ev: &KeyEvidence,
sampler: &mut Sampler,
@@ -715,9 +715,8 @@ fn resolve_per_unit(
}
}
}
// Then, largest piece first, each still-unopened unit asks the sample-dependent sources
// with enough of its own ciphertext (topped up from pieces of the same title, KS-10), at
// most `n_decl` requests. One answer may open many pieces. A source that answers with no
// Largest piece first, each unopened unit asks with its own ciphertext (topped up from
// its title's pieces, KS-10), at most `n_decl` requests. A source that answers with no
// key has none for this disc: it is not asked again.
let mut budget = n_decl;
let mut thin: Vec<usize> = Vec::new();