Skip to content

Conversation

@scott-xu
Copy link
Collaborator

Based on dotnet/runtime#89718, we can use native AesGcm for .NET Framework from Microsoft.Bcl.Cryptography nuget package

@scott-xu scott-xu marked this pull request as ready for review March 23, 2025 11:14
@Rob-Hague
Copy link
Collaborator

LGTM once the package is stable

@scott-xu scott-xu force-pushed the aesgcm-netframework branch from b93e470 to b9d888b Compare June 14, 2025 11:52
@scott-xu scott-xu marked this pull request as draft June 22, 2025 03:57
@scott-xu scott-xu force-pushed the aesgcm-netframework branch from d49b548 to c43bdb5 Compare August 3, 2025 12:04
@scott-xu scott-xu force-pushed the aesgcm-netframework branch from c43bdb5 to fc1add9 Compare August 17, 2025 01:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the use of the native BCL AesGcm implementation for .NET Framework by adding the Microsoft.Bcl.Cryptography NuGet package. Previously, only .NET (Core) targets could use the native implementation, while .NET Framework and .NET Standard had to fall back to a BouncyCastle implementation.

Key changes:

  • Changed conditional compilation from NET to !NETSTANDARD to include .NET Framework targets
  • Added fallback handling for Mono environments that lack BCrypt.dll
  • Added Microsoft.Bcl.Cryptography package reference for net462 target

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
AesGcmCipher.cs Updated preprocessor directives and added Mono-specific exception handling for missing BCrypt.dll
AesGcmCipher.BclImpl.cs Updated preprocessor directive to enable BCL implementation for .NET Framework
Renci.SshNet.csproj Added package reference for Microsoft.Bcl.Cryptography for net462 target
Directory.Packages.props Added version specification for Microsoft.Bcl.Cryptography package

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants