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

type_id is not sufficiently collision-resistant #774

Open
apiraino opened this issue Aug 22, 2024 · 1 comment
Open

type_id is not sufficiently collision-resistant #774

apiraino opened this issue Aug 22, 2024 · 1 comment

Comments

@apiraino
Copy link
Contributor

Meeting proposal info

  • Title: type_id is not sufficiently collision-resistant
  • Type: technical

Summary

See opening comment in rust#129014:

The soundness of functions like downcast relies on the type_id of two different types never being equal. Currently, the type_id is a 128-bit hash of the full type identity, computed specifically via SipHash-1-3 with an all-zero key. This is not a strong enough hash function for this purpose.

and:

We should do one of the following:

  1. switch to a stronger hash function, or
  2. switch to a different scheme that doesn't rely on collision-resistance of the hash function.

Discussed on Zulip during triage meeting.

About this issue

This issue corresponds to a meeting proposal for the compiler team
steering meeting. It corresponds to a possible topic of
discussion. You can read more about the steering meeting procedure
here
.

Comment policy

These issues are meant to be used as an "announcements channel"
regarding the proposal, and not as a place to discuss the technical
details. Feel free to subscribe to updates. We'll post comments when
reviewing the proposal in meetings or making a scheduling decision.
In the meantime, if you have questions or ideas, ping the proposers
on Zulip (or elsewhere).

@RalfJung
Copy link
Member

Cc rust-lang/rust#129030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants