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

Add more crypto provider flexibility #425

Open
bifurcation opened this issue May 23, 2024 · 1 comment
Open

Add more crypto provider flexibility #425

bifurcation opened this issue May 23, 2024 · 1 comment

Comments

@bifurcation
Copy link
Contributor

Right now, we support three different crypto providers: OpenSSL 1.1, OpenSSL 3, and BoringSSL. These providers have largely the same API, so we have a slightly hairy mess of #ifdefs to account for the differences. If we were to try to add support for CryptoKit, X-CUBE-CRYPTOLIB or liboqs, we would need things to look substantially different.

We should consider introducing a stronger interface/implementation separation, and segregating the implementation code according to the underlying crypto provider.

Prior art in mls-rs:

  • https://docs.rs/mls-rs/latest/mls_rs/trait.CryptoProvider.html
  • https://docs.rs/mls-rs/latest/mls_rs/trait.CipherSuiteProvider.html

Overall concept:

  • lib/hpke/src has files for some set of providers
  • Non-goal to allow runtime addition of new providers
  • Each instance of MLSpp is built for a single, specific provider
  • Consumer selects provider with CMake flags
@bifurcation
Copy link
Contributor Author

I note that the approach in #424 effectively uses runtime dependency injection, so maybe it's not a bad idea to support runtime provider selection.

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

No branches or pull requests

1 participant