miniproto.media.cdn.decrypt_cdn_chunk
miniproto.media.cdn.decrypt_cdn_chunk
Section titled “miniproto.media.cdn.decrypt_cdn_chunk”decrypt_cdn_chunk(data: bytes, *, key: bytes, iv: bytes, offset: int = 0) -> bytesDecrypt a CDN ciphertext range with the counter aligned to its file offset.
Parameters:
- data (
bytes) – Ciphertext bytes for a contiguous CDN response; immutable buffers are not zeroized. - key (
bytes) – Exactly 32 bytes of AES key material; immutable buffers are not zeroized. - iv (
bytes) – Exactly 16 bytes forming the initial CTR counter; immutable buffers are not zeroized. - offset (
int) – Non-negative file offset ofdata; defaults to0.
Returns:
bytes– Plaintext bytes of the same length asdata.
Raises:
ValueError–key,iv, oroffsetviolates CDN cryptographic constraints.