RS.CLIPPY.INTEGER_DIVISION_REMAINDER_USED

Use of disallowed default division and remainder operations

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: integer_division_remainder_used. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for the usage of division (/) and remainder (%) operations when performed on any integer types using the default Div and Rem trait implementations.

Why restrict this?

In cryptographic contexts, division can result in timing sidechannel vulnerabilities, and needs to be replaced with constant-time code instead (e.g. Barrett reduction).

Example

let my_div = 10 / 2;

Use instead:

let my_div = 10 >> 1;