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

Constant-Time fuzzing results #27

Closed
phayes opened this issue Jan 15, 2020 · 3 comments
Closed

Constant-Time fuzzing results #27

phayes opened this issue Jan 15, 2020 · 3 comments

Comments

@phayes
Copy link
Contributor

phayes commented Jan 15, 2020

I built a bunch of constant-time fuzzing targets for blake3 using sidefuzz

The fuzzing targets can be found here: http://github.com/phayes/sidefuzz-targets

Results are as follows:

  • hash (input): constant time ✔️
  • keyed_hash (input): constant time ✔️
  • keyed_hash (key): constant time ✔️
  • keyed_hash (key): constant time ✔️
  • reference_impl_hash (input): constant time ✔️
  • keyed_hash (key_material): constant time ✔️
  • keyed_hash (context): fuzzing-failed

So everything looks good except that I couldn't properly fuzz keyed_hash in relation to the context since it takes a string, and sidefuzz produces &[u8]s as it's fuzzing inputs.

So to fuzz keyed_hash in relation to context we would either need to resolve #13 or I would need to improve sidefuzz to have a function that provides a string.

@oconnor663
Copy link
Member

Glad to hear we didn't do anything catastrophically wrong :-D

I wonder if you could work around the string issue by just converting the fuzz input to a hexadecimal string, and using that as the context? Or maybe masking off the high bit of each byte to make it valid ASCII, and then converting with std::str::from_utf8? I suppose the fully correct thing to do would be to generate a series of randomly chosen valid Unicode code points, but maybe that's more complicated than it really needs to be.

@phayes
Copy link
Contributor Author

phayes commented Jan 15, 2020

@oconnor663 - I'll work on adding string support to SideFuzz - that should solve the issue.

Being able to fuzz string inputs is something sidefuzz should have anyways, so this is fine. I'll update this ticket when it's done and I have results.

@oconnor663
Copy link
Member

Going to close this one for now, but please do comment again if you get new results.

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