-
-
Notifications
You must be signed in to change notification settings - Fork 939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use System.Security.Cryptography in AesCipher #1235
Conversation
I'm really impressed this is a great job! |
I would expect this to become the implementation of Reposting the benchmarks here (they are the same as in the linked comment) Results on develop branch 826222f:
Results on these changes:
Results on #865 zybexXL@a9f68fb:
The allocations in CTR mode can easily be removed, and I would expect it to extend to CFB as well. So given how much faster it is, it will be worth having as an implementation. The proposal is to keep the implementations separate so that we keep using a |
@WojciechNagorski I've restructured #865 to incorporate suggestions from Rob-Hague in the above linked comment. This makes both PRs functionally similar, but #865 is much faster as this one only accelerates blockwise encryption/decryption, while 865 also accelerates one-shot buffer operations. #865 already used acceleration (2 years ago) but the code was injected into the CipherMode classes instead of AesCipher.cs. I've now refactored and improved it. |
@Rob-Hague, @zybexXL Which of these two PRs should be checked first? #1235 #865 They are related and I don't really know where to start. |
The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1 |
System.Security.Cryptography.Aes
is supported on all target platforms (it wasn't in previous versions of the library). So we can use it rather than the hand-written code.The change comes with modest performance gains (#865 (comment)) and from a maintenance perspective, makes it easier to achieve the design proposed in the linked comment in order to get much greater performance gains.