From f3bf2c3a767480a6e8fcce9435eb1700ab134f4c Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Tue, 7 Jan 2025 20:27:47 +0100 Subject: [PATCH] Properly define the length in bits of a byte sequence --- spec/Overview.html | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/spec/Overview.html b/spec/Overview.html index 30e2315..ab2e248 100644 --- a/spec/Overview.html +++ b/spec/Overview.html @@ -614,6 +614,10 @@

Terminology

The term [= byte sequence =] is defined in [[Infra]].

+

+ The length in bits of a [= byte sequence =] + is its [= byte sequence/length =] multiplied by 8. +

A byte sequence containing a bit sequence |b| is the [= byte sequence =] obtained by first appending zero or more @@ -9030,7 +9034,7 @@

Operations

- If the length of |secret| in bits is less than + If the [= length in bits =] of |secret| is less than |length|:
@@ -12258,7 +12262,7 @@

Operations

  • - If the length in bits of |data| is not 128, 192 or 256 + If the [= length in bits =] of |data| is not 128, 192 or 256 then [= exception/throw =] a {{DataError}}.

    @@ -12300,17 +12304,17 @@

    Operations

  • -
    If |data| has length 128 bits:
    +
    If the [= length in bits =] of |data| is 128:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A128CTR`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 192 bits:
    +
    If the [= length in bits =] of |data| is 192:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A192CTR`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 256 bits:
    +
    If the [= length in bits =] of |data| is 256:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A256CTR`", then [= exception/throw =] a {{DataError}}. @@ -12801,7 +12805,7 @@

    Operations

  • - If the length in bits of |data| is not 128, 192 or 256 + If the [= length in bits =] of |data| is not 128, 192 or 256 then [= exception/throw =] a {{DataError}}.

    @@ -12843,17 +12847,17 @@

    Operations

  • -
    If |data| has length 128 bits:
    +
    If the [= length in bits =] of |data| is 128:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A128CBC`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 192 bits:
    +
    If the [= length in bits =] of |data| is 192:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A192CBC`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 256 bits:
    +
    If the [= length in bits =] of |data| is 256:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A256CBC`", then [= exception/throw =] a @@ -13237,7 +13241,7 @@

    Operations

  • - If |ciphertext| has a length less than |tagLength| bits, + If |ciphertext| has a [= length in bits =] less than |tagLength|, then [= exception/throw =] an {{OperationError}}.

    @@ -13428,7 +13432,7 @@

    Operations

  • - If the length in bits of |data| is not 128, 192 or 256 + If the [= length in bits =] of |data| is not 128, 192 or 256 then [= exception/throw =] a {{DataError}}.

    @@ -13470,17 +13474,17 @@

    Operations

  • -
    If |data| has length 128 bits:
    +
    If the [= length in bits =] of |data| is 128:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A128GCM`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 192 bits:
    +
    If the [= length in bits =] of |data| is 192:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A192GCM`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 256 bits:
    +
    If the [= length in bits =] of |data| is 256:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A256GCM`", then [= exception/throw =] a @@ -13915,7 +13919,7 @@

    Operations

  • - If the length in bits of |data| is not 128, 192 or 256 + If the [= length in bits =] of |data| is not 128, 192 or 256 then [= exception/throw =] a {{DataError}}.

    @@ -13957,17 +13961,17 @@

    Operations

  • -
    If |data| has length 128 bits:
    +
    If the [= length in bits =] of |data| is 128:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A128KW`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 192 bits:
    +
    If the [= length in bits =] of |data| is 192:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A192KW`", then [= exception/throw =] a {{DataError}}.
    -
    If |data| has length 256 bits:
    +
    If the [= length in bits =] of |data| is 256:
    If the {{JsonWebKey/alg}} field of |jwk| is present, and is not "`A256KW`", then [= exception/throw =] a @@ -14619,8 +14623,8 @@

    Operations

  • - Let |length| be equivalent to the length, in octets, of - |data|, multiplied by 8. + Let |length| be the [= length in bits =] of + |data|.