using System; using System.Threading.Tasks; using Bit.Core.Enums; namespace Bit.Core.Abstractions { public interface ICryptoFunctionService { Task Pbkdf2Async(string password, string salt, CryptoHashAlgorithm algorithm, int iterations); Task Pbkdf2Async(byte[] password, string salt, CryptoHashAlgorithm algorithm, int iterations); Task Pbkdf2Async(string password, byte[] salt, CryptoHashAlgorithm algorithm, int iterations); Task Pbkdf2Async(byte[] password, byte[] salt, CryptoHashAlgorithm algorithm, int iterations); Task Argon2Async(string password, string salt, int iterations, int memory, int parallelism); Task Argon2Async(byte[] password, string salt, int iterations, int memory, int parallelism); Task Argon2Async(string password, byte[] salt, int iterations, int memory, int parallelism); Task Argon2Async(byte[] password, byte[] salt, int iterations, int memory, int parallelism); Task HkdfAsync(byte[] ikm, string salt, string info, int outputByteSize, HkdfAlgorithm algorithm); Task HkdfAsync(byte[] ikm, byte[] salt, string info, int outputByteSize, HkdfAlgorithm algorithm); Task HkdfAsync(byte[] ikm, string salt, byte[] info, int outputByteSize, HkdfAlgorithm algorithm); Task HkdfAsync(byte[] ikm, byte[] salt, byte[] info, int outputByteSize, HkdfAlgorithm algorithm); Task HkdfExpandAsync(byte[] prk, string info, int outputByteSize, HkdfAlgorithm algorithm); Task HkdfExpandAsync(byte[] prk, byte[] info, int outputByteSize, HkdfAlgorithm algorithm); Task HashAsync(string value, CryptoHashAlgorithm algorithm); Task HashAsync(byte[] value, CryptoHashAlgorithm algorithm); Task HmacAsync(byte[] value, byte[] key, CryptoHashAlgorithm algorithm); Task CompareAsync(byte[] a, byte[] b); Task AesEncryptAsync(byte[] data, byte[] iv, byte[] key); Task AesDecryptAsync(byte[] data, byte[] iv, byte[] key); Task RsaEncryptAsync(byte[] data, byte[] publicKey, CryptoHashAlgorithm algorithm); Task RsaDecryptAsync(byte[] data, byte[] privateKey, CryptoHashAlgorithm algorithm); Task RsaExtractPublicKeyAsync(byte[] privateKey); Task> RsaGenerateKeyPairAsync(int length); Task RandomBytesAsync(int length); byte[] RandomBytes(int length); Task RandomNumberAsync(); uint RandomNumber(); } }