You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ensures that the aggregation service does not aggregate reports
1918
-
that received less privacy budget
1919
-
than the aggregation task was configured with.
1920
-
1921
-
User agents MUST include all of these extensions
1938
+
User agents include all of these extensions
1922
1939
in reports that they generate.
1923
1940
1924
1941
1942
+
### Report Encryption For DAP ### {#encrypt-dap}
1943
+
1944
+
<div algorithm>
1945
+
To <dfn>construct a DAP report</dfn>,
1946
+
producing a [=byte sequence=] |report|,
1947
+
given [=validated conversion options=] |options|,
1948
+
[=site=] |topLevelSite|,
1949
+
[=moment=] |now|,
1950
+
and a [=list=] of [=integers=] |histogram|:
1951
+
1952
+
1. Let |field| be Field128,
1953
+
as defined in [Section 6.1.3](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vdaf-15#section-6.1.3)
1954
+
of [[VDAF]].
1955
+
1956
+
1. Let |length| be the [=list/size=] of |histogram|.
1957
+
1958
+
1. Let |bits| be the base-2 logarithm
1959
+
of |options|.[=validated conversion options/max value=],
1960
+
rounded toward positive Infinity.
1961
+
1962
+
1. Let |chunkLength| be the square root of (|bits| + 1) * |length|,
1963
+
rounded to the nearest integer.
1964
+
1965
+
1. Let |vdaf| be a new PrioL1BoundSum VDAF [[PRIO-L1]] instance,
1966
+
passing |field|, |length|, |bits|, and |chunkLength|.
1967
+
1968
+
1. Let |taskID| be the [=byte sequence=]
1969
+
from the hex string `b13e8440f1cdb4da51eed3967e0a2652d27f5005bc35f751daf188b4b746708b`
1970
+
[[DAP-EXT]].
1971
+
1972
+
1. Let |ctx| be the [=byte sequence=] formed by concatenating
1973
+
the [=isomorphic encode|encoded=] string `dap-15`
1974
+
and |taskID|,
1975
+
as defined in [Section 4.5.2](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.2)
1976
+
of [[DAP]].
1977
+
1978
+
1. Let |reportID| be 16 bytes sampled from a cryptographically-secure random source [[RFC4086]].
1979
+
1980
+
1. Let |rand| be 128 bytes sampled from a cryptographically-secure random source [[RFC4086]].
1981
+
1982
+
1. Let |publicShare|, |inputShares| be the result of invoking |vdaf|.[`shard()`](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vdaf#section-4.1),
1983
+
as defined in [Section 4.1](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vdaf-15#section-4.1)
1984
+
of [[VDAF]],
1985
+
with |ctx|, |histogram|, |reportID| (as the VDAF "nonce" parameter), and |rand|.
1986
+
1987
+
1. Let |time| be |now| as a [=duration=] since the [=Unix epoch=],
1988
+
divided by a [=duration=] of 5 seconds.
1989
+
<!-- TODO: confirm fixed time resolution -->
1990
+
1991
+
1. Let |extensions| be a [=map=] of [=16-bit unsigned integers=] to [=byte sequences=],
1992
+
comprised of:
1993
+
1994
+
* The extension codepoint for [[DAP-EXT#name-late-task-binding|late task binding]],
1995
+
mapped to an [=list/is empty|empty=][=byte sequence=].
1996
+
1997
+
* The extension codepoint for [[DAP-EXT#name-privacy-budget-consumption|privacy budget]],
1998
+
mapped to the value of |encodedEpsilon|, derived as follows:
1999
+
2000
+
1. Let |scaledEpsilon| be the [=32-bit unsigned integer=]
2001
+
that is |options|.[=validated conversion options/epsilon=],
2002
+
multiplied by 1,000,000, then rounded toward positive Infinity.
with [UINT32](https://tc39.es/ecma262/multipage/indexed-collections.html#table-the-typedarray-constructors), |scaledEpsilon|, and `false` (for `isLittleEndian`).
2007
+
2008
+
* The extension codepoint for [[DAP-EXT#name-requester-website-identity|requester identity]],
2009
+
mapped to the [=isomorphic encode|encoded=] value of |topLevelSite|[1].
2010
+
2011
+
1. Let |reportMetadata| be encoded DAP [`ReportMetadata`](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.2)
2012
+
generated from |reportID|, |time|, and |extensions|.
2013
+
2014
+
1. Let |encryptedInputShares| be an [=list/is empty|empty=][=list=].
2015
+
2016
+
1. [=list/iterate|For each=] |share| of |inputShares|,
2017
+
follow the method for encrypting shares
2018
+
described in [Section 4.5.2](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.2):
2019
+
2020
+
1. Let |pkR| be the public key of the corresponding role from
2021
+
the [=aggregation service=][HPKE configuration](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.1)
2022
+
obtained for the [=aggregation service=]
2023
+
indicated by |options|.[=validated conversion options/Aggregation Service=].
2024
+
2025
+
<p class=note>The URL for <a enum-value for=PrivateAttributionAggregationProtocol>"dap-15-histogram"</a> is expected to identify the DAP Leader role.
2026
+
Implementations need to obtain HPKE configuration for both Aggregators statically.
2027
+
The HPKE configuration <span class=allow-2119>must not</span> be fetched on demand, as the time that takes
2028
+
will leak information to callers of <a method for=Attribution>measureConversion()</a>.
2029
+
2030
+
1. Let |serverRole| be 2 for the first item (the Leader)
2031
+
and 3 for the second (the Helper role).
2032
+
2033
+
1. Let |info| be the [=byte sequence=] formed by concatenating:
2034
+
the [=isomorphic encode|encoded=] value of the string `dap-15 input share`,
2035
+
a byte with the value 0x01, and |serverRole|.
2036
+
2037
+
1. Let |inputShareAAD| be constructed from
2038
+
|taskID|, |reportMetadata|, and |publicShare|,
2039
+
following the structure for [`InputShareAad`](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.2).
2040
+
2041
+
1. Let |hpke| be an HPKE [[RFC9180]] configuration
2042
+
that is based on the same [HPKE configuration](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.1).
2043
+
2044
+
1. Let |encryptedShare| be the result of invoking |hpke|.[`Seal<mode_base>()`](https://hpkewg.github.io/hpke/draft-ietf-hpke-hpke.html#section-6.1),
2045
+
passing |pkR|, |info|, |inputShareAAD|, and |share|.
2046
+
2047
+
1. [=list/Append=] |encryptedShare| to |encryptedInputShares|.
2048
+
2049
+
1. Let |report| be an encoded DAP [`Report`](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.2)
2050
+
generated from |reportMetadata|, |publicShare|, |encryptedInputShares|
2051
+
(the two values being the leader and helper encrypted input shares respectively),
2052
+
and [=aggregation service=][HPKE configuration](https://datatracker.ietf.org/doc/html/draft-ietf-ppm-dap-15#section-4.5.1)
2053
+
obtained from the DAP aggregators.
2054
+
2055
+
1. Return |report|.
2056
+
2057
+
</div>
2058
+
2059
+
1925
2060
## Trusted Execution Environments ## {#s-tee}
1926
2061
1927
2062
A <dfn lt=TEE>Trusted Execution Environment (TEE)</dfn> uses specialized hardware
0 commit comments