9 #ifndef MEDIA_BASE_AES_ENCRYPTOR_H_
10 #define MEDIA_BASE_AES_ENCRYPTOR_H_
15 #include "packager/base/macros.h"
16 #include "packager/media/base/aes_cryptor.h"
35 const std::vector<uint8_t>&
iv)
override;
47 uint32_t block_offset()
const {
return block_offset_; }
50 bool CryptInternal(
const uint8_t* plaintext,
51 size_t plaintext_size,
53 size_t* ciphertext_size)
override;
54 void SetIvInternal()
override;
57 uint32_t block_offset_;
59 std::vector<uint8_t> counter_;
61 std::vector<uint8_t> encrypted_counter_;
66 enum CbcPaddingScheme {
93 ConstantIvFlag constant_iv_flag);
98 bool CryptInternal(
const uint8_t* plaintext,
99 size_t plaintext_size,
101 size_t* ciphertext_size)
override;
102 void SetIvInternal()
override;
103 size_t NumPaddingBytes(
size_t size)
const override;
105 const CbcPaddingScheme padding_scheme_;
107 std::vector<uint8_t> internal_iv_;
115 #endif // MEDIA_BASE_AES_ENCRYPTOR_H_