1 /*****************************************************************************
2  * css.h: Structures for DVD authentication and unscrambling
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  *
6  * Author: Stéphane Borel <stef@via.ecp.fr>
7  *
8  * based on:
9  *  - css-auth by Derek Fawcus <derek@spider.com>
10  *  - DVD CSS ioctls example program by Andrew T. Veliath <andrewtv@usa.net>
11  *  - DeCSSPlus by Ethan Hawke
12  *  - The Divide and conquer attack by Frank A. Stevenson <frank@funcom.com>
13  *
14  * libdvdcss is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * libdvdcss is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with libdvdcss; if not, write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  *****************************************************************************/
28 
29 #ifndef DVDCSS_CSS_H
30 #define DVDCSS_CSS_H
31 
32 #include <stdint.h>
33 
34 #include "dvdcss/dvdcss.h"
35 
36 #define CACHE_FILENAME_LENGTH_STRING "10"
37 
38 #define DVD_KEY_SIZE 5
39 
40 typedef uint8_t dvd_key[DVD_KEY_SIZE];
41 
42 typedef struct dvd_title
43 {
44     int               i_startlb;
45     dvd_key           p_key;
46     struct dvd_title *p_next;
47 } dvd_title;
48 
49 typedef struct css
50 {
51     int             i_agid;      /* Current Authentication Grant ID. */
52     dvd_key         p_bus_key;   /* Current session key. */
53     dvd_key         p_disc_key;  /* This DVD disc's key. */
54     dvd_key         p_title_key; /* Current title key. */
55 } css;
56 
57 /*****************************************************************************
58  * Prototypes in css.c
59  *****************************************************************************/
60 int dvdcss_test       ( dvdcss_t );
61 int dvdcss_title      ( dvdcss_t, int );
62 int dvdcss_disckey    ( dvdcss_t );
63 int dvdcss_unscramble ( uint8_t *, uint8_t * );
64 
65 #endif /* DVDCSS_CSS_H */
66