Skip to content

Commit

Permalink
@murillo128 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Jul 9, 2024
1 parent 60476c5 commit 61d4f14
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions draft-ietf-sframe-enc.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ The SFrame header specifies two values from which encryption parameters are
derived:

* A Key ID (KID) that determines which encryption key should be used
* A counter (CTR) that is used to construct the nonce for the encryption
* A Counter (CTR) that is used to construct the nonce for the encryption

Applications MUST ensure that each (KID, CTR) combination is used for exactly
one SFrame encryption operation. A typical approach to achieve this guarantee is
Expand All @@ -307,26 +307,26 @@ outlined in {{header-value-uniqueness}}.
The SFrame header has the overall structure shown in {{fig-sframe-header}}. The
first byte is a "config byte", with the following fields:

Extended Key ID Flag (X, 1 bit):
: Indicates if the K field contains the Key ID or the Key ID length.
Extended KID Flag (X, 1 bit):
: Indicates if the K field contains the KID or the KID length.

Key or Key Length (K, 3 bits):
: If the X flag is set to 0, this field contains the Key ID. If the X flag is
set to 1, then it contains the length of the Key ID, minus one.
KID or KID Length (K, 3 bits):
: If the X flag is set to 0, this field contains the KID. If the X flag is
set to 1, then it contains the length of the KID, minus one.

Extended Counter Flag (Y, 1 bit):
: Indicates if the C field contains the Counter or the Counter length.
Extended CTR Flag (Y, 1 bit):
: Indicates if the C field contains the CTR or the CTR length.

Counter or Counter Length (C, 3 bits):
: This field contains the Counter (CTR) if the Y flag is set to 0, or the counter
CTR or CTR Length (C, 3 bits):
: This field contains the CTR if the Y flag is set to 0, or the CTR
length, minus one, if set to 1.

The Key ID and Counter fields are encoded as compact unsigned integers in
The KID and CTR fields are encoded as compact unsigned integers in
network (big-endian) byte order. If the value of one of these fields is in the
range 0-7, then the value is carried in the corresponding bits of the config
byte (K or C) and the corresponding flag (X or Y) is set to zero. Otherwise,
the value MUST be encoded with the minimum number of bytes required and
appended after the config byte, with the Key ID first and Counter second.
appended after the config byte, with the KID first and CTR second.
The header field (K or C) is set to the number of bytes in the encoded value,
minus one. The value 000 represents a length of 1, 001 a length of 2, etc.
This allows a 3-bit length field to represent the value lengths 1-8.
Expand Down Expand Up @@ -1256,7 +1256,7 @@ bound of those seen in practice.

| Field | Bytes | Explanation |
|:----------------|------:|:--------------------------------------------------|
| Fixed header | 1 | Fixed |
| Config byte | 1 | Fixed |
| Key ID (KID) | 2 | >255 senders; or MLS epoch (E=4) and >16 senders |
| Counter (CTR) | 3 | More than 24 hours of media in common cases |
| Cipher overhead | 16 | Full authentication tag (longest defined here) |
Expand Down

0 comments on commit 61d4f14

Please sign in to comment.