예제 #1
0
 public static byte[] Mult(byte[] secretKey, byte[] publicKey)
 {
     if (secretKey == null || secretKey.Length != 32)
     {
         throw new KeyOutOfRangeException("secretKey", (secretKey == null) ? 0 : secretKey.Length, string.Format("secretKey must be {0} bytes in length.", 32));
     }
     if (publicKey == null || publicKey.Length != 32)
     {
         throw new KeyOutOfRangeException("publicKey", (publicKey == null) ? 0 : publicKey.Length, string.Format("publicKey must be {0} bytes in length.", 32));
     }
     byte[] array = new byte[32];
     SodiumLibrary.crypto_scalarmult(array, secretKey, publicKey);
     return(array);
 }