Пример #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;
        }
Пример #2
0
 public Implementation()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA1);
 }
Пример #3
0
 public Implementation()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA256);
     HashSizeValue = _hashProvider.HashSizeInBytes * 8;
 }
Пример #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;
            }
        }
Пример #5
0
 public SHA512Managed()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA512);
 }
Пример #6
0
 public SHA1Managed()
 {
     _hashProvider = HashProviderDispenser.CreateHashProvider(HashAlgorithmNames.SHA1);
     HashSizeValue = _hashProvider.HashSizeInBytes * 8;
 }