Esempio n. 1
0
        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
            }
        }
Esempio n. 2
0
 public void FixtureTeardown()
 {
     HashAlgoFactory.Register <SHA1, SHA1CryptoServiceProvider>();
 }
Esempio n. 3
0
 public void FixtureSetup()
 {
     HashAlgoFactory.Register <SHA1, SHA1Fake>();
 }