Mono.Math.BigInteger.modPow C# (CSharp) Method

modPow() public method

public modPow ( BigInteger exp, BigInteger n ) : BigInteger
exp BigInteger
n BigInteger
return BigInteger
		public BigInteger modPow (BigInteger exp, BigInteger n)
		{
			ModulusRing mr = new ModulusRing (n);
			return mr.Pow (this, exp);
		}
		

Usage Example

Beispiel #1
0
 public void MakeAESKey(string keyExchangeBytes)
 {
     BigInteger A = new BigInteger(keyExchangeBytes);
     byte[] R = A.modPow(privateKey, Module).getBytes();
     aesKey = new byte[16];
     Array.Copy(R, aesKey, 16);
     for (int i = 0; i < 16; i++)
     {
         byte tmp = (byte)(aesKey[i] >> 4);
         byte tmp2 = (byte)(aesKey[i] & 0xF);
         if (tmp > 9)
             tmp = (byte)(tmp - 9);
         if (tmp2 > 9)
             tmp2 = (byte)(tmp2 - 9);
         aesKey[i] = (byte)( tmp << 4 | tmp2);
     }
 }
All Usage Examples Of Mono.Math.BigInteger::modPow