Esempio n. 1
0
        /// <summary>
        /// Given a user's secret key, the function computes the user's public key.
        /// </summary>
        /// <see cref="https://libsodium.gitbook.io/doc/advanced/scalar_multiplication#usage"/>
        public static byte[] ScalarMultiplicationBase(byte[] SecretKey)
        {
            var PublicKey = new byte[SecretKey.Length];

            var Result = SodiumLibrary.crypto_scalarmult_base(PublicKey, SecretKey);

            return(Result == 0 ? PublicKey : throw new CryptographicException());
        }