public PuzzleSolution Solve(RsaKey key)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     return(PuzzleValue.Solve(key));
 }
Beispiel #2
0
        public PuzzleSolution SolvePuzzle(PuzzleValue puzzle)
        {
            if (puzzle == null)
            {
                throw new ArgumentNullException(nameof(puzzle));
            }

            return(new PuzzleSolution(Decrypt(puzzle._Value)));
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            PuzzleValue item = obj as PuzzleValue;

            if (item == null)
            {
                return(false);
            }
            return(_Value.Equals(item._Value));
        }
 public Puzzle(RsaPubKey rsaPubKey, PuzzleValue puzzleValue)
 {
     if (rsaPubKey == null)
     {
         throw new ArgumentNullException(nameof(rsaPubKey));
     }
     if (puzzleValue == null)
     {
         throw new ArgumentNullException(nameof(puzzleValue));
     }
     _RsaPubKey   = rsaPubKey;
     _PuzzleValue = puzzleValue;
 }
Beispiel #5
0
 public void WritePuzzle(PuzzleValue puzzle)
 {
     WriteBigInteger(puzzle._Value, KeySize);
 }
Beispiel #6
0
 public Puzzle(RsaPubKey rsaPubKey, PuzzleValue puzzleValue)
 {
     _RsaPubKey   = rsaPubKey ?? throw new ArgumentNullException(nameof(rsaPubKey));
     _PuzzleValue = puzzleValue ?? throw new ArgumentNullException(nameof(puzzleValue));
 }