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
- SqlTriggerContext.cs
- ClientSideQueueItem.cs
- XmlSchemaComplexContentRestriction.cs
- ProcessThread.cs
- RegexCharClass.cs
- IndexedString.cs
- ObjectStateManagerMetadata.cs
- GroupStyle.cs
- StylusOverProperty.cs
- UserPreferenceChangingEventArgs.cs
- CollectionViewGroupRoot.cs
- CapabilitiesUse.cs
- Win32MouseDevice.cs
- infer.cs
- RootBrowserWindowAutomationPeer.cs
- TypeDescriptionProvider.cs
- EventlogProvider.cs
- ByteStack.cs
- FileStream.cs
- EasingKeyFrames.cs
- InputReferenceExpression.cs
- GridViewDeleteEventArgs.cs
- ThousandthOfEmRealDoubles.cs
- TextContainerChangeEventArgs.cs
- Listbox.cs
- Accessible.cs
- PriorityRange.cs
- AuthenticationModuleElementCollection.cs
- PageParserFilter.cs
- XmlSchemaNotation.cs
- ImpersonationContext.cs
- AsyncDataRequest.cs
- Transform.cs
- HopperCache.cs
- BaseInfoTable.cs
- Color.cs
- URLString.cs
- WindowsContainer.cs
- SqlDataSourceView.cs
- FileVersion.cs
- DataTablePropertyDescriptor.cs
- Graphics.cs
- ConstantProjectedSlot.cs
- CatchBlock.cs
- ObjectKeyFrameCollection.cs
- LineSegment.cs
- MessageQueueEnumerator.cs
- EventManager.cs
- XpsSerializationManagerAsync.cs
- WebPartConnectionsCancelVerb.cs
- HotCommands.cs
- BufferAllocator.cs
- CompositeTypefaceMetrics.cs
- _StreamFramer.cs
- FacetChecker.cs
- IDReferencePropertyAttribute.cs
- MailDefinition.cs
- UnicastIPAddressInformationCollection.cs
- ObsoleteAttribute.cs
- ClientRuntimeConfig.cs
- StorageEndPropertyMapping.cs
- DataTrigger.cs
- CryptoHandle.cs
- StateMachineExecutionState.cs
- RowBinding.cs
- LinkClickEvent.cs
- BitArray.cs
- VisualStyleTypesAndProperties.cs
- PagesChangedEventArgs.cs
- InheritanceUI.cs
- SubclassTypeValidatorAttribute.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- ServerIdentity.cs
- WebBrowserUriTypeConverter.cs
- FigureParagraph.cs
- TransactedReceiveData.cs
- SynchronizedInputProviderWrapper.cs
- ExpressionBindingCollection.cs
- StandardBindingElementCollection.cs
- OdbcPermission.cs
- PermissionSetTriple.cs
- WebServiceEnumData.cs
- DependentList.cs
- OutputScopeManager.cs
- EntityClassGenerator.cs
- PowerStatus.cs
- MetadataFile.cs
- XmlCharCheckingReader.cs
- SqlNotificationRequest.cs
- StringAnimationBase.cs
- HashAlgorithm.cs
- DataTable.cs
- XmlDataSourceNodeDescriptor.cs
- DebugViewWriter.cs
- XsltSettings.cs
- Permission.cs
- RtType.cs
- ServiceHostFactory.cs
- DocumentViewerAutomationPeer.cs
- CookieHandler.cs