mirror of
https://github.com/shadowsocks/shadowsocks-crypto.git
synced 2026-10-28 10:45:01 +08:00
Swap the optional `ring`/`ring-compat` dependency for `aws-lc-rs`, which wraps the actively maintained AWS-LC C library and delivers comparable (or better) AEAD/HKDF throughput without pulling in `ring`. The cargo feature is renamed from `ring` to `faster-crypto` so downstream users express intent (a faster crypto backend) rather than the specific implementation. Platforms not covered by aws-lc-rs (e.g. WASM, exotic targets) must leave the feature off and fall back to the pure-Rust path. The AEAD code under the feature gate now calls aws-lc-rs natively via `LessSafeKey` / `UnboundKey` / `Nonce` / `Aad` / `seal_in_place_separate_tag` / `open_in_place`. The HKDF-SHA1 path switches from `ring_compat::ring::hkdf` to `aws_lc_rs::hkdf`, which exposes the same `Salt` / `Prk` / `Okm` / `KeyType` surface, so that block is a near-verbatim import swap. The pure-Rust `else` branches are untouched apart from moving the struct + impl blocks inside the `cfg_if!` so each backend is self-contained. MSRV is bumped from 1.63 to 1.71 to match aws-lc-rs 1.16. The Windows CI job also needs NASM preinstalled because aws-lc-sys assembles its x86_64 kernels with it; the clippy job already did this, so the build and test job gets the same `ilammy/setup-nasm@v1` step.