OLD | NEW |
---|---|
(Empty) | |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 * Use of this source code is governed by a BSD-style license that can be | |
3 * found in the LICENSE file. | |
4 */ | |
5 | |
6 /** | |
7 * The <code>PP_DecryptTrackingInfo</code> struct contains necessary information | |
8 * that can be used to associate the decrypted data with a decrypt request | |
9 * and/or an input buffer. | |
10 */ | |
11 [assert_size(16)] | |
12 struct PP_DecryptTrackingInfo { | |
13 /** | |
14 * Client-specified identifier for the associated decrypt request. By using | |
15 * this value, the client can associate the decrypted data with a decryption | |
16 * request. | |
17 */ | |
18 uint64_t request_id; | |
ddorwin
2012/08/16 23:56:05
This is only used for decrypt (no decode), right?
xhwang
2012/08/17 01:00:35
Even with decode, we still need to find the right
| |
19 | |
20 /** | |
21 * Timestamp in microseconds of the associated buffer. By using this value, | |
22 * the client can associate the decrypted (and decoded) data with an input | |
23 * buffer. This is needed because the decoded buffers can be out of the input | |
ddorwin
2012/08/16 23:56:05
... buffers may be delivered out of order and not
xhwang
2012/08/17 01:00:35
Done.
| |
24 * order. | |
25 */ | |
26 int64_t timestamp; | |
27 }; | |
28 | |
29 /** | |
30 * The <code>PP_DecryptSubsampleDescription</code> struct contains information | |
31 * to support subsample decryption. | |
32 * | |
33 * An input buffer can be split into several continuous subsamples. | |
34 * A <code>PP_DecryptSubsampleEntry</code> specifies the number of clear and | |
35 * cipher bytes in each subsample. For example, the following buffer has three | |
36 * subsamples: | |
37 * | |
38 * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| | |
39 * | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 | | |
40 * | |
41 * For decryption, all of the cipher bytes in a buffer should be treated as a | |
42 * continuous (in the subsample order) logical stream. The clear bytes should | |
dmichael (off chromium)
2012/08/16 22:26:51
continuous->contiguous?
xhwang
2012/08/17 01:00:35
Done.
| |
43 * not be considered as part of decryption. | |
44 * | |
45 * Logical stream to decrypt: | cipher1 | cipher2 | cipher3 | | |
46 * Decrypted stream: | decrypted1| decrypted2 | decrypted3 | | |
47 * | |
48 * After decryption, the decrypted bytes should be copied over the position | |
49 * of the corresponding cipher bytes in the original buffer to form the output | |
50 * buffer. Following the above example, the decrypted buffer should be: | |
51 * | |
52 * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| | |
53 * | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 | | |
54 */ | |
55 [assert_size(8)] | |
56 struct PP_DecryptSubsampleDescription { | |
57 /** | |
58 * Size in bytes of clear data in a subsample entry. | |
59 */ | |
60 uint32_t clear_bytes; | |
61 | |
62 /** | |
63 * Size in bytes of encrypted data in a subsample entry. | |
64 */ | |
65 uint32_t cipher_bytes; | |
66 }; | |
67 | |
68 /** | |
69 * The <code>PP_DecryptConfig</code> struct contains all information needed to | |
70 * decrypt an encrypted buffer. | |
71 */ | |
72 [assert_size(256)] | |
73 struct PP_DecryptConfig { | |
74 /** | |
75 * Information needed by the client to track the buffer to be decrypted. | |
76 * | |
77 * TODO(xhwang): Consider moving this out of <code>PP_DecryptConfig</code> | |
78 * since strictly speaking it's not a part of the decrypt config. Keep it | |
79 * here for now because there is a limit of 5 parameters in the IPC message | |
80 * so we don't want to pass too many parameters in the Decrypt() calls. | |
81 */ | |
82 PP_DecryptTrackingInfo tracking_info; | |
83 | |
84 /** | |
85 * Size in bytes of data to be discarded before applying the decryption. | |
86 */ | |
87 uint32_t data_offset; | |
88 | |
89 /** | |
90 * Key ID of the buffer to be decrypted. | |
91 * | |
92 * TODO(xhwang): For WebM the key ID can be as large as 2048 bytes in theory. | |
93 * But it's not used in current implementations. If we really need to support | |
94 * it, we should move key ID out as a separate parameter, e.g. as PP_Var, or | |
95 * make the whole PP_DecryptConfig as a PP_Resource. | |
96 */ | |
97 uint8_t[64] key_id; | |
98 uint32_t key_id_size; | |
99 | |
100 /** | |
101 * Initialization vector of the buffer to be decrypted. | |
102 */ | |
103 uint8_t[16] iv; | |
104 uint32_t iv_size; | |
105 | |
106 /** | |
107 * Checksum of the buffer to be decrypted. | |
108 */ | |
109 uint8_t[12] checksum; | |
110 uint32_t checksum_size; | |
111 | |
112 /** | |
113 * Subsample information of the buffer to be decrypted. | |
114 */ | |
115 PP_DecryptSubsampleDescription[16] subsamples; | |
116 uint32_t num_subsamples; | |
117 }; | |
OLD | NEW |