@@ -106,10 +106,53 @@ to be sent that encompasses multiple token requests. This enables the issuance
106
106
of tokens for more than one key in one round trip between the Client and the
107
107
Issuer. The cost remains linear.
108
108
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
+
109
152
# Batched Privately Verifiable Token
110
153
111
154
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).
113
156
This variant is more efficient than Arbitary Batch Token Issuance defined below.
114
157
It does so by requiring the same key to be used by all token requests.
115
158
@@ -155,7 +198,7 @@ struct {
155
198
struct {
156
199
uint16_t token_type;
157
200
uint8_t truncated_token_key_id;
158
- BlindedElement blinded_elements<0..2^16-1 >;
201
+ BlindedElement blinded_elements<V >;
159
202
} BatchTokenRequest;
160
203
~~~
161
204
@@ -260,7 +303,7 @@ struct {
260
303
} EvaluatedElement;
261
304
262
305
struct {
263
- EvaluatedElement evaluated_elements<0..2^16-1 >;
306
+ EvaluatedElement evaluated_elements<V >;
264
307
uint8_t evaluated_proof[Ns + Ns];
265
308
} BatchTokenResponse;
266
309
~~~
@@ -389,7 +432,7 @@ struct {
389
432
} TokenRequest;
390
433
391
434
struct {
392
- TokenRequest token_requests<0..2^16-1 >;
435
+ TokenRequest token_requests<V >;
393
436
} BatchTokenRequest
394
437
~~~
395
438
@@ -447,11 +490,11 @@ struct {
447
490
} TokenResponse;
448
491
449
492
struct {
450
- TokenResponse token_response<0..2^16-1> ; /* Defined by token_type */
493
+ optional< TokenResponse> token_response; /* Defined by token_type */
451
494
} OptionalTokenResponse;
452
495
453
496
struct {
454
- OptionalTokenResponse token_responses<0..2^16-1 >;
497
+ OptionalTokenResponse token_responses<V >;
455
498
} BatchTokenResponse
456
499
~~~
457
500
@@ -509,7 +552,7 @@ This section contains IANA codepoint allocation requests.
509
552
This document updates the "Token Type" Registry ({{AUTHSCHEME}}) with the
510
553
following entry :
511
554
512
- * Value: 0xF91A
555
+ * Value: 0x0005 (suggested)
513
556
* Name: VOPRF (ristretto255, SHA-512)
514
557
* Token Structure: As defined in {{Section 2.2 of AUTHSCHEME}}
515
558
* Token Key Encoding: Serialized using SerializeElement from {{Section 2.1 of
0 commit comments