The vulnerability is a timing side-channel issue in the cmov crate, specifically in the portable implementation of the Cmov trait. The root cause lies in the bitnz! macro, which, prior to the patch, did not use core::hint::black_box internally. This allowed the Rust compiler, particularly for the thumbv6m-none-eabi target, to optimize what should have been a constant-time conditional move into a branching instruction (bne). This introduces a data-dependent timing difference that could be exploited.
The patch rectifies this by incorporating black_box within the bitnz! macro, which prevents the compiler from performing this optimization and preserves the constant-time nature of the operation.
The functions Cmov::cmovnz and Cmov::cmovz are directly vulnerable as they utilize the bitnz! macro for creating a mask for the conditional move. The functions CmovEq::cmovne and CmovEq::cmoveq are also affected because they are part of the API that relies on the vulnerable cmovnz function.
While the provided patch specifically shows changes for the u64 implementation, the vulnerability description and Proof of Concept indicate that other integer types like u8 are also affected. Given the generic nature of the bitnz! macro, it's highly probable that implementations for other integer types (u16, u32, u128, usize) using this portable implementation are also vulnerable.