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 data structure that can be used to associate the decrypted data with a | |
dmichael (off chromium)
2012/08/16 17:36:33
This comment is worded strangely. We usually use c
xhwang
2012/08/16 20:10:39
Done.
| |
8 * decrypt request and/or an input buffer. | |
9 */ | |
10 [assert_size(24)] | |
11 struct PP_DecryptTrackingInfo { | |
12 /** | |
13 * Client-specified identifier for the associated decrypt request. By using | |
14 * this value client can associate the decrypted data with a decryption | |
dmichael (off chromium)
2012/08/16 17:36:33
"value client" -> "value, the client"
xhwang
2012/08/16 20:10:39
Done.
| |
15 * request. | |
16 */ | |
17 uint64_t request_id; | |
18 | |
19 /** | |
20 * Timestamp in milliseconds of the associated buffer. By using this value | |
21 * client can associate the decrypted (and decoded) data with an input buffer. | |
ddorwin
2012/08/16 04:31:52
Why isn't the above member enough for association?
xhwang
2012/08/16 20:10:39
Added more explanation: "This is needed as the dec
| |
22 */ | |
23 int64_t timestamp; | |
dmichael (off chromium)
2012/08/16 17:36:33
We usually use PP_Time (which really just typedefs
xhwang
2012/08/16 20:10:39
This timestamp is really only for tracking and in
| |
24 | |
25 /** | |
26 * Duration in milliseconds of the associated buffer. | |
27 */ | |
28 int64_t duration; | |
ddorwin
2012/08/16 04:31:52
Pending scherkus's response in the other CL.
dmichael (off chromium)
2012/08/16 17:36:33
64 bits seems really huge for milliseconds... are
xhwang
2012/08/16 20:10:39
duration is removed as per offline discussion w/ s
| |
29 }; | |
30 | |
31 /** | |
32 * The data structure for decryption subsample entry. | |
33 * | |
34 * An input buffer can be split into several continuous subsamples. | |
35 * A <code>PP_DecryptSubsampleEntry</code> specifies the number of clear and | |
36 * cipher bytes in each subsample. For example, the following buffer has three | |
37 * subsamples: | |
38 * | |
39 * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| | |
40 * | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 | | |
41 * | |
42 * For decryption, all of the cipher bytes in a buffer should be concatenated | |
dmichael (off chromium)
2012/08/16 17:36:33
Do you really have to concatenate the "cipher byte
xhwang
2012/08/16 20:10:39
Done.
| |
43 * (in the subsample order) into a single logical stream. The clear bytes should | |
44 * not be considered as part of decryption. | |
45 * | |
46 * Stream to decrypt: | cipher1 | cipher2 | cipher3 | | |
47 * Decrypted stream: | decrypted1| decrypted2 | decrypted3 | | |
48 * | |
49 * After decryption, the decrypted bytes should be copied over the position | |
50 * of the corresponding cipher bytes in the original buffer to form the output | |
51 * buffer. Following the above example, the decrypted buffer should be: | |
52 * | |
53 * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->| | |
54 * | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 | | |
55 */ | |
56 [assert_size(8)] | |
57 struct PP_DecryptSubsampleEntry { | |
dmichael (off chromium)
2012/08/16 17:36:33
Maybe a different name, since this isn't really a
xhwang
2012/08/16 20:10:39
Done.
| |
58 /** | |
59 * Size in bytes of clear data in a subsample entry. | |
60 */ | |
61 uint32_t clear_bytes; | |
62 | |
63 /** | |
64 * Size in bytes of encrypted data in a subsample entry. | |
65 */ | |
66 uint32_t cipher_bytes; | |
67 }; | |
68 | |
69 /** | |
70 * The data structure that contains all information needed to decrypt a buffer. | |
ddorwin
2012/08/16 04:31:52
Is "The data structure that" wording common in PPA
dmichael (off chromium)
2012/08/16 17:36:33
Not common. We'd usually say "PP_DecryptConfig con
xhwang
2012/08/16 20:10:39
Done.
| |
71 */ | |
72 [assert_size(368)] | |
73 struct PP_DecryptConfig { | |
74 /** | |
75 * Information needed by the client to track the buffer to be decrypted. | |
76 */ | |
77 PP_DecryptTrackingInfo tracking_info; | |
ddorwin
2012/08/16 04:31:52
Not really decryption configuration. Can we use a
xhwang
2012/08/16 20:10:39
Added comment about this.
| |
78 | |
79 /** | |
80 * Size of data to be discarded before applying the decryption (in bytes). | |
81 */ | |
82 uint32_t data_offset; | |
83 | |
84 /** | |
85 * Key ID of the buffer to be decrypted. | |
86 */ | |
87 uint8_t[68] key_id; | |
xhwang
2012/08/16 03:14:41
As per dmichael@:
1, 8-byte data need to be on 8-b
ddorwin
2012/08/16 04:31:52
I still don't understand the reason for 68 here. M
dmichael (off chromium)
2012/08/16 17:36:33
Well, it's not *our* rule :-). The compiler will a
xhwang
2012/08/16 20:10:39
There's no easy way to define and use a constant i
| |
88 uint32_t key_id_size; | |
89 | |
90 /** | |
91 * Initialization vector of the buffer to be decrypted. | |
92 */ | |
93 uint8_t[64] iv; | |
94 uint32_t iv_size; | |
95 | |
96 /** | |
97 * Checksum of the buffer to be decrypted. | |
98 */ | |
99 uint8_t[64] checksum; | |
100 uint32_t checksum_size; | |
101 | |
102 /** | |
103 * Subsamples of the buffer to be decrypted. | |
ddorwin
2012/08/16 04:31:52
Subsample information/map of...
xhwang
2012/08/16 20:10:39
Done.
| |
104 */ | |
105 PP_DecryptSubsampleEntry[16] subsamples; | |
ddorwin
2012/08/16 04:31:52
Strange to always have 1 KB of data appended. May
xhwang
2012/08/16 20:10:39
It's 16*8=128bytes, so I suppose it's fine here. W
| |
106 uint32_t num_subsamples; | |
107 }; | |
dmichael (off chromium)
2012/08/16 17:36:33
This is pretty big... you *could* consider making
xhwang
2012/08/16 20:10:39
That's a good suggestion. It may change in size an
| |
OLD | NEW |