protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
        {
            // we're sealed and the base should have checked this already
            Debug.Assert(data != null);
            Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name));

            using (HashAlgorithm hash = Gost3411.Create())
            {
                return(hash.ComputeHash(data));
            }
        }
        protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
        {
            // we're sealed and the base should have checked this already
            Debug.Assert(data != null);
            Debug.Assert(count >= 0 && count <= data.Length);
            Debug.Assert(offset >= 0 && offset <= data.Length - count);
            Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name));

            using (HashAlgorithm hash = Gost3411.Create())
            {
                return(hash.ComputeHash(data, offset, count));
            }
        }
        public Gost3410CryptoServiceProvider(IntPtr hProvHandle, int keySpec)
        {
            _safeProvHandle = new SafeProvHandle(hProvHandle, true);
            _keySpec        = keySpec;

            LegalKeySizesValue = new KeySizes[] { new KeySizes(
                                                      GostConstants.GOST_3410EL_SIZE, GostConstants.GOST_3410EL_SIZE, 0) };
            _safeKeyHandle = CapiHelper.GetKeyPairHelper(
                CspAlgorithmType.Gost2001,
                keySpec,
                GostConstants.GOST_3410EL_SIZE,
                _safeProvHandle);
            _hashImpl = Gost3411.Create();
        }
        public Gost3410CryptoServiceProvider(CspParameters parameters)
        {
            _parameters = CapiHelper.SaveCspParameters(
                CapiHelper.CspAlgorithmType.Gost2001,
                parameters,
                s_useMachineKeyStore,
                out _randomKeyContainer);
            _keySpec           = _parameters.KeyNumber;
            LegalKeySizesValue = new KeySizes[] { new KeySizes(GostConstants.GOST_3410EL_SIZE, GostConstants.GOST_3410EL_SIZE, 0) };

            _hashImpl = Gost3411.Create();
            if (!_randomKeyContainer)
            {
                GetKeyPair();
            }
        }