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

Adding integration test suite #87

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevedoyle
Copy link
Contributor

This is a WIP PR to get feedback on an approach to add a test suite for wasi-crypto (issue#44).

It is based on using the wycheproof test vecors to test wasi-crypto implementations for the algorithm set that is covered by the wycheproof test vectors. To get some initial feedback, Rust "integration tests" have been added for AES-128-GCM, AES-256, CHACHA20-POLY1305, HMAC/SHA-256, HMAC/SHA-512 and HKDF with SHA-256 and SHA-2512.

To run the tests:
cargo wasi test --test test_symmetric

These have been tested with WasmEdge.

Using [wycheproof test vecors](https://github.com/google/wycheproof) to test
wasi-crypto implementations.
@stevedoyle stevedoyle mentioned this pull request Mar 24, 2023
@stevedoyle stevedoyle marked this pull request as draft March 24, 2023 23:26
@jedisct1
Copy link
Member

jedisct1 commented Apr 1, 2023

Hi Steve!

And sorry for the delay, I'm still in Tokyo for HACS.

Running the Wycheproof test vectors is good.

However this is testing the underlying crypto libraries (which should hopefully already include these vectors in their own test suite), not the wasi-crypto API.

We need tests specific to the API to check for interoperability between runtimes, even if they use the same crypto library under the hood.

For example:

  • Passing invalid handles
  • Not setting a nonce for an AEAD that requires one
  • Invalid keys, invalid encodings
  • Closing handles twice
  • Invalid operation sequences
  • Invalid algorithm names, or names from one category of algorithmes used with a function for a different category
  • ...

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