Skip to content

Decoupled crypto backends (the rest) - #428

Merged
Keats merged 50 commits into
Keats:masterfrom
sulami:decoupled-crypto-backends
Sep 29, 2025
Merged

Keats merged 50 commits into
Keats:masterfrom
sulami:decoupled-crypto-backends

Conversation

@sulami

@sulami sulami commented May 11, 2025

Copy link
Copy Markdown
Contributor

This is following up on #410 with the rest of the decoupled implementations, and addressing most of the review comments (I think?).

There are still some todos left for documentation, which I haven't filled in yet.

I've verified that tests & clippy pass with all combinations of features, but a lot of this I only know enough about to be dangerous, so I'd appreciate close looks at the actual implementations to make sure e.g. I've picked the correct library functions in each case.

@sulami
sulami requested a review from Keats August 5, 2025 00:28

@Keats Keats left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

That looks good. One small copy/paste issue but fine otherwise. I need to create a 0.10 branch to group everything

Comment thread src/crypto/rust_crypto/rsa.rs Resolved
@Keats

Keats commented Aug 14, 2025

Copy link
Copy Markdown
Owner

The wasm failure seems legit?

@sulami

sulami commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

Looking at the AWS-LC docs, I don't think it builds/is supported on WASM. I've also recently read this with regards to default features, and I'm thinking maybe we shouldn't have a default backend after all? That way we could also pick a different backend for the WASM build.

@Keats

Keats commented Aug 15, 2025

Copy link
Copy Markdown
Owner

Yeah maybe let's not have a default if the default doesn't work with wasm.

In most situations AWS-LC is the better backend, but it's not available
on all platforms, for example WASM. Explicitly asking the user to pick a
backend is also more future-proof.
@Keats

Keats commented Aug 18, 2025

Copy link
Copy Markdown
Owner

Looks like legit failures as well

@sulami

sulami commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

I don't know if this'll work or not, at least it builds on my machine, but it doesn't pass the WASM tests. Neither does master though, so I'm not sure that counts for much.

I'm not terribly familiar with WASM overall, so I wouldn't mind additional pointers & opinions.

Comment thread Cargo.toml Resolved
Comment thread src/validation.rs Resolved
This is fixing a Clippy complaint.
@sulami
sulami force-pushed the decoupled-crypto-backends branch from 6619f3b to 570d732 Compare August 23, 2025 02:15
@sulami
sulami force-pushed the decoupled-crypto-backends branch from 570d732 to eca3603 Compare August 23, 2025 02:27
@sulami

sulami commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

I've addressed @jplatte's feedback, and I've also run a wasm CI run in my fork to shorten the feedback loop a bit here.

@jplatte jplatte left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looking forward to this landing :)

Comment thread .github/workflows/ci.yml

- name: Run tests default features
run: wasm-pack test --node --features rust_crypto
run: wasm-pack test --node --features rust_crypto,getrandom/js

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

There's a related issue: #431
But I don't know enough about wasm to know what to actually do

@jplatte jplatte Sep 1, 2025 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this PR might actually help with that, given getrandom/js is now only enabled in CI. Users may be able to enable another wasm-compatible getrandom backend after this lands.

@Keats

Keats commented Sep 1, 2025

Copy link
Copy Markdown
Owner

Any other breaking change we want to add? I know i'm not happy about EncodingKey/DecodingKey in general but I don't have a better idea right now.

@Keats

Keats commented Sep 2, 2025

Copy link
Copy Markdown
Owner

Any ideas why the jobs are stuck?

Comment thread .github/workflows/ci.yml Outdated
backend: [ aws_lc_rs, rust_crypto ]
include:
- build: pinned
os: ubuntu-20.04

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe ubuntu-20.04 is no longer supported by GHA. Need tp upgrade to 22.04 or 24.04.

Running most of them on the latest version, at the moment 24.04, except
for the test run that's pinned to Rust 1.73, which is pinned to 24.04.
@Keats

Keats commented Sep 6, 2025

Copy link
Copy Markdown
Owner

looks like we need to bump the pinned version in CI as well

Some dependencies are now on the 2024 edition.
@Keats

Keats commented Sep 9, 2025

Copy link
Copy Markdown
Owner

All good! I'll probably release a new version based on this PR this week if I don't forget

@kamulos

kamulos commented Sep 22, 2025

Copy link
Copy Markdown

small reminder :) @Keats

@Keats
Keats merged commit a670368 into Keats:master Sep 29, 2025
@Keats

Keats commented Sep 29, 2025

Copy link
Copy Markdown
Owner

v10 release, close enough in terms of weeks >_>

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.

7 participants