Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
//! | NACP | How a title is presented and what it may do | ✓ | ✓ | ✓ |
//! | NPDM | The permissions a program is granted | ✓ | ✓ | ✓ |
//! | RomFS | The read-only filesystem a title ships | ✓ | ✓ | ✓ |
//! | PFS0 | The flat archive an NSP is built from | ✓ | | ✓ |
//! | PFS0 | The flat archive an NSP is built from | ✓ | ✓ | ✓ |
//! | MOD0 | The runtime header embedded in an executable | ✓ | ✓ | |
//! | NCA | The container a title's contents ship in | ✓ | | ✓ |
//! | NCA | The container a title's contents ship in | ✓ | ✓ | ✓ |
//! | CNMT | The content meta naming every NCA of a title | ✓ | | ✓ |
//!
//! # What this crate does not do
Expand All @@ -63,7 +63,8 @@
//!
//! NCA is where that line is most visible, because an NCA on disk is encrypted throughout.
//! [`write::NcaBuilder`] produces the plaintext container and every hash covering it, then names
//! what is still owed; the caller supplies the keyset and the ciphers. The split is deliberate: a
//! what is still owed; the caller supplies the keyset and the ciphers. Reading runs the same way
//! in reverse: [`read::nca::Nca`] takes a buffer the caller has already decrypted. The split is deliberate: a
//! keyset is secret material with its own provenance and handling rules, and a crate whose contract
//! is bytes in, bytes out, no I/O is the wrong place to acquire one. Hashing stays here because a
//! hash is part of the layout — it is what makes the recorded offsets checkable — while encryption
Expand Down
12 changes: 9 additions & 3 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@
//! at all: those readers check lengths and layout, so success means the buffer is shaped like the
//! format, never that it is one.
//!
//! Nothing here decompresses or verifies a hash. An NSO segment comes back as stored, and checking
//! it against the header's digest is the caller's, because a borrowing reader has nowhere to put
//! the expanded bytes.
//! Nothing here decompresses, decrypts, or verifies a hash. An NSO segment comes back as stored,
//! and checking it against the header's digest is the caller's, because a borrowing reader has
//! nowhere to put the expanded bytes. The same line puts NCA decryption outside: [`nca::Nca`] takes
//! a buffer the caller has already decrypted, and an image still in ciphertext fails its magic
//! check rather than parsing into nonsense.

#[cfg(feature = "mod0")]
pub mod mod0;
#[cfg(feature = "nacp")]
pub mod nacp;
#[cfg(feature = "nca")]
pub mod nca;
#[cfg(feature = "npdm")]
pub mod npdm;
#[cfg(feature = "nro")]
pub mod nro;
#[cfg(feature = "nso")]
pub mod nso;
#[cfg(feature = "pfs0")]
pub mod pfs0;
#[cfg(feature = "romfs")]
pub mod romfs;
Loading