9 #ifndef PACKAGER_MEDIA_BASE_AES_ENCRYPTOR_H_
10 #define PACKAGER_MEDIA_BASE_AES_ENCRYPTOR_H_
15 #include <packager/macros/classes.h>
16 #include <packager/media/base/aes_cryptor.h>
27 uint32_t block_offset()
const {
return block_offset_; }
32 const std::vector<uint8_t>&
iv)
override;
35 bool CryptInternal(
const uint8_t* plaintext,
36 size_t plaintext_size,
38 size_t* ciphertext_size)
override;
39 void SetIvInternal()
override;
42 uint32_t block_offset_;
44 std::vector<uint8_t> counter_;
46 std::vector<uint8_t> encrypted_counter_;
51 enum CbcPaddingScheme {
78 ConstantIvFlag constant_iv_flag);
85 const std::vector<uint8_t>&
iv)
override;
87 size_t RequiredOutputSize(
size_t plaintext_size)
override;
90 bool CryptInternal(
const uint8_t* plaintext,
91 size_t plaintext_size,
93 size_t* ciphertext_size)
override;
94 void SetIvInternal()
override;
95 size_t NumPaddingBytes(
size_t size)
const override;
97 void CbcEncryptBlocks(
const uint8_t* plaintext,
98 size_t plaintext_size,
102 const CbcPaddingScheme padding_scheme_;
104 std::vector<uint8_t> internal_iv_;
All the methods that are virtual are virtual for mocking.