]> git.sesse.net Git - vlc/blob - plugins/dvd/dvd_css.h
41afb88dfd6cf78f414773064ffc42dd7fdb7d30
[vlc] / plugins / dvd / dvd_css.h
1 /*****************************************************************************
2  * dvd_css.h: Structures for DVD authentification and unscrambling
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  * $Id: dvd_css.h,v 1.5 2001/03/03 07:07:01 stef Exp $
6  *
7  * Author: Stéphane Borel <stef@via.ecp.fr>
8  *
9  * based on:
10  *  - css-auth by Derek Fawcus <derek@spider.com>
11  *  - DVD CSS ioctls example program by Andrew T. Veliath <andrewtv@usa.net>
12  *  - DeCSSPlus by Ethan Hawke
13  *  - The Divide and conquer attack by Frank A. Stevenson <frank@funcom.com>
14  *
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
28  *****************************************************************************/
29 #define KEY_SIZE 5
30
31 typedef u8 dvd_key_t[KEY_SIZE];
32
33 typedef struct disc_s
34 {
35     u8              pi_challenge[2*KEY_SIZE];
36     dvd_key_t       pi_key1;
37     dvd_key_t       pi_key2;
38     dvd_key_t       pi_key_check;
39     u8              i_varient;
40 } disc_t;
41
42 typedef struct title_key_s
43 {
44     int             i_occ;
45     dvd_key_t       pi_key;
46 } title_key_t;
47
48 typedef struct css_s
49 {
50     int             i_fd;
51     int             i_agid;
52     disc_t          disc;
53     u8              pi_disc_key[2048];
54     int             i_title;
55     off_t           i_title_pos;
56     dvd_key_t       pi_title_key;
57 } css_t;