source: svn/newcon3bcm2_21bu/BSEAV/api/include/bsettop_cipher.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 4.7 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2007, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bsettop_cipher.h $
11 * $brcm_Revision: 2 $
12 * $brcm_Date: 2/1/07 6:29p $
13 *
14 * Module Description: ioctl interface for driver
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /BSEAV/api/include/bsettop_cipher.h $
19 *
20 * 2   2/1/07 6:29p vsilyaev
21 * PR 27399: Fixed typo and updated comments
22 *
23 * 1   2/7/05 7:04p dlwin
24 * Merge down for release 2005_REFSW_MERGETOMAIN:
25 *
26 * Irvine_BSEAVSW_Devel/8   6/23/04 3:21p erickson
27 * PR11135: fixed comment
28 *
29 * Irvine_BSEAVSW_Devel/7   11/18/03 1:54p erickson
30 * PR8356: got venom2 working and added scrambling_control support
31 *
32 * Irvine_BSEAVSW_Devel/6   11/7/03 4:28p erickson
33 * PR8583: removing, fixing or implementing TODO's
34 *
35 * Irvine_BSEAVSW_Devel/5   11/4/03 2:42p erickson
36 * documentation changes
37 *
38 * Irvine_BSEAVSW_Devel/4   10/31/03 11:58a erickson
39 * settop api changes after internal review
40 *
41 * Irvine_BSEAVSW_Devel/3   10/28/03 11:28a erickson
42 * settop api reworks after internal design view
43 *
44 * Irvine_BSEAVSW_Devel/2   9/30/03 12:19a erickson
45 * added standard header stuff like cplusplus
46 *
47 * Irvine_BSEAVSW_Devel/1   9/25/03 1:28p erickson
48 * added cpu-based encryption to settop api and util
49 *
50 *************************************************************************/
51#ifndef BSETTOP_CIPHER_H__
52#define BSETTOP_CIPHER_H__
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58/*=******************************
59The cipher module provides access to the PVR DES/3DES encryption
60and decryption engine. You can decrypt or encrypt MPEG2 transport data
61off-line, or you can also encrypt or decrypt any raw data for your own purposes.
62
63This is not the interface for controlling playback or record encryption or live conditional access.
64PVR encryption is handled through the bstream_mpeg.encryption structure passed in to
65bplayback_start.
66
67Live conditional access for Magnum platforms is supported via bstream_set_encryption.
68Live conditional access for legacy platforms is not yet supported.
69
70The cipher module is not intended for use with Magnum platforms.  General cryptographic functionality
71for Magnum boards is provided via the bcrypto interface.
72*********************************/
73
74/*
75Summary:
76        Handle for cipher engine.
77*/
78typedef struct bcipher *bcipher_t;
79
80/*
81Summary:
82        Open a cipher handle.
83*/
84bcipher_t bcipher_open(
85        bobject_t id
86        );
87
88/*
89Summary:
90        Close a cipher handle.
91*/
92void bcipher_close(bcipher_t encrypt);
93
94/*
95Summary:
96Mode used when processing data.
97Description:
983DES is not symmetric, therefore you must chose encrypt or decrypt mode.
99This doesn't matter for DES.
100*/
101typedef enum bcipher_mode {
102        bcipher_mode_encrypt,
103        bcipher_mode_decrypt
104} bcipher_mode;
105
106/*
107Summary:
108Special data format (e.g. MPEG2 Transport) to be processed by the cipher engine.
109*/
110typedef enum bcipher_data_format {
111        bcipher_data_format_raw,        /* Process all data */
112        bcipher_data_format_ts          /* Data will be processed in 188 byte packets,
113                                                skipping the transport headers and verifying the sync byte. */
114} bcipher_data_format;
115
116/*
117Summary:
118Settings structure passed into bcipher_convert_data to control
119the type of encryption or decryption performed.
120*/
121typedef struct bcipher_settings {
122        bencryption_params encryption;                          /* Encryption type and key */
123        bcipher_mode mode;
124        bcipher_data_format data_format;        /* Special data format processing */
125        bool scrambling_control;        /* If true, then the cipher algorithm will set and
126                                        clear the MPEG2 transport scrambling control field. This is necessary
127                                        to support Broadcom trick modes with pvr encrypted streams. */
128} bcipher_settings;
129
130/*
131Summary:
132Required to initialize bcipher_settings.
133*/
134void bcipher_settings_init(
135        bcipher_settings *settings,     /* [out] structure to be initialized */
136        bcipher_t cipher                        /* Cipher handle if there are resource-specific defaults */
137        );
138
139/*
140Summary:
141Encrypt or decrypt a buffer of data using the PVR encryption block.
142*/
143bresult
144bcipher_convert_data(
145        bcipher_t handle,               /* handle returned by bcipher_open() */
146        void *dest,                             /* [out,size_is(datalen)] data to be converted */
147        const void *source,             /* [size_is(datalen)] data to be converted */
148        size_t datalen,                 /* length of data in bytes to be converted */
149        const bcipher_settings *settings /* settings which control the type of encryption
150                                                                or decryption. */
151        );
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif /* BSETTOP_CIPHER_H__ */
158
Note: See TracBrowser for help on using the repository browser.