Uh oh!
There was an error while loading. Please reload this page.
Use System.Security.Cryptography in AesCipher - #1235
Conversation
Uh oh!
There was an error while loading. Please reload this page.
WojciechNagorski
commented
Nov 5, 2023
I'm really impressed this is a great job! |
Rob-Hague
commented
Nov 5, 2023
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 #865zybexXL@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. |
WojciechNagorski
commented
Nov 13, 2023
@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. |
Uh oh!
There was an error while loading. Please reload this page.
WojciechNagorski
commented
Nov 16, 2023
WojciechNagorski
commented
Dec 29, 2023
The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1 |

System.Security.Cryptography.Aesis 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.