| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This needs quite a bit of cleanup but let's have some tests rather than
none.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The hex decoding is only done from the JSON files provided by the
wycheproof-testvectors package. Failure is always fatal. So there
is no need for repeated error checks, and we can use an ergonomic
wrapper.
Also rework the calculation of the message digest from input data
this had a similar deficit.
All in all this shaves off about 10% of the code and removes a lot
of tedious repetition.
|
| |
|
| |
|
|
|
|
| |
This simplifies and unifies a lot of error messages.
|
|
|
|
|
|
|
|
| |
The determination of the test group type and the JSON unmarshalling can be
done before the closure without performance impact. This is more readable
and eliminates the need of a temporary variable again.
Suggested by jsing
|
|
|
|
|
| |
This factors another ugly switch into a helper function. This should
probably become a map eventually, but for now keep things straightforward.
|
|
|
|
|
| |
This allows us to use a simpler way of running the individual test groups
and gets rid of an ugly mostly copy-pasted switch inside a closure.
|
|
|
|
|
| |
These used the wycheproofTestGroupAead type but an upcoming change requires
to change this. Introduce the aliases now to make the next diff cleaner.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to Go's idiosyncratic semantics of for loops, tests would only run
some of the test groups in the JSON file because by the time the closure
is called, the array index could be changed. For example, on fast 8 core
machines, the CMAC tests would run the last test group with key size 320
eight times rather than each of the eight test groups once.
Make a copy of the pointer before passing it to the closure to avoid this
issue.
Simpler version of my initial fix from jsing
|
| |
|
| |
|
|
|
|
|
| |
there is a subtler issue with make regress/make all that will be way more
of a headache to sort !
|
| |
|
|
|
|
|
| |
GF2m curves will go away soon. This reduces the pile of diffs in my jungle
a tiny little bit.
|
| |
|
| |
|
|
|
|
|
| |
This was previously disabled because tb apparently can't grep. Exercise
this curve as well as part of the new test cases in ECDH wycheproof.
|
|
|
|
|
| |
A copy-paste error would have resulted in a modified msg in case ctLen == 0
or msgLen == 0. So obviously this is unreachable code.
|
|
|
|
| |
This gets us some minimal test coverage.
|
|
|
|
|
|
|
|
|
| |
This avoids having a slow down when processing test vector files that only
have a single group. Note that the processing of test vector files is in
turn going to be rate limited by the number of concurrent test groups,
which means we do not need variable limits for vectors.
Reduces a Wycheproof regress run down to ~8 seconds on an Apple M1.
|
|
|
|
|
|
|
| |
Add a basic test coordinator, that allows for Wycheproof test groups to be
run concurrently. This can be further improved (especially for vectors that
have limited test groups), however it already reduces the regress duration
by about half on an Apple M1.
|
| |
|
|
|
|
|
|
|
| |
This code would need changes to be safe to use concurrently - remove it
since it is somewhat incomplete and needs reworking.
Requested by tb@
|
|
|
|
|
| |
Allows test to pass with the old version of the wycheproof-testvectors
package.
|
| |
|
| |
|
| |
|
|
|
|
| |
Silence is good. On failure, the regress framework will make it clear.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Project Wycheproof's primality_tests.json contain a set of 280 numbers
that trigger edge cases in Miller-Rabin and related checks. libcrypto's
Miller-Rabin test is known to be rather poor, hopefully we will soon see
a diff on tech that improves on this.
This extends the Go test in the usual way and also adds a perl script
that allows testing on non-Go architectures.
Deliberately not yet linked to regress since the tests are flaky with
the current BN_is_prime_ex() implementatation.
|
|
|
|
|
|
|
| |
Gotta love EVP... Instead of a single, obvious call to HKDF(), you now
need to call eight EVP functions with plenty of allocations and pointless
copying internally. If you want to suffer even more, you could consider
using the gorgeous string interface instead.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
packages to appear
|
|
|
|
|
| |
1. Use the correct slice for comparing the cipher output
2. Fix logic error similar to the one in AES-GCM in the previous commit
|