aacs: extract crypto.rs (shared AES primitives + constants)
Relocate the shared low-level primitives into a single crypto module: aes_ecb_encrypt/decrypt, aes_cbc_decrypt, aes_g (from content/variant) and aesg3 + AESG3_SEED (from keys), plus AACS_IV. Fixes the scatter where AES-G lived in the 2.1 file and AES-G3 in keys. Relocation only — no rename, no logic change (logic-hash identical to baseline; 277 items; 2210 tests green).
This commit is contained in:
+2
-2
@@ -1129,13 +1129,13 @@ mod tests {
|
||||
// the per-unit key so the recovered plaintext header matches.
|
||||
unit[0] |= 0xC0;
|
||||
let header: [u8; 16] = unit[..16].try_into().unwrap();
|
||||
let derived = crate::aacs::content::aes_ecb_encrypt(unit_key, &header);
|
||||
let derived = crate::aacs::crypto::aes_ecb_encrypt(unit_key, &header);
|
||||
let mut k = [0u8; 16];
|
||||
for i in 0..16 {
|
||||
k[i] = derived[i] ^ header[i];
|
||||
}
|
||||
let cipher = Aes128::new(GenericArray::from_slice(&k));
|
||||
let mut prev = crate::aacs::content::AACS_IV;
|
||||
let mut prev = crate::aacs::crypto::AACS_IV;
|
||||
let num_blocks = (aacs::ALIGNED_UNIT_LEN - 16) / 16;
|
||||
for i in 0..num_blocks {
|
||||
let off = 16 + i * 16;
|
||||
|
||||
Reference in New Issue
Block a user