1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CLEARKEY_MACROS_H_
18 #define CLEARKEY_MACROS_H_
19 
20 #include <android/hardware/drm/1.2/types.h>
21 
22 #include <map>
23 
24 namespace android {
25 namespace hardware {
26 namespace drm {
27 namespace V1_2 {
28 namespace clearkey {
29 
30 using ::android::hardware::drm::V1_0::KeyValue;
31 using ::android::hardware::drm::V1_1::SecurityLevel;
32 using ::android::hardware::hidl_vec;
33 
34 const uint8_t kBlockSize = 16; //AES_BLOCK_SIZE;
35 typedef uint8_t KeyId[kBlockSize];
36 typedef uint8_t Iv[kBlockSize];
37 
38 typedef ::android::hardware::drm::V1_0::SubSample SubSample;
39 typedef std::map<std::vector<uint8_t>, std::vector<uint8_t> > KeyMap;
40 
41 #define CLEARKEY_DISALLOW_COPY_AND_ASSIGN(TypeName) \
42   TypeName(const TypeName&) = delete;      \
43   void operator=(const TypeName&) = delete;
44 
45 #define CLEARKEY_DISALLOW_COPY_AND_ASSIGN_AND_NEW(TypeName) \
46   TypeName() = delete;                     \
47   TypeName(const TypeName&) = delete;      \
48   void operator=(const TypeName&) = delete;
49 
50 } // namespace clearkey
51 } // namespace V1_2
52 } // namespace drm
53 } // namespace hardware
54 } // namespace android
55 
56 #endif // CLEARKEY_MACROS_H_
57