public static async ValueTask <Stream?> Encrypt(Stream data) { using Stream encrypted = await AesEncryptionProvider.EncryptAsync(data); Stream result = SaveFileHandler.PrependMagicToEncrypted(encrypted); result.Seek(0, SeekOrigin.Begin); return(result); }
private static async ValueTask <Stream?> Encrypt(Stream data) { await using Stream encrypted = await AesEncryptionProvider.EncryptAsync(data); return(SaveFileHandler.PrependMagicToEncrypted(encrypted)); }