Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA512CryptoServiceProvider.cs / 1305376 / SHA512CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the CAPI implementation of the SHA-512 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA512CryptoServiceProvider : SHA512 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA512CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha512); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } ///// /// Reset the hash algorithm to begin hashing a new set of data /// //// [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } ///// /// Hash a block of data /// //// [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } ///// /// Complete the hash, returning its value /// //// [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
- DebugView.cs
- HttpWriter.cs
- TableRowCollection.cs
- Inline.cs
- WebBrowserUriTypeConverter.cs
- DrawingContextWalker.cs
- StorageMappingItemLoader.cs
- ServiceSecurityContext.cs
- CommunicationException.cs
- BinaryFormatterWriter.cs
- SystemResourceKey.cs
- XhtmlConformanceSection.cs
- LayoutEditorPart.cs
- PageRouteHandler.cs
- EventSinkHelperWriter.cs
- XmlElementAttributes.cs
- Profiler.cs
- ContentValidator.cs
- DataProtection.cs
- UndirectedGraph.cs
- BitmapEffectGroup.cs
- BindingNavigator.cs
- EntityCommandCompilationException.cs
- TextContainerHelper.cs
- XmlSerializerVersionAttribute.cs
- BypassElementCollection.cs
- StructureChangedEventArgs.cs
- RelationshipSet.cs
- TemplateColumn.cs
- TdsRecordBufferSetter.cs
- Literal.cs
- DataSourceHelper.cs
- SafeReversePInvokeHandle.cs
- KerberosSecurityTokenParameters.cs
- ImpersonationContext.cs
- DrawingGroupDrawingContext.cs
- CopyNamespacesAction.cs
- EncodingTable.cs
- RsaSecurityKey.cs
- SHA256Managed.cs
- DataGridRelationshipRow.cs
- DesignerTransactionCloseEvent.cs
- GenericUI.cs
- SelectionPatternIdentifiers.cs
- RecordsAffectedEventArgs.cs
- WebPartConnectionsCloseVerb.cs
- ApplyImportsAction.cs
- ApplicationServiceHelper.cs
- DetailsView.cs
- Error.cs
- CompositeDataBoundControl.cs
- XmlRawWriterWrapper.cs
- TrackingCondition.cs
- WebPartMenu.cs
- SortQuery.cs
- X509Utils.cs
- InputLangChangeEvent.cs
- FunctionDescription.cs
- EncryptedData.cs
- PipeConnection.cs
- HMACRIPEMD160.cs
- IsolatedStoragePermission.cs
- CollectionViewSource.cs
- PerfService.cs
- CultureSpecificStringDictionary.cs
- ObjectViewFactory.cs
- EdmEntityTypeAttribute.cs
- ControlEvent.cs
- SqlTypeConverter.cs
- TreeViewAutomationPeer.cs
- RadioButtonList.cs
- ThreadStaticAttribute.cs
- TableLayoutRowStyleCollection.cs
- EdmItemCollection.cs
- ConfigXmlText.cs
- SqlRetyper.cs
- DataGridViewImageColumn.cs
- ExpressionParser.cs
- NameValueConfigurationCollection.cs
- NamespaceQuery.cs
- EventDescriptor.cs
- OutputScopeManager.cs
- LocatorPartList.cs
- PageCodeDomTreeGenerator.cs
- SpeechEvent.cs
- ButtonChrome.cs
- InvalidComObjectException.cs
- GeneralTransform3DCollection.cs
- StylusPointPropertyInfo.cs
- Renderer.cs
- BehaviorEditorPart.cs
- StoreItemCollection.cs
- LinkedResourceCollection.cs
- HttpResponseHeader.cs
- AdCreatedEventArgs.cs
- ModelMemberCollection.cs
- InvalidPropValue.cs
- Model3D.cs
- TraceSection.cs
- DeploymentSectionCache.cs