public bool Verify(PuzzleSolution solution) { if (solution == null) { throw new ArgumentNullException(nameof(solution)); } return(_RsaPubKey.Encrypt(solution._Value).Equals(PuzzleValue._Value)); }
public override bool Equals(object obj) { PuzzleSolution item = obj as PuzzleSolution; if (item == null) { return(false); } return(_Value.Equals(item._Value)); }
public void WritePuzzleSolution(PuzzleSolution index) { WriteBigInteger(index._Value, KeySize); }
public Puzzle GeneratePuzzle(ref PuzzleSolution solution) { solution = solution ?? new PuzzleSolution(Utils.GenerateEncryptableInteger(_Key)); return(new Puzzle(this, new PuzzleValue(Encrypt(solution._Value)))); }