Example #1
0
        private IncrementalHash(HashAlgorithmName name, HashProvider hash)
        {
            Debug.Assert(name != null);
            Debug.Assert(!string.IsNullOrEmpty(name.Name));
            Debug.Assert(hash != null);

            _algorithmName = name;
            _hash = hash;
        }
Example #2
0
 public Implementation()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA1);
 }
Example #3
0
 public Implementation()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA256);
     HashSizeValue = _hashProvider.HashSizeInBytes * 8;
 }
Example #4
0
        /// <summary>
        /// Release all resources used by the current instance of the
        /// <see cref="IncrementalHash"/> class.
        /// </summary>
        public void Dispose()
        {
            _disposed = true;

            if (_hash != null)
            {
                _hash.Dispose();
                _hash = null;
            }

            if (_hmac != null)
            {
                _hmac.Dispose(true);
                _hmac = null;
            }
        }
Example #5
0
 public SHA512Managed()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA512);
 }
Example #6
0
 public SHA1Managed()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA1);
     HashSizeValue = _hashProvider.HashSizeInBytes * 8;
 }