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

Prevent keys with length >= 256 #61

Closed
mappum opened this issue Sep 4, 2021 · 0 comments · Fixed by #90
Closed

Prevent keys with length >= 256 #61

mappum opened this issue Sep 4, 2021 · 0 comments · Fixed by #90
Assignees

Comments

@mappum
Copy link
Contributor

mappum commented Sep 4, 2021

Merk does not support keys of 256 bytes or more, but this fails at the write step which means if an application tried to produce an oversized key then e.g. a whole block would fail. This should fail sooner by e.g. checking at the Store::put step, but ideally could be checked statically by keeping track of prefix lengths with e.g. a Key type (#8) (likely based on a fixed-size array rather than a Vec<u8>) with const generics, and maybe const generics for known min/max lengths of ed encodings (this change would maybe happen directly in the Encode and Decode traits).

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 a pull request may close this issue.

1 participant