xbmc
stream_crypto.h
1 /*
2  * Copyright (C) 2017-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #ifndef C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H
10 #define C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H
11 
12 #include <stdint.h>
13 #include <string.h>
14 
15 #define STREAMCRYPTO_VERSION_LEVEL 2
16 
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif /* __cplusplus */
21 
22  //============================================================================
34  {
37 
40 
43 
46 
49  };
51  //----------------------------------------------------------------------------
52 
53  //============================================================================
64  {
67 
71  };
73  //----------------------------------------------------------------------------
74 
75  //============================================================================
83  {
85  uint16_t numSubSamples;
86 
88  uint16_t flags;
89 
92  uint16_t* clearBytes;
93 
96  uint32_t* cipherBytes;
97 
99  uint8_t iv[16];
100 
102  uint8_t kid[16];
103 
105  uint16_t mode;
106 
108  uint8_t cryptBlocks;
109 
111  uint8_t skipBlocks;
112  };
114  //----------------------------------------------------------------------------
115 
116  // Data to manage stream cryptography
118  {
119  // keysystem for encrypted media, STREAM_CRYPTO_KEY_SYSTEM_NONE for unencrypted
120  // media.
121  //
122  // See STREAM_CRYPTO_KEY_SYSTEM for available options.
123  enum STREAM_CRYPTO_KEY_SYSTEM keySystem;
124 
125  // Flags to use special conditions, see STREAM_CRYPTO_FLAGS for available flags.
126  uint8_t flags;
127 
128  // The crypto session key id.
129  char sessionId[256];
130  };
132  //----------------------------------------------------------------------------
133 
134 #ifdef __cplusplus
135 } /* extern "C" */
136 #endif /* __cplusplus */
137 
138 #endif /* !C_API_ADDONINSTANCE_INPUTSTREAM_STREAMCRYPTO_H */
uint8_t cryptBlocks
Crypt blocks - number of blocks to encrypt in sample encryption pattern.
Definition: stream_crypto.h:108
uint16_t * clearBytes
numSubSamples uint16_t&#39;s which define the size of clear size of a subsample.
Definition: stream_crypto.h:92
uint16_t mode
Encryption mode.
Definition: stream_crypto.h:105
uint8_t kid[16]
Key id.
Definition: stream_crypto.h:102
2 - To use Playready for processing
Definition: stream_crypto.h:42
uint16_t flags
Flags for later use.
Definition: stream_crypto.h:88
uint32_t * cipherBytes
numSubSamples uint32_t&#39;s which define the size of cipher size of a subsample.
Definition: stream_crypto.h:96
Definition: stream_crypto.h:82
1 - To use Widevine for processing
Definition: stream_crypto.h:39
Definition: stream_crypto.h:117
0 - If no path is to be used, this is the default
Definition: stream_crypto.h:36
STREAM_CRYPTO_KEY_SYSTEM
Definition: stream_crypto.h:33
uint8_t skipBlocks
Skip blocks - number of blocks to skip in sample encryption pattern.
Definition: stream_crypto.h:111
4 - The maximum value to use in a list.
Definition: stream_crypto.h:48
uint8_t iv[16]
Initialization vector.
Definition: stream_crypto.h:99
0000 0000 - Empty to set if nothing is used.
Definition: stream_crypto.h:66
STREAM_CRYPTO_FLAGS
Definition: stream_crypto.h:63
uint16_t numSubSamples
Number of subsamples.
Definition: stream_crypto.h:85
0000 0001 - Is set in flags if decoding has to be done in trusted execution environment (TEE)...
Definition: stream_crypto.h:70
3 - To use Wiseplay for processing
Definition: stream_crypto.h:45