W3C home > Mailing lists > Public > public-webcrypto@w3.org > April 2014

Re: Handling of CryptoOperationData needs to be defined

From: Ryan Sleevi <sleevi@google.com>
Date: Wed, 23 Apr 2014 12:52:03 -0700
Message-ID: <CACvaWvZZj9gcQoYNcuHr_nmnhx4EE0pXi2aD0YGe4nzgbc8gsA@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "public-webcrypto@w3.org" <public-webcrypto@w3.org>
Boris,

Would you mind filing bugs in the bug tracker to make sure we never miss
comments?


On Wed, Apr 23, 2014 at 12:40 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> As far as I can tell, nothing actually defines the handling of
> CryptoOperationData arguments.
>
> For example, looking at https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/
> spec/Overview.html#dfn-SubtleCrypto-method-encrypt it just says:
>
>   Let ciphertext be the result of performing the encrypt operation
>   specified by normalizedAlgorithm using algorithm and key and with
>   data as plaintext.
>
> but nothing ever defines the type of "plaintext" here.  I assume it's
> meant to be some sort of byte array, right?
>
> If so, the following need to be clearly defined:
>
> 1)  How do extract a byte array from an ArrayBufferView.  Presumably this
> is a matter of looking at the underlying buffer and taking byteLength bytes
> starting at byteOffset.  And presumably this uses the canonical getters for
> those properties, not whatever is on the prototype (so the
> [[ViewedArrayBuffer]], [[ByteLength]], and [[ByteOffset]] internal slots of
> the object).  Note that at least one implementor just used all the bytes of
> the underlying ArrayBuffer instead, so this clearly does need defining.
>

Agreed


>
> 2) The exact point when the snapshot of the data is taken.  This matters,
> because the data is not immutable.  Presumably there's some sort of data
> copy before step 3 of https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/
> spec/Overview.html#dfn-SubtleCrypto-method-encrypt for example?


Agreed. The explicit copy step was called out in the pre-Promises version
(under the 'processing data' model), but I hadn't updated that section for
promises.


>
>
> -Boris
>
>
Received on Wednesday, 23 April 2014 19:52:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:17:22 UTC