Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
Previously, the test vectors were encoded into the python test scripts, converted to base64, and send over to the device under test via stdio. The application sent back the output after converting it to base64 first, which was read back in by the test script and decoded. Finally, the test script compared the result with the expected result.
This made the test complex, slow and, flanky, as stdio on interfaces such as UART has a high bit error rate and some quirks (e.g. the EDBG UART bridge e.g. in the samr21-xpro dropping bytes when bursts of more than 64 bytes at a time are send).
This basically rewrites the test to embed the test vectors in the firmware and do the comparison on the devices. This fixes test failures on the samr21-xpro, the nRF52840-DK and likely many others. Also, it is now fast.
Beware: This sneaks in a non-API-change-API-change: The password and salt is now passed as
const void *
rather than asconst uint8_t *
, as having to cast c-strings toconst uint8_t *
is a needles pain in the ass.Testing procedure
should pass. Changing one bit in the expected digest in one of the test vectors should result in the test to no longer pass.
Issues/PRs references
None