Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/hmac-only-jwt-shrink-binaries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
livekit-api: patch
---

# Shrink binaries with an HMAC-only JWT crypto provider

`livekit-api` now installs a minimal in-crate HMAC `CryptoProvider`
(HS256/384/512) instead of jsonwebtoken's `rust_crypto` backend, dropping the
unused RSA/EC/EdDSA algorithms. LiveKit access tokens are HS256, so there is no
public API or behavior change. This trims ~200 KiB of unreachable crypto code,
shrinking the shipped binaries ~25–29% — the `RustLiveKitUniFFI` iOS framework
drops from ~900 KiB to ~672 KiB (arm64) and the Android arm64-v8a `.so` from
~1.13 MiB to ~816 KiB. `livekit-ffi` and `livekit` benefit too.
15 changes: 6 additions & 9 deletions .github/workflows/uniffi-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- name: Install Apple Rust targets (tier 1/2)
- name: Install Apple Rust targets
run: |
rustup target add \
aarch64-apple-ios \
Expand All @@ -65,14 +65,11 @@ jobs:
aarch64-apple-ios-macabi \
x86_64-apple-ios-macabi \
aarch64-apple-darwin \
x86_64-apple-darwin

# tvOS + visionOS are still tier 3 (no prebuilt std), so cargo-swift
# builds them via `cargo +nightly -Zbuild-std`. Toolchain + rust-src
# need to exist ahead of time.
- name: Install nightly + rust-src (tvOS/visionOS tier-3 targets)
run: |
rustup toolchain install nightly --profile minimal --component rust-src
x86_64-apple-darwin \
aarch64-apple-tvos \
aarch64-apple-tvos-sim \
aarch64-apple-visionos \
aarch64-apple-visionos-sim

- uses: cargo-bins/cargo-binstall@aaa84a43aec4955a42c5ffc65d258961e39f276e # v1.19.1
- run: cargo binstall cargo-make --no-confirm
Expand Down
Loading
Loading