]> git.sesse.net Git - vlc/blob - extras/libdvdcss/css.h
* libdvdcss enhancements by Billy Biggs <vektor@dumbterm.net>. This breaks
[vlc] / extras / libdvdcss / css.h
1 /*****************************************************************************
2  * css.h: Structures for DVD authentification and unscrambling
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  * $Id: css.h,v 1.4 2001/07/11 02:01:03 sam 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              p_challenge[2*KEY_SIZE];
36     dvd_key_t       p_key1;
37     dvd_key_t       p_key2;
38     dvd_key_t       p_key_check;
39     u8              i_varient;
40 } disc_t;
41
42 typedef struct title_key_s
43 {
44     int                 i_startlb;
45     dvd_key_t           p_key;
46     struct title_key_s *p_next;
47 } title_key_t;
48
49 typedef struct css_s
50 {
51     int             i_agid;
52     disc_t          disc;
53     u8              p_disc_key[2048];
54 } css_t;
55
56 /*****************************************************************************
57  * Prototypes in css.c
58  *****************************************************************************/
59 struct css_s;
60
61 int   CSSTest             ( dvdcss_handle );
62 int   CSSInit             ( dvdcss_handle );
63 int   CSSGetKey           ( dvdcss_handle, int, dvd_key_t );
64 int   CSSDescrambleSector ( u8 * , u8 * );
65