You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor unsafe blocks for Rust 1.87 PCLMUL stabilization
This commit addresses the stabilization of PCLMUL intrinsics in Rust 1.87.0.
Changes:
- Removed `#[allow(unused_unsafe)]` from `cryprot-core/src/block/gf128.rs` as it's no longer needed.
- Removed the `unsafe` block from the body of the `clmul128` function. The function itself remains `unsafe fn` but its internal calls to `pclmulqdq` intrinsics are now considered safe within its `#[target_feature(enable = "pclmulqdq")]` context.
- The `unsafe` block within `gf128_mul` remains, as it's required for calling other `unsafe fn`s (`clmul128` and `gf128_reduce`) to comply with `unsafe_op_in_unsafe_fn` linting/rules, especially under Rust Edition 2024.
- The `unsafe` block in `gf128_reduce` remains due to necessary pointer casting for `_mm_loadu_si64`.
These changes make the code more idiomatic for Rust 1.87+ while maintaining correctness.
0 commit comments