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