Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA512Cng.cs / 1305376 / SHA512Cng.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the BCrypt implementation of the SHA-512 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA512Cng : SHA512 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA512Cng() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha512, BCryptNative.ProviderName.MicrosoftPrimitiveProvider); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } //// // [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } //// // [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } //// // [System.Security.SecurityCritical] protected override byte[] HashFinal() { Contract.Assert(m_hashAlgorithm != null); return m_hashAlgorithm.HashFinal(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.//
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- VirtualPath.cs
- DelegatedStream.cs
- GroupStyle.cs
- safex509handles.cs
- ObjectStateManagerMetadata.cs
- PersistenceMetadataNamespace.cs
- Command.cs
- SafeTokenHandle.cs
- PersistenceTypeAttribute.cs
- GPPOINTF.cs
- StandardOleMarshalObject.cs
- StringExpressionSet.cs
- Closure.cs
- TableAutomationPeer.cs
- DataGrid.cs
- Win32.cs
- ICollection.cs
- CacheEntry.cs
- ResourceExpressionBuilder.cs
- httpserverutility.cs
- FastPropertyAccessor.cs
- ByteConverter.cs
- HttpServerUtilityWrapper.cs
- StateWorkerRequest.cs
- Interfaces.cs
- CanonicalizationDriver.cs
- AttributeSetAction.cs
- PolicyDesigner.cs
- ConfigUtil.cs
- Function.cs
- StylusPlugin.cs
- CreatingCookieEventArgs.cs
- InfoCardBaseException.cs
- ListSortDescriptionCollection.cs
- IgnoreFileBuildProvider.cs
- SqlCacheDependencySection.cs
- WrapperSecurityCommunicationObject.cs
- ToolStripStatusLabel.cs
- AddressAlreadyInUseException.cs
- DataListItemCollection.cs
- Visual3D.cs
- LogEntrySerializationException.cs
- HashCodeCombiner.cs
- OracleString.cs
- DelegatingTypeDescriptionProvider.cs
- BitmapFrameDecode.cs
- InputLangChangeRequestEvent.cs
- recordstate.cs
- ComboBoxItem.cs
- GroupItem.cs
- StaticContext.cs
- MsmqElementBase.cs
- ForeignConstraint.cs
- CompiledRegexRunnerFactory.cs
- DataGridSortCommandEventArgs.cs
- DynamicActionMessageFilter.cs
- SqlWriter.cs
- CheckBoxFlatAdapter.cs
- IssuanceLicense.cs
- MetadataPropertyCollection.cs
- DateTimeFormatInfoScanner.cs
- RightsManagementInformation.cs
- InternalConfigEventArgs.cs
- FaultContractAttribute.cs
- Window.cs
- QueryableFilterRepeater.cs
- DispatchRuntime.cs
- ToolBarButton.cs
- ValueChangedEventManager.cs
- QilTargetType.cs
- SaveFileDialog.cs
- GridViewUpdateEventArgs.cs
- SingleSelectRootGridEntry.cs
- DataSourceControlBuilder.cs
- ColumnHeaderConverter.cs
- ClosableStream.cs
- DesignerVerbCollection.cs
- DataGridViewCellParsingEventArgs.cs
- ProbeDuplex11AsyncResult.cs
- DataPagerFieldItem.cs
- WindowsComboBox.cs
- ProjectionCamera.cs
- X509SecurityTokenProvider.cs
- CopyOfAction.cs
- DomainUpDown.cs
- DataControlFieldCollection.cs
- DesignerAdapterAttribute.cs
- TimeZoneNotFoundException.cs
- GeometryCombineModeValidation.cs
- OperationAbortedException.cs
- SafeNativeMethods.cs
- SafeNativeMethods.cs
- BooleanStorage.cs
- XmlExtensionFunction.cs
- PassportAuthentication.cs
- UIElementHelper.cs
- RemoteWebConfigurationHostStream.cs
- ToolStripItemTextRenderEventArgs.cs
- TableDesigner.cs
- SingleQueryOperator.cs