WebAssembly / wasi-crypto

WASI Cryptography API Proposal
164 stars 25 forks source link

Adding integration test suite #87

Open stevedoyle opened 1 year ago

stevedoyle commented 1 year ago

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.

jedisct1 commented 1 year ago

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: