Exemple #1
0
        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));
        }
Exemple #2
0
 public void Add(Digram digram)
 {
     this.digram[0] += digram[0];
     this.digram[1] += digram[1];
 }
Exemple #3
0
 public HillKey(Matrix2 matrix, Digram digram)
 {
     Matrix = matrix;
     Digram = digram;
 }
Exemple #4
0
 public static void Modulo(Digram digram, int n)
 {
     digram[0] = Modulo(digram[0], n);
     digram[1] = Modulo(digram[1], n);
 }