SharpTox.Encryption.ToxEncryptionFunctions.DeriveKeyWithSalt C# (CSharp) Method

DeriveKeyWithSalt() private method

private DeriveKeyWithSalt ( byte passphrase, uint passphraseLength, byte salt, ToxPassKey &outputKey, ToxErrorKeyDerivation &error ) : bool
passphrase byte
passphraseLength uint
salt byte
outputKey ToxPassKey
error ToxErrorKeyDerivation
return bool
        internal static extern bool DeriveKeyWithSalt(byte[] passphrase, uint passphraseLength, byte[] salt, ref ToxPassKey outputKey, ref ToxErrorKeyDerivation error);

Usage Example

Example #1
0
        internal static ToxPassKey? DeriveKey(string passphrase, byte[] salt)
        {
            if (salt.Length < SaltLength)
                return null;

            byte[] pp = Encoding.UTF8.GetBytes(passphrase);
            var error = ToxErrorKeyDerivation.Ok;
            var key = new ToxPassKey();

            if (!ToxEncryptionFunctions.DeriveKeyWithSalt(pp, (uint)pp.Length, salt, ref key, ref error) || error != ToxErrorKeyDerivation.Ok)
                return null;

            return key;
        }
All Usage Examples Of SharpTox.Encryption.ToxEncryptionFunctions::DeriveKeyWithSalt