test: cover ECDH deriveBits length boundaries - #249
harrshita123 wants to merge 3 commits into
Conversation
|
Please rebase, I think CI mostly works on master branch now. |
I have rebased the branch onto the latest master so the CI tests can run properly. |
3797510 to
0c84b6e
Compare
|
I updated the branch based on the feedback:
I also cleaned up the branch history into a single commit and verified it locally with dart format, dart analyze, and dart test test/webcrypto_test.dart -p vm. |
HamdaanAliQuatil
left a comment
There was a problem hiding this comment.
these tests are still useful even though #130 was closed by #289. the generated cases added there don’t actually hit the documented limits: maxDeriveLength is a bit count, but those calls pass 32/48/66, and the random range excludes its upper bound.
could we correct those calls here by setting both minDeriveLength and maxDeriveLength to 256/384/528 respectively?
since #130 is already closed, I’d also reframe this as a follow-up to #289, replace Fixes #130, and perhaps rename the PR to test: cover ECDH deriveBits length boundaries.
ffb25b7 to
509717b
Compare
| maxDeriveLength: 66, | ||
| minDeriveLength: 528, | ||
| maxDeriveLength: 528, | ||
| ); |
There was a problem hiding this comment.
I think these runner.generate things spit out JSON that we put into _testData.
Feel free to make a follow up PR, where we generate a bunch of these with the configurations you put in here. I've usually generated in chrome/firefox/boringssl, but just have one or two of those configurations could be useful.
Mostly those _testData entries serves as sanity tests and pins behavior.
There was a problem hiding this comment.
Thanks for clarifying how runner.generate is intended to be used. I’ll keep that work separate from this PR and add a focused follow-up with generated maximum-length vectors. P-521 already has 528-bit vectors, so the follow-up will add the missing 256-bit P-256 and 384-bit P-384 BoringSSL cases.
Follow-up to #289.
This change adds explicit ECDH
deriveBitsboundary coverage for each supported curve:The tested limits are 256 bits for P-256, 384 bits for P-384, and 528 bits for P-521.