Expand description
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.
Structs§
- Content
Key - A content key plus its 16-byte Key ID (
KID). - Encryptor
- An AES-128 sample encryptor bound to one content key.
- Subsample
- A contiguous run within a sample:
clearplaintext bytes followed byprotectedbytes to encrypt.
Enums§
- Scheme
- A CENC protection scheme (the
schmscheme_type).