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

ed25519: Add wycheproofs #640

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

pinkforest
Copy link
Contributor

@pinkforest pinkforest commented Mar 8, 2024

  • Generate wycheproof driven static tests
  • Machine generated wycheproof test cases for ed25519-dalek sorted by tc#
  • If any wycheproof is added / modified / deleted this can be seen via diff easily readable via PR
  • Tests reflect actual Rust code for actual test without worrying too much test case didn't get generated / correctly
  • Comments from wycheproofs relayed to comments for quick reference & clarity

Problem by dynamically adding tests at runtime is these can be missed silently if the dyn generation fails - google doesn't add / modify / remove them much in any case so can just re-generate & check em in when needed 🤷‍♀️

wycheproofs-ed25519-dalek is excluded from workspace --all-features so it doesn't barf with the ed25519-dalek/legacy_compatibility -

It still gets tested by default features OK via workspace

Notes

Testing whole workspace with --all-features enables every feature from ed25519-dalek dependency despite wycheproofs-ed25519-dalek not explicitly including it due to how the resolver works within workspace.

Namedly ed25519-dalek/legacy_compatibility causes barf at wycheproof expanded generated.rs tc 63 and 85 fails

repro @ 4af5275
workspace_root $ cargo test --target x86_64-unknown-linux-gnu --features legacy_compatibility

So tests worked I guess :]

Follow-Ups

I will also send another PR to turn the VALIDATION_CRITERIA into static tests directly from C2SP/CCTV/ed25519/vectors.json and some sort of checksumming / commit following thing perhaps to follow modulo easily

[package]
name = "generate-wycheproofs"
version = "0.1.0"
edition = "2021"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding publish = false may help because the crate looks primarily for testing and not meant to be used by other people.

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