Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- AssemblyInfo.cs
- OleDbMetaDataFactory.cs
- EntityClientCacheKey.cs
- LingerOption.cs
- XamlPointCollectionSerializer.cs
- MultipartIdentifier.cs
- serverconfig.cs
- InkCanvas.cs
- Single.cs
- ObjectDisposedException.cs
- ApplicationManager.cs
- MultipleViewPattern.cs
- WrappedIUnknown.cs
- FrameworkObject.cs
- VirtualDirectoryMappingCollection.cs
- SizeAnimationUsingKeyFrames.cs
- _emptywebproxy.cs
- Window.cs
- HeaderedItemsControl.cs
- PlanCompilerUtil.cs
- HtmlSelect.cs
- dsa.cs
- ImageClickEventArgs.cs
- CharConverter.cs
- MergeLocalizationDirectives.cs
- BinarySerializer.cs
- XmlParser.cs
- InputReportEventArgs.cs
- TraceSection.cs
- HandledEventArgs.cs
- PenThreadWorker.cs
- ScrollBar.cs
- XmlDesignerDataSourceView.cs
- SoapRpcServiceAttribute.cs
- SecurityElement.cs
- JumpList.cs
- TemplatedEditableDesignerRegion.cs
- DataPager.cs
- SecondaryViewProvider.cs
- HtmlContainerControl.cs
- BindableAttribute.cs
- XmlTextReaderImpl.cs
- GiveFeedbackEventArgs.cs
- Substitution.cs
- CacheChildrenQuery.cs
- ExpressionBinding.cs
- Span.cs
- Parser.cs
- ReliabilityContractAttribute.cs
- CryptoStream.cs
- DefaultMergeHelper.cs
- StaticSiteMapProvider.cs
- Timeline.cs
- TextEndOfSegment.cs
- HealthMonitoringSectionHelper.cs
- ValidationEventArgs.cs
- TypeUtils.cs
- HyperLinkStyle.cs
- DesignTimeValidationFeature.cs
- PeerNameRecord.cs
- odbcmetadatacollectionnames.cs
- SkinBuilder.cs
- ClassHandlersStore.cs
- HttpValueCollection.cs
- XhtmlCssHandler.cs
- BindValidationContext.cs
- QueryOperationResponseOfT.cs
- ToolboxSnapDragDropEventArgs.cs
- Sentence.cs
- WebControlAdapter.cs
- DbParameterHelper.cs
- EpmContentSerializer.cs
- KeyProperty.cs
- DtdParser.cs
- CompressedStack.cs
- XmlQueryTypeFactory.cs
- ProvideValueServiceProvider.cs
- ImageMapEventArgs.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SimpleHandlerFactory.cs
- BrowsableAttribute.cs
- RNGCryptoServiceProvider.cs
- MouseGestureConverter.cs
- LocalsItemDescription.cs
- TableHeaderCell.cs
- FreezableCollection.cs
- GenericsNotImplementedException.cs
- MetadataPropertyAttribute.cs
- XmlSchemaFacet.cs
- ContainerSelectorBehavior.cs
- MembershipValidatePasswordEventArgs.cs
- BamlStream.cs
- RoutedEventValueSerializer.cs
- OleDbDataAdapter.cs
- AssociationTypeEmitter.cs
- BaseDataListComponentEditor.cs
- DbSourceCommand.cs
- Pair.cs
- PreloadedPackages.cs
- KeySpline.cs