public HillKey GetInverseMod(int n) { Matrix2 inversedMatrix = Matrix.GetInverseMod(n); // New Matrix. Digram inversedDigram = -1 * Digram; // New Digram. inversedDigram.MultiplyBy(inversedMatrix); Ring.Modulo(inversedDigram, n); return(new HillKey(inversedMatrix, inversedDigram)); }
public void Add(Digram digram) { this.digram[0] += digram[0]; this.digram[1] += digram[1]; }
public HillKey(Matrix2 matrix, Digram digram) { Matrix = matrix; Digram = digram; }
public static void Modulo(Digram digram, int n) { digram[0] = Modulo(digram[0], n); digram[1] = Modulo(digram[1], n); }