diff --git a/spec/Overview.html b/spec/Overview.html index 7b7f68a..7063da2 100644 --- a/spec/Overview.html +++ b/spec/Overview.html @@ -1271,7 +1271,7 @@
- Let |data| be the result of - [= get a copy of the buffer source | - getting a copy of the bytes held by =] the `data` parameter passed to the + Let |data| be the `data` parameter passed to the {{SubtleCrypto/digest()}} method.
+ Let |bytesPromise| be a new Promise. +
++ Let |bytes| be the result of + [= get a copy of the buffer source | + getting a copy of the bytes held by =] |data|. +
++ Resolve |bytesPromise| with |bytes|. +
++ In this case, |data| is an [= async sequence type | async sequence =] of {{BufferSource}}s. +
++ Let |bytes| be an empty [= byte sequence =]. +
++ Let |iterator| be the result of [= open an async sequence | opening =] |data|. +
++ If an error occurred, reject |bytesPromise| with + |iterator| and terminate these steps. +
++ Let |getValueSteps| be the following list of steps: +
++ Let |next| be the result of [= get an async iterator next value | getting the next value =] of |iterator|. +
++ [= promise/React =] to |next|: +
++ Reject |bytesPromise| with |reason|. +
++ If |value| is [= end of iteration =], + resolve |bytesPromise| with |bytes| + and terminate these steps. +
++ Append the result of [= get a copy of the buffer source | + getting a copy of the bytes held by =] |value| + to |bytes|. +
++ Perform |getValueSteps|. +
++ [= Queue a microtask =] to perform |getValueSteps|. +
++ The implementation may wish to compute the hash digest + incrementally, instead of waiting until all data is + available, in order to conserve memory. +
++ Additionally, if the |iterator| returned by + [= open an async sequence | opening =] |data| + is the iterator defined by `ReadableStream`, + the implementation may wish to optimize the steps + above, for example by reading the stream directly, + and/or transferring + the stream to the [= in parallel | parallel =] steps below. +
+Let |realm| be the [= relevant realm =] of [= this =]. @@ -1892,29 +2017,51 @@
- Let |digest| be the result of performing the digest - operation specified by |normalizedAlgorithm| using - |algorithm|, with |data| - as |message|. -
-- [= Queue a global task =] on the [= crypto task source =], - given |realm|'s global object, to perform the remaining steps. -
-- Let |result| be the result of [= ArrayBuffer/create | creating =] an {{ArrayBuffer}} - in |realm|, containing |digest|. -
-- Resolve |promise| with - |result|. + [= promise/React =] to |bytesPromise|:
++ [= exception/Throw =] |reason|. +
++ Let |digest| be the result of performing the digest + operation specified by |normalizedAlgorithm| using + |algorithm|, with |bytes| + as |message|. +
++ [= Queue a global task =] on the [= crypto task source =], + given |realm|'s global object, to perform the remaining steps. +
++ Let |result| be the result of [= ArrayBuffer/create | creating =] an {{ArrayBuffer}} + in |realm|, containing |digest|. +
++ Resolve |promise| with + |result|. +
+