Skip to main content

inv

Function inv 

Source
pub const fn inv(x: u8) -> u8
Expand description

Multiplicative inverse in GF(2^8), with inv(0) == 0.

Computed as x^254 via the square-and-multiply chain for 0b1111_1110, which is 7 squarings and 6 multiplications, all constant-time. The squarings go through square rather than the general multiply.