Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: ppapi/api/private/pp_decrypt_config.idl

Issue 10857027: Add content decryptor related structs and update PP{P|B}_ContentDecryptor_Private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/api/private/ppb_content_decryptor_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/private/pp_decrypt_config.idl
diff --git a/ppapi/api/private/pp_decrypt_config.idl b/ppapi/api/private/pp_decrypt_config.idl
new file mode 100644
index 0000000000000000000000000000000000000000..9fdb0d5246bf829f41fe6c25b2fa7b15439e3c85
--- /dev/null
+++ b/ppapi/api/private/pp_decrypt_config.idl
@@ -0,0 +1,107 @@
+/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**
+ * 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.
+ * decrypt request and/or an input buffer.
+ */
+[assert_size(24)]
+struct PP_DecryptTrackingInfo {
+ /**
+ * Client-specified identifier for the associated decrypt request. By using
+ * 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.
+ * request.
+ */
+ uint64_t request_id;
+
+ /**
+ * Timestamp in milliseconds of the associated buffer. By using this value
+ * 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
+ */
+ 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
+
+ /**
+ * Duration in milliseconds of the associated buffer.
+ */
+ 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
+};
+
+/**
+ * The data structure for decryption subsample entry.
+ *
+ * An input buffer can be split into several continuous subsamples.
+ * A <code>PP_DecryptSubsampleEntry</code> specifies the number of clear and
+ * cipher bytes in each subsample. For example, the following buffer has three
+ * subsamples:
+ *
+ * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
+ * | clear1 | cipher1 | clear2 | cipher2 | clear3 | cipher3 |
+ *
+ * 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.
+ * (in the subsample order) into a single logical stream. The clear bytes should
+ * not be considered as part of decryption.
+ *
+ * Stream to decrypt: | cipher1 | cipher2 | cipher3 |
+ * Decrypted stream: | decrypted1| decrypted2 | decrypted3 |
+ *
+ * After decryption, the decrypted bytes should be copied over the position
+ * of the corresponding cipher bytes in the original buffer to form the output
+ * buffer. Following the above example, the decrypted buffer should be:
+ *
+ * |<----- subsample1 ----->|<----- subsample2 ----->|<----- subsample3 ----->|
+ * | clear1 | decrypted1| clear2 | decrypted2 | clear3 | decrypted3 |
+ */
+[assert_size(8)]
+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.
+ /**
+ * Size in bytes of clear data in a subsample entry.
+ */
+ uint32_t clear_bytes;
+
+ /**
+ * Size in bytes of encrypted data in a subsample entry.
+ */
+ uint32_t cipher_bytes;
+};
+
+/**
+ * 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.
+ */
+[assert_size(368)]
+struct PP_DecryptConfig {
+ /**
+ * Information needed by the client to track the buffer to be decrypted.
+ */
+ 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.
+
+ /**
+ * Size of data to be discarded before applying the decryption (in bytes).
+ */
+ uint32_t data_offset;
+
+ /**
+ * Key ID of the buffer to be decrypted.
+ */
+ 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
+ uint32_t key_id_size;
+
+ /**
+ * Initialization vector of the buffer to be decrypted.
+ */
+ uint8_t[64] iv;
+ uint32_t iv_size;
+
+ /**
+ * Checksum of the buffer to be decrypted.
+ */
+ uint8_t[64] checksum;
+ uint32_t checksum_size;
+
+ /**
+ * 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.
+ */
+ 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
+ uint32_t num_subsamples;
+};
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
« no previous file with comments | « no previous file | ppapi/api/private/ppb_content_decryptor_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698