Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- XmlSchemaCollection.cs
- ApplicationBuildProvider.cs
- HostExecutionContextManager.cs
- EntityTransaction.cs
- LoginUtil.cs
- OleDbWrapper.cs
- CorruptingExceptionCommon.cs
- DashStyle.cs
- EntityDataSourceViewSchema.cs
- TypeUtil.cs
- SafeNativeMethods.cs
- CreateUserWizard.cs
- MDIWindowDialog.cs
- ListViewGroup.cs
- RuntimeArgumentHandle.cs
- InkSerializer.cs
- TextRangeEdit.cs
- CodeGenerator.cs
- LocationUpdates.cs
- CheckedPointers.cs
- IItemContainerGenerator.cs
- TextEditorCharacters.cs
- TemplatingOptionsDialog.cs
- SqlDependency.cs
- SessionEndedEventArgs.cs
- AuthenticatedStream.cs
- SqlClientWrapperSmiStreamChars.cs
- WinCategoryAttribute.cs
- IPEndPointCollection.cs
- ClientTarget.cs
- VectorCollectionConverter.cs
- RijndaelManagedTransform.cs
- NumericPagerField.cs
- SizeAnimationUsingKeyFrames.cs
- DiagnosticEventProvider.cs
- DragCompletedEventArgs.cs
- Geometry.cs
- LogicalTreeHelper.cs
- FlowSwitchLink.cs
- ProgressiveCrcCalculatingStream.cs
- Vector3DConverter.cs
- XmlReaderSettings.cs
- EUCJPEncoding.cs
- XmlTextWriter.cs
- GenericsInstances.cs
- VisualTreeHelper.cs
- GraphicsPathIterator.cs
- _PooledStream.cs
- BitmapFrame.cs
- TextBlockAutomationPeer.cs
- BroadcastEventHelper.cs
- ZipIOExtraFieldPaddingElement.cs
- TerminateWorkflow.cs
- _ContextAwareResult.cs
- RequestUriProcessor.cs
- ImageKeyConverter.cs
- AttachedPropertiesService.cs
- OdbcReferenceCollection.cs
- ColorConvertedBitmap.cs
- OutputCacheProfileCollection.cs
- Variable.cs
- ExpressionWriter.cs
- AxDesigner.cs
- SystemUdpStatistics.cs
- CodeMethodInvokeExpression.cs
- BufferedWebEventProvider.cs
- RegistryPermission.cs
- FormViewDeleteEventArgs.cs
- IsolatedStoragePermission.cs
- TextEndOfLine.cs
- Stream.cs
- DataGridViewElement.cs
- XmlSchemaGroup.cs
- KeyValuePairs.cs
- ResourcesBuildProvider.cs
- MatrixTransform3D.cs
- TreeNodeClickEventArgs.cs
- ResolveNameEventArgs.cs
- DeferredBinaryDeserializerExtension.cs
- PriorityBindingExpression.cs
- xmlfixedPageInfo.cs
- UriParserTemplates.cs
- CodeLabeledStatement.cs
- CodeObjectCreateExpression.cs
- TextEditorContextMenu.cs
- ErrorStyle.cs
- SqlNode.cs
- TerminatorSinks.cs
- MainMenu.cs
- XmlIncludeAttribute.cs
- CustomValidator.cs
- FileUtil.cs
- DispatchProxy.cs
- SafeFileHandle.cs
- GroupedContextMenuStrip.cs
- TextBoxView.cs
- M3DUtil.cs
- EntityDataSourceUtil.cs
- URLEditor.cs
- SqlCacheDependencySection.cs