WebAssembly / wasi-crypto

WASI Cryptography API Proposal
162 stars 25 forks source link

Test suite #44

Open jedisct1 opened 2 years ago

jedisct1 commented 2 years ago

We need a test suite.

The Rust and AssemblyScript host and guest implementations have a couple tests, but this is neither extensive, nor useful to ensure interoperability between implementations.

The language doesn't matter; all we need is a .wasm file that should produce the same output across runtimes.

@sonder-joker is it something you'd like to collaborate on?

sonder-joker commented 2 years ago

Ok. In fact, I have already create some simple tests refer to rfc. I will work on it.

stevedoyle commented 1 year ago

@jedisct1 I've submitted a PR#87 to get feedback on an approach for a test suite.

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, I created some Rust "integration tests" using these vectors to test some of the symmetric crypto algorithms (AES-128-GCM, AES-256, CHACHA20-POLY1305, HMAC/SHA-256, HMAC/SHA-512 and HKDF with SHA-256 and SHA-2512).

Please take a look and let me know if this is the right direction to take or if there are issues with it. If the direction is OK, I'll expand the PR to inlcude tests for more algorithms.