static TorrentController() { // The OpenSSL binding incorrectly maps 'size_t' to a C# long return; try { using (OpenSSLSha1 native = new OpenSSLSha1()) { native.ComputeHash(new byte[1024]); HashAlgoFactory.Register(typeof(SHA1), typeof(SHA1CryptoServiceProvider)); logger.Debug("Using OpenSSL for SHA1 hashing"); } } catch { // If an exception occurs it means that the native SHA1 function is unusable // so don't register it then } }
public void FixtureTeardown() { HashAlgoFactory.Register <SHA1, SHA1CryptoServiceProvider>(); }
public void FixtureSetup() { HashAlgoFactory.Register <SHA1, SHA1Fake>(); }