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

Change the hash_xof::compute_from_kv() to avoid Lenght extension attacks #4185

Closed
Leo-Besancon opened this issue Jun 30, 2023 · 1 comment
Closed

Comments

@Leo-Besancon
Copy link
Collaborator

Initially proposed by @damip.
Currently, the hash of a (key,value) entry of the DB is computed as such:

hash( (len(key) as u64) | key | value )

Instead, we could compute it using the following:

hash( (len(key) as u64).to_be_bytes() | key | (len(value) as u64) .to_be_bytes() | value )
@AurelienFT
Copy link
Contributor

Done in #4188

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

No branches or pull requests

2 participants