From 25d2b15422f098b51add783dda51681e1e4b95f0 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Thu, 9 Jan 2025 10:03:02 +0100 Subject: [PATCH] Use WebIDL's operations on ArrayBufferViews in getRandomValues (#395) --- spec/Overview.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/spec/Overview.html b/spec/Overview.html index dce7373..5615035 100644 --- a/spec/Overview.html +++ b/spec/Overview.html @@ -856,15 +856,29 @@

The getRandomValues method

  • - If the `byteLength` of |array| is greater than 65536, [= exception/throw =] a + Let |byteLength| be the [= BufferSource/byte length =] of |array|. +

    +
  • +
  • +

    + If |byteLength| is greater than 65536, [= exception/throw =] a {{QuotaExceededError}} and [= terminate the algorithm =].

  • - Overwrite all elements of |array| with cryptographically strong random values of - the appropriate type. + Let |bytes| be a [= byte sequence =] of length |byteLength|. +

    +
  • +
  • +

    + Fill |bytes| with cryptographically secure random bytes. +

    +
  • +
  • +

    + [= ArrayBufferView/Write =] |bytes| into |array|.