-
Notifications
You must be signed in to change notification settings - Fork 25
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
Is wasi-crypto deterministic? #30
Comments
Hi Dan, The wasi-crypto API doesn't allow applications to use a specific random number source. Creating a key requires an algorithm identifier and optional parameters, but these intentionally don't include a seed or some RNG handle, for a couple reasons.
RNGs used for e.g. Monte Carlo simulation need different properties than RNGs needed for cryptography. PCG, Xoroshiro, etc. are perfect algorithms for running simulations. But they should probably be part of an API that is distinct from wasi-crypto. |
So, the wasi-crypto APIs cannot be deterministic, if only because key management can be delegated to HSMs. But the |
I did a review of random APIs a few years ago, but sadly never got around to writing something up. A few notes:
IMHO, I don't believe Xoroshiro provides the best set of trade-offs. Probably some vectorized version of PCG. |
Since wasi-crypto stores things like private keys outside of the normal program state, is the entropy used for things like private keys fully encapsulated? And if so, does this mean that the wasi-crypto API is deterministic, aside from the set of supported algorithms in an implementation?
This would be an interesting property for users wanting fully deterministic execution.
To be sure, WASI will likely still want to have raw entropy-source APIs, but it would help users that want deterministic execution if they could disable it while letting users do crypto through wasi-crypto.
The text was updated successfully, but these errors were encountered: