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

Reverse fingerprint order #2405

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Reverse fingerprint order #2405

merged 3 commits into from
Jan 29, 2025

Conversation

georgwiese
Copy link
Collaborator

This PR changes the fingerprint of a tuple $(x_1, ..., x_n)$:
from
$\sum_{i=1}^n \alpha^{(n - i)} x_i$
to
$\sum_{i=1}^n \alpha^{(i - 1)} x_i$

The difference is that previously, you could pad any number of zeros to the left and get the same fingerprint. Now, you can pad any number of zeros to the right, which I find more intuitive.

This also fixes a potential soundness bug: In practice, we always use fingerprint_with_id, which prepends the bus ID to the payload, e.g. (<BUS_ID_FOO>, a, b, c) & (<BUS_ID_BAR>, a, b). But fingerprint((<BUS_ID_BAR>, a, b)) == fingerprint((0, <BUS_ID_BAR>, a, b)), so if BUS_ID_FOO is 0, the receiver could be ambiguous.

This is fixed now, because every bus interaction will at least fingerprint the bus ID, which is always the first element.

@georgwiese georgwiese marked this pull request as ready for review January 29, 2025 02:33
@georgwiese georgwiese added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit 526b51d Jan 29, 2025
16 checks passed
@georgwiese georgwiese deleted the reverse-fingerprint-order branch January 29, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants