Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poc: Add application context string (*) #422

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

cjpatton
Copy link
Collaborator

@cjpatton cjpatton commented Sep 9, 2024

Based on #421 (merge that first).
Partially addresses #418 (still need to propagate to draft).

Add an application context string, denoted ctx, to sharding and preparation APIs for DAFs and VDAFs. The intent is to use this for defense-in-depth: by binding execution of a VDAF to its application (concretely, in DAP we would set ctx to the task ID), we hope that an attack on that application does not translate directly to an attack on another application using the same parameters.

This change is motivated by the possibility of an offline attack against the robustness of some Prio3 variants. The attack is as follows: fix an invalid measurement, then search for measurement shares that derive joint randomness that causes the circuit to accept. Once these shares are found, they can be used to corrupt any batch that uses the same Prio3 parameters.

To reduce the blast radius of this attack, we can bind ctx to the joint randomness derivation, thereby ensuring the offline work done by the attacker is only useful to break a single application.

This change is slightly more general: wherever we compute a domain separation tag in either Prio3 or Poplar1, we append ctx. This is a more invasive than necessary, but it's also more conservative.

Finally, we modify XofTurboShake128 and XofFixedKeyAes128 by changing the length prefix for the domain separation tag from a single byte to two bytes, thereby accommodating larger application context strings.

@cjpatton cjpatton force-pushed the cjpatton/draft-12/context-string branch from 1ffddcb to cb5bc19 Compare September 9, 2024 21:36
@cjpatton cjpatton marked this pull request as ready for review September 19, 2024 01:38
@cjpatton cjpatton changed the title Add application context string (*) poc: Add application context string (*) Sep 19, 2024
@cjpatton cjpatton force-pushed the cjpatton/draft-12/context-string branch from cb5bc19 to 2814e72 Compare September 19, 2024 01:40
@cjpatton cjpatton force-pushed the cjpatton/draft-12/domain-sep branch from b78382b to 4abca34 Compare September 19, 2024 01:42
@cjpatton cjpatton force-pushed the cjpatton/draft-12/context-string branch from 2814e72 to ce8f458 Compare September 19, 2024 01:44
@cjpatton
Copy link
Collaborator Author

Scoped the PR to just changing the poc and converted to "ready for review". (We'll propagate the changes to the draft in the next PR.) Also rebased.

@cjpatton cjpatton force-pushed the cjpatton/draft-12/domain-sep branch from e93baa9 to fe18ace Compare September 19, 2024 23:53
@cjpatton cjpatton changed the base branch from cjpatton/draft-12/domain-sep to main September 19, 2024 23:54
@cjpatton cjpatton force-pushed the cjpatton/draft-12/context-string branch from ce8f458 to faa2520 Compare September 19, 2024 23:55
@cjpatton
Copy link
Collaborator Author

Rebased.

WIP: We still need to propagate the changes through the draft and update
security considerations, in particular the line about weak parameters
being exploitable across tasks.

Add an application context string, denoted `ctx`, to sharding and
preparation APIs for DAFs and VDAFs. The intent is to use this for
defense-in-depth: by binding execution of a VDAF to its application
(concretely, in DAP we would set `ctx` to the task ID), we hope that an
attack on that application does not translate directly to an attack on
another application using the same parameters.

This change is motivated by the possibility of an offline attack against
the robustness of some Prio3 variants. The attack is as follows: fix an
invalid measurement, then search for measurement shares that derive
joint randomness that causes the circuit to accept. Once these shares
are found, they can be used to corrupt any batch that uses the same
Prio3 parameters.

To reduce the blast radius of this attack, we can bind `ctx` to the
joint randomness derivation, thereby ensuring the offline work done by
the attacker is only useful to break a single application.

This change is slightly more general: wherever we compute a domain
separation tag in either Prio3 or Poplar1, we append `ctx`. This is a
more invasive than necessary, but it's also more conservative.

Finally, we modify XofTurboShake128 and XofFixedKeyAes128 by changing
the length prefix for the domain separation tag from a single byte to
two bytes, thereby accommodating larger application context strings.
@cjpatton cjpatton force-pushed the cjpatton/draft-12/context-string branch from faa2520 to fd87fac Compare September 27, 2024 22:30
@cjpatton cjpatton merged commit 17e90c9 into main Sep 27, 2024
6 checks passed
@divergentdave divergentdave deleted the cjpatton/draft-12/context-string branch September 30, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants