public Puzzle Unblind(BlindFactor blind)
 {
     if (blind == null)
     {
         throw new ArgumentNullException(nameof(blind));
     }
     return(new Puzzle(_RsaPubKey, new PuzzleValue(RsaPubKey.RevertBlind(PuzzleValue._Value, blind))));
 }
Beispiel #2
0
 internal BigInteger Blind(BigInteger data, ref BlindFactor blindFactor)
 {
     if (data == null)
     {
         throw new ArgumentNullException(nameof(data));
     }
     EnsureInitializeBlindFactor(ref blindFactor);
     return(Blind(blindFactor._Value.ModPow(_Key.Exponent, _Key.Modulus), data));
 }
Beispiel #3
0
 public PuzzleSolution Unblind(RsaPubKey rsaPubKey, BlindFactor blind)
 {
     if (rsaPubKey == null)
     {
         throw new ArgumentNullException(nameof(rsaPubKey));
     }
     if (blind == null)
     {
         throw new ArgumentNullException(nameof(blind));
     }
     return(new PuzzleSolution(rsaPubKey.Unblind(_Value, blind)));
 }
Beispiel #4
0
 internal BigInteger Unblind(BigInteger data, BlindFactor blindFactor)
 {
     if (data == null)
     {
         throw new ArgumentNullException(nameof(data));
     }
     if (blindFactor == null)
     {
         throw new ArgumentNullException(nameof(blindFactor));
     }
     EnsureInitializeBlindFactor(ref blindFactor);
     return(Blind(blindFactor._Value.ModInverse(_Key.Modulus), data));
 }
 public Puzzle Blind(ref BlindFactor blind)
 {
     return(new Puzzle(_RsaPubKey, new PuzzleValue(_RsaPubKey.Blind(PuzzleValue._Value, ref blind))));
 }
Beispiel #6
0
 public void WriteBlindFactor(BlindFactor b)
 {
     WriteBigInteger(b._Value, KeySize);
 }
Beispiel #7
0
 private void EnsureInitializeBlindFactor(ref BlindFactor blindFactor)
 {
     blindFactor = blindFactor ?? new BlindFactor(Utils.GenerateEncryptableInteger(_Key));
 }