Shaka Packager SDK
Loading...
Searching...
No Matches
aes_pattern_cryptor.h
1// Copyright 2016 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#include <memory>
8
9#include <packager/macros/classes.h>
10#include <packager/media/base/aes_cryptor.h>
11
12namespace shaka {
13namespace media {
14
17 public:
34
50 AesPatternCryptor(uint8_t crypt_byte_block,
51 uint8_t skip_byte_block,
52 PatternEncryptionMode encryption_mode,
53 ConstantIvFlag constant_iv_flag,
54 std::unique_ptr<AesCryptor> cryptor);
55 ~AesPatternCryptor() override;
56
59 bool InitializeWithIv(const std::vector<uint8_t>& key,
60 const std::vector<uint8_t>& iv) override;
62
63 private:
64 bool CryptInternal(const uint8_t* text,
65 size_t text_size,
66 uint8_t* crypt_text,
67 size_t* crypt_text_size) override;
68 void SetIvInternal() override;
69
70 uint8_t crypt_byte_block_;
71 const uint8_t skip_byte_block_;
72 const PatternEncryptionMode encryption_mode_;
73 std::unique_ptr<AesCryptor> cryptor_;
74
75 DISALLOW_COPY_AND_ASSIGN(AesPatternCryptor);
76};
77
78} // namespace media
79} // namespace shaka
const std::vector< uint8_t > & iv() const
Definition aes_cryptor.h:85
Implements pattern-based encryption/decryption.
bool InitializeWithIv(const std::vector< uint8_t > &key, const std::vector< uint8_t > &iv) override
All the methods that are virtual are virtual for mocking.