9 #ifndef MEDIA_BASE_AES_ENCRYPTOR_H_
10 #define MEDIA_BASE_AES_ENCRYPTOR_H_
15 #include "packager/base/macros.h"
16 #include "packager/base/memory/scoped_ptr.h"
17 #include "packager/media/base/aes_cryptor.h"
19 namespace edash_packager {
30 const std::vector<uint8_t>&
iv)
override;
50 bool SetIv(
const std::vector<uint8_t>&
iv)
override;
53 uint32_t block_offset()
const {
return block_offset_; }
56 bool CryptInternal(
const uint8_t* plaintext,
57 size_t plaintext_size,
59 size_t* ciphertext_size)
override;
62 uint32_t block_offset_;
64 std::vector<uint8_t> counter_;
66 std::vector<uint8_t> encrypted_counter_;
68 bool counter_overflow_;
73 enum CbcPaddingScheme {
83 const bool kChainAcrossCalls =
true;
93 AesCbcEncryptor(CbcPaddingScheme padding_scheme,
bool chain_across_calls);
100 bool SetIv(
const std::vector<uint8_t>&
iv)
override;
104 bool CryptInternal(
const uint8_t* plaintext,
105 size_t plaintext_size,
107 size_t* ciphertext_size)
override;
108 size_t NumPaddingBytes(
size_t size)
const override;
110 const CbcPaddingScheme padding_scheme_;
111 const bool chain_across_calls_;
119 #endif // MEDIA_BASE_AES_ENCRYPTOR_H_