Documentation

QedShare.Field.Inv

Multiplicative inverse #

The nonzero elements of GF(2⁸) form a group of order 255, so a²⁵⁵ = 1 and a⁻¹ = a²⁵⁴ for a ≠ 0. We compute a²⁵⁴ with a fixed chain of squarings and multiplications (254 = 2 + 4 + 8 + 16 + 32 + 64 + 128), so the sequence of operations never depends on a.

In qedshare, inv is only applied to public share indices (README: Threat model), but being constant-time costs nothing here. By this definition inv 0 = 0.

Multiplicative inverse: a²⁵⁴, which is a⁻¹ for a ≠ 0 (and 0 for a = 0). Uses 7 squarings and 6 multiplications in a fixed order.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]

    Division: a / b = a * b⁻¹.

    Equations
    theorem QedShare.GF256.mul_inv (a : GF256) (h : a ≠ 0) :
    a * a.inv = 1

    Every nonzero element times its inverse is one.

    The inverse of zero is zero (a convention; it is never used on zero).