-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmtvhd-xor.c
59 lines (55 loc) · 2.2 KB
/
mtvhd-xor.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* DVB USB framework compliant Linux driver for the SKNET MonsterTV HD ISDB-T
* receiver. (Local decryption: XOR)
*
* Copyright (c) 2009 Gombei Nanashi
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mtvhd.h"
/* Fixed xor-key for ASIE5606 */
static uint8_t mtvhd_xor_key[] = {
0x6D, 0x4E, 0xF0, 0x1E, 0x59, 0x8B, 0xB2, 0xF0,
0x31, 0xF9, 0xD0, 0x85, 0xDD, 0x84, 0x4A, 0x6C,
0x15, 0x1C, 0x1C, 0x0A, 0x5B, 0x61, 0x6F, 0x1A,
0xAD, 0x60, 0x46, 0xF2, 0xD5, 0x03, 0x91, 0xC7,
0xB7, 0xDE, 0x68, 0x9A, 0x07, 0x47, 0x62, 0x5E,
0x39, 0xD6, 0x7E, 0x45, 0x10, 0x9D, 0x1A, 0xC4,
0x4C, 0x7F, 0xB7, 0x03, 0xCC, 0xAD, 0x72, 0x6C,
0xE9, 0x1B, 0x85, 0xA8, 0xEE, 0x4B, 0xA9, 0x3A,
0xFF, 0xF1, 0x3B, 0x16, 0xE0, 0x59, 0x4C, 0x3A,
0xD5, 0x4A, 0x14, 0x95, 0x0A, 0xD4, 0x25, 0x23,
0xF6, 0x2F, 0xE3, 0x57, 0x35, 0xCE, 0x52, 0x84,
0x11, 0xA3, 0xCB, 0x34, 0xA7, 0x15, 0x60, 0xE1,
0x98, 0x71, 0xF4, 0x1F, 0xF7, 0xBD, 0x22, 0x4B,
0x61, 0x8A, 0xD6, 0xAF, 0x24, 0x27, 0xC3, 0xA7,
0x07, 0x9B, 0xA5, 0x57, 0x83, 0x80, 0x58, 0x07,
0x1D, 0xDE, 0x0A, 0xD8, 0xB9, 0x0A, 0xBE, 0xAC,
0xA9, 0x76, 0x00, 0x1C, 0x23, 0x9F, 0x82, 0x79,
0x41, 0x56, 0xC8, 0x83, 0xC3, 0x38, 0x37, 0x4B,
0x5A, 0xED, 0xC9, 0xD5, 0xF2, 0x87, 0x02, 0xC3,
0x79, 0xA0, 0x61, 0xD9, 0x63, 0x50, 0xCA, 0x72,
0xC2, 0x51, 0x40, 0x98, 0xD9, 0x8B, 0xED, 0xA9,
0xA1, 0x4C, 0xA5, 0xE7, 0xAF, 0xF2, 0x08, 0x4D,
0x82, 0xF8, 0xD5, 0x02, 0x61, 0xD8, 0xC2, 0xE1
};
/* Decrypt TS packet with fixed XOR pattern */
void mtvhd_xor_decrypt(void *crypto_ctx, u8 *data)
{
int i;
/* Skip first 4 byte header */
for (i = 4; i < TS_SIZE; i++) {
data[i] ^= mtvhd_xor_key[i - 4];
}
return;
}