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
- ListItemCollection.cs
- View.cs
- SignatureToken.cs
- ParserExtension.cs
- VideoDrawing.cs
- QueryOutputWriter.cs
- Compensation.cs
- XPathAncestorQuery.cs
- BlurEffect.cs
- EntitySqlQueryCacheEntry.cs
- TextTreePropertyUndoUnit.cs
- SqlInternalConnectionTds.cs
- WebPartEditVerb.cs
- PersonalizationProvider.cs
- SmiSettersStream.cs
- HttpException.cs
- ValidationErrorCollection.cs
- PopupRootAutomationPeer.cs
- FontFamilyValueSerializer.cs
- ScrollBar.cs
- ConfigurationManager.cs
- UpDownEvent.cs
- DesignerAutoFormatCollection.cs
- PersonalizablePropertyEntry.cs
- WhiteSpaceTrimStringConverter.cs
- XmlDataSourceView.cs
- WebServiceTypeData.cs
- MDIWindowDialog.cs
- ImageButton.cs
- CustomError.cs
- BaseCodePageEncoding.cs
- WorkflowInstanceAbortedRecord.cs
- DataFieldEditor.cs
- TextProviderWrapper.cs
- AssemblyAttributesGoHere.cs
- RbTree.cs
- OracleInternalConnection.cs
- AutoGeneratedField.cs
- FunctionUpdateCommand.cs
- TemplateControlBuildProvider.cs
- SourceLineInfo.cs
- StoreConnection.cs
- EpmCustomContentSerializer.cs
- DataGridRowEventArgs.cs
- OleDbReferenceCollection.cs
- XmlDataImplementation.cs
- AppSettingsExpressionEditor.cs
- XmlCollation.cs
- HttpContext.cs
- HtmlElementErrorEventArgs.cs
- UserUseLicenseDictionaryLoader.cs
- DataGrid.cs
- LinqDataSourceInsertEventArgs.cs
- SessionParameter.cs
- CheckBox.cs
- GacUtil.cs
- SafeNativeMethodsOther.cs
- GraphicsContext.cs
- UTF8Encoding.cs
- LexicalChunk.cs
- WorkflowApplicationEventArgs.cs
- ExceptionUtil.cs
- XmlConvert.cs
- ResourceReader.cs
- ConvertersCollection.cs
- PropertyDescriptorComparer.cs
- XPathDocumentNavigator.cs
- TextServicesDisplayAttribute.cs
- RectangleF.cs
- RepeaterItemCollection.cs
- CharKeyFrameCollection.cs
- Models.cs
- XslException.cs
- WebBrowser.cs
- RuntimeEnvironment.cs
- dataprotectionpermission.cs
- TimerTable.cs
- SerialErrors.cs
- securitymgrsite.cs
- TextElementEditingBehaviorAttribute.cs
- SymmetricCryptoHandle.cs
- FeatureManager.cs
- ClientRolePrincipal.cs
- RuntimeArgumentHandle.cs
- cookiecollection.cs
- Vector.cs
- AssemblyAttributesGoHere.cs
- GetMemberBinder.cs
- InternalSafeNativeMethods.cs
- TagMapCollection.cs
- DataKey.cs
- Run.cs
- OrderingExpression.cs
- XsdDataContractExporter.cs
- FillErrorEventArgs.cs
- RenderOptions.cs
- SecurityContextTokenCache.cs
- LicenseContext.cs
- ToolStripTextBox.cs
- NavigationWindowAutomationPeer.cs