.NET is pretty big.
On Microsoft.NET for Windows, you will find types named:
*Managed , for example. SHA1Managed , which are fully managed by implementations. There will not be any hardware acceleration on them;
*CryptoServiceProvider , for example. SHA1CryptoServiceManager that will use the CryptoAPI (native) code. If the built-in CSP has hardware acceleration, you will get it.
in new versions of the frameworks, *CNG ( Next Generation Cryptography ). What is the replacement for CryptoAPI - the same rules apply (if your own code can use hardware acceleration, you will get it).
In Mono, on all platforms, by default you completely control the implementation (regardless of the type name).
Now in both cases (MS and Mono) you can also use your own (or third-party) implementation. It can even be completely transparent for your application when you use CryptoConfig.CreateFrom (directly or indirectly, for example SHA1.Create ), and your machine.config contains a link to an alternative implementation. This allows (or anyone else) to add (or replace) any implementation with another (including hardware accelerated) implementation.
Note. Platform version 4.0 makes this even easier with the new AddAlgorithm method.
source share