public bool Verify(PuzzleSolution solution)
 {
     if (solution == null)
     {
         throw new ArgumentNullException(nameof(solution));
     }
     return(_RsaPubKey.Encrypt(solution._Value).Equals(PuzzleValue._Value));
 }
Exemple #2
0
        public override bool Equals(object obj)
        {
            PuzzleSolution item = obj as PuzzleSolution;

            if (item == null)
            {
                return(false);
            }
            return(_Value.Equals(item._Value));
        }
Exemple #3
0
 public void WritePuzzleSolution(PuzzleSolution index)
 {
     WriteBigInteger(index._Value, KeySize);
 }
Exemple #4
0
 public Puzzle GeneratePuzzle(ref PuzzleSolution solution)
 {
     solution = solution ?? new PuzzleSolution(Utils.GenerateEncryptableInteger(_Key));
     return(new Puzzle(this, new PuzzleValue(Encrypt(solution._Value))));
 }