Skip to content

Create a cryptography library that can change its backend at compile time#91

Draft
Progdrasil wants to merge 10 commits intomainfrom
passkey-crypto
Draft

Create a cryptography library that can change its backend at compile time#91
Progdrasil wants to merge 10 commits intomainfrom
passkey-crypto

Conversation

@Progdrasil
Copy link
Collaborator

This introduces the passkey-crypto crate which houses the new Backend series of traits to allow Authenticator (and others) to call the trait methods rather than the libraries themselves.

This currently is only moving code around and implementing the traits directly on the p256 types, but by the time the MR is ready, I'll have wrapped those types up to make a RustCryptoBackend which can support multiple algorithms.

Resolves #50, #62

Comment on lines +99 to +100
cred_with_uv: Rng::random_vec(32),
cred_without_uv: config.credentials.without_uv().then(|| Rng::random_vec(32)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: What is the distinction between using an RngBackend controlled by the provider (pub fn randomized for example) vs these cases where Rng is used directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None really, I started with using the Rng directly as that was easier to migrate. This PR isn't finished and hopefully the Rng will be fully behind the crypto provider by the end

@Progdrasil Progdrasil linked an issue Jan 20, 2026 that may be closed by this pull request
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.

Create a passkey-crypto library Support more algorithms

2 participants