Uh oh!
There was an error while loading. Please reload this page.
Add Wycheproof tests and utilities - #84
Conversation
If WYCHEPROOF_DIR environment variable is set, will attempt to find a Wycheproof repo there. If not, the `build.rs` script will clone the Wycheproof repo under OUT_DIR.
| aes = "*" | ||
| aes-gcm = "*" | ||
| aes-siv = "*" | ||
| cmac = "*" | ||
| chacha20poly1305 = "*" | ||
| digest = "*" | ||
| ed25519-dalek = "*" | ||
| elliptic-curve = "*" | ||
| generic-array = "*" | ||
| hex = "*" | ||
| hkdf = "*" | ||
| hmac = "*" | ||
| p256 = { version = "*", features = ["ecdsa"] } | ||
| serde_json = "*" | ||
| sha-1 = "*" | ||
| sha2 = "*" | ||
| signature = "*" |
There was a problem hiding this comment.
Instead of putting these here, what if we published a wycheproof crate which could set up these sorts of tests in the individual repositories / CI flows for each of these crates?
339b58d to
cb132f4Comparedaviddrysdale
commented
Oct 22, 2020
Still work in progress, but I wanted to trigger the workflows and also ask:
|
cb132f4 to
235855bCompare235855b to
8c7e57cCompare
I'd suggest publishing a The main way we do cross-crate tests today is via a Here's an example: https://github.com/RustCrypto/block-ciphers/blob/master/aes/tests/lib.rs You could either pull the |
newpavlov
commented
Oct 22, 2020
I think |
@newpavlov there's some information in the Wycheproof vector files which is absent from the |
@tarcieri |
tarcieri
commented
Oct 22, 2020
@newpavlov I guess if it could spit out a way to extract the failure using e.g. |
tarcieri
commented
Oct 23, 2020
@newpavlov what if The problem with the I'd really rather get the Wycheproof error message in these cases. They've done a really good job of documenting their test cases and what they represent and the failures actually mean. |
newpavlov
commented
Oct 29, 2020
We could add wycheproof-specific macros, which would contain an additional description field, but I don't think the UX improvement worth additional complexity and increased crate sizes (don't forget that crates are downloaded together with tests). Ideally we rarely will need these descriptions. |
tarcieri
commented
Oct 29, 2020
I was suggesting something more like how you've reorganized the criterion-based benchmarks, where we could have a It actually wouldn't be too far off from how this PR is currently structured, except by being in the same repo they'd get run for every PR. |
newpavlov
commented
Oct 29, 2020
I think it's worth to keep Wycheproof tests as part of tested crates. Not only will it keep CI setups simple, but also it will allow to catch possible regressions in third-party setups (e.g. during |
tarcieri
commented
Oct 29, 2020
As long as there's some easy way to get the name of the failing test case, I'm okay with it |
daviddrysdale
commented
Feb 16, 2021
(Trying to get back to this, sorry for the delay.) So would this be best reworked as a command-line tool that reads in Wycheproof data and emits Something like: % w2blb --wycheproof_dir=/usr/src/wycheproof --algorithm=AES-SIV-CMAC --out=data/aes-siv.blb --txt=data/aes-siv.txt
% head -7 data/aes-siv.txt[0] = 'AES-SIV-CMAC case 296 [valid] empty message'[1] = 'AES-SIV-CMAC case 297 [valid] empty message'[2] = 'AES-SIV-CMAC case 298 [valid] empty message'[3] = 'AES-SIV-CMAC case 299 [valid] empty message'[4] = 'AES-SIV-CMAC case 300 [valid] empty message'[5] = 'AES-SIV-CMAC case 301 [valid] empty message'[6] = 'AES-SIV-CMAC case 302 [valid] message size divisible by block size'If that is the preferred approach, are there any helpers for writing |
newpavlov
commented
Feb 16, 2021
@daviddrysdale
Yes, see Each line (including empty-ones) will be converted to an entry in a generated |
daviddrysdale
commented
Feb 19, 2021
Started a separate PR over at #280 |
daviddrysdale
commented
Mar 1, 2021
Now covered by #280 and various other PRs. |
If WYCHEPROOF_DIR environment variable is set, will attempt to find
a Wycheproof repo there.
If not, the
build.rsscript will clone the Wycheproof repo underOUT_DIR.