sheathe-crypto 0.1.0

Common Encryption (CENC: cenc/cbcs) scaffolding for the sheathe packager
Documentation

Common Encryption (ISO/IEC 23001-7) for sheathe.

Mirrors Shaka Packager's media/crypto: the CENC protection schemes plus a sample [Encryptor] that applies them. Two schemes are implemented on top of a pure-Rust AES-128 block cipher:

  • cenc — AES-128 CTR. The keystream runs continuously across a sample's protected byte ranges (clear ranges do not advance the counter).
  • cbcs — AES-128 CBC with pattern encryption (crypt 1 block, skip 9), CBC chaining reset to the constant IV at the start of each subsample; a trailing partial block (< 16 bytes) is left in the clear.

Encryption operates on a list of [Subsample] (clear/protected byte runs), so the caller (the MP4 muxer) decides the NAL-aware clear/protected split; this crate stays format-agnostic.