Skip to content

Commit ad8b26d

Browse files
Merge branch 'main' into explicit-token-response
2 parents 4dbd0aa + f4700fd commit ad8b26d

File tree

1 file changed

+50
-7
lines changed

1 file changed

+50
-7
lines changed

draft-ietf-privacypass-batched-tokens.md

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,53 @@ to be sent that encompasses multiple token requests. This enables the issuance
106106
of tokens for more than one key in one round trip between the Client and the
107107
Issuer. The cost remains linear.
108108

109+
# Presentation Language
110+
111+
This document uses the TLS presentation language {{!RFC8446}} to describe the
112+
structure of protocol messages. In addition to the base syntax, it uses two
113+
additional features: the ability for fields to be optional and the ability for
114+
vectors to have variable-size length headers.
115+
116+
## Optional Value
117+
118+
An optional value is encoded with a presence-signaling octet, followed by the
119+
value itself if present. When decoding, a presence octet with a value other
120+
than 0 or 1 MUST be rejected as malformed.
121+
122+
~~~ tls-presentation
123+
struct {
124+
uint8 present;
125+
select (present) {
126+
case 0: struct{};
127+
case 1: T value;
128+
};
129+
} optional<T>;
130+
~~~
131+
132+
## Variable-Size Vector Length Headers
133+
134+
In the TLS presentation language, vectors are encoded as a sequence of encoded
135+
elements prefixed with a length. The length field has a fixed size set by
136+
specifying the minimum and maximum lengths of the encoded sequence of elements.
137+
138+
In this document, there are several vectors whose sizes vary over significant
139+
ranges. So instead of using a fixed-size length field, it uses a variable-size
140+
length using a variable-length integer encoding based on the one described in
141+
{{Section 16 of ?RFC9000}}. They differ only in that the one here requires a
142+
minimum-size encoding. Instead of presenting min and max values, the vector
143+
description simply includes a `V`. For example:
144+
145+
~~~ tls-presentation
146+
struct {
147+
uint32 fixed<0..255>;
148+
opaque variable<V>;
149+
} StructWithVectors;
150+
~~~
151+
109152
# Batched Privately Verifiable Token
110153

111154
This section describes a batched issuance protocol for select token types,
112-
including 0x0001 (defined in {{RFC9578}}) and 0xF91A (defined in this document).
155+
including 0x0001 (defined in {{RFC9578}}) and 0x0005 (defined in this document).
113156
This variant is more efficient than Arbitary Batch Token Issuance defined below.
114157
It does so by requiring the same key to be used by all token requests.
115158

@@ -155,7 +198,7 @@ struct {
155198
struct {
156199
uint16_t token_type;
157200
uint8_t truncated_token_key_id;
158-
BlindedElement blinded_elements<0..2^16-1>;
201+
BlindedElement blinded_elements<V>;
159202
} BatchTokenRequest;
160203
~~~
161204

@@ -260,7 +303,7 @@ struct {
260303
} EvaluatedElement;
261304

262305
struct {
263-
EvaluatedElement evaluated_elements<0..2^16-1>;
306+
EvaluatedElement evaluated_elements<V>;
264307
uint8_t evaluated_proof[Ns + Ns];
265308
} BatchTokenResponse;
266309
~~~
@@ -389,7 +432,7 @@ struct {
389432
} TokenRequest;
390433

391434
struct {
392-
TokenRequest token_requests<0..2^16-1>;
435+
TokenRequest token_requests<V>;
393436
} BatchTokenRequest
394437
~~~
395438

@@ -447,11 +490,11 @@ struct {
447490
} TokenResponse;
448491

449492
struct {
450-
TokenResponse token_response<0..2^16-1>; /* Defined by token_type */
493+
optional<TokenResponse> token_response; /* Defined by token_type */
451494
} OptionalTokenResponse;
452495

453496
struct {
454-
OptionalTokenResponse token_responses<0..2^16-1>;
497+
OptionalTokenResponse token_responses<V>;
455498
} BatchTokenResponse
456499
~~~
457500

@@ -509,7 +552,7 @@ This section contains IANA codepoint allocation requests.
509552
This document updates the "Token Type" Registry ({{AUTHSCHEME}}) with the
510553
following entry:
511554

512-
* Value: 0xF91A
555+
* Value: 0x0005 (suggested)
513556
* Name: VOPRF (ristretto255, SHA-512)
514557
* Token Structure: As defined in {{Section 2.2 of AUTHSCHEME}}
515558
* Token Key Encoding: Serialized using SerializeElement from {{Section 2.1 of

0 commit comments

Comments
 (0)