static modular_multiplicative_inverse(value, modulus) {
        let {x, gcd} = Util.extended_gcd(value, modulus);
        if (gcd !== 1) {
            return undefined;
        }
        x %= modulus;
        if (x < 0) {
            x += modulus;
        }
        return x;
    }
@param {!int} value
@param {!int} modulus
@returns {!int} A value r in [0, modulus) such that r*value = 1 (mod modulus).