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
- FullTextLine.cs
- RetrieveVirtualItemEventArgs.cs
- AutomationProperties.cs
- NullExtension.cs
- DataStorage.cs
- SchemaMapping.cs
- ForEachDesigner.xaml.cs
- SystemIPv6InterfaceProperties.cs
- HeaderCollection.cs
- WebPartConnectionsEventArgs.cs
- Vector3DCollectionValueSerializer.cs
- EnvironmentPermission.cs
- QueryTaskGroupState.cs
- InternalPermissions.cs
- XamlPathDataSerializer.cs
- _ConnectStream.cs
- RawTextInputReport.cs
- MouseCaptureWithinProperty.cs
- InputBinding.cs
- ChannelAcceptor.cs
- TabPanel.cs
- WsatRegistrationHeader.cs
- IncomingWebRequestContext.cs
- ProtectedConfigurationProviderCollection.cs
- AnyAllSearchOperator.cs
- TemplateControlParser.cs
- WeakEventManager.cs
- TableRow.cs
- PeerObject.cs
- ControlParameter.cs
- TrustSection.cs
- StringArrayConverter.cs
- altserialization.cs
- RichTextBoxDesigner.cs
- QueryContinueDragEvent.cs
- TemplateField.cs
- FormsAuthenticationTicket.cs
- GAC.cs
- DbUpdateCommandTree.cs
- RegexCompiler.cs
- SQLSingle.cs
- SimpleLine.cs
- ProtectedProviderSettings.cs
- StickyNoteAnnotations.cs
- FlowPosition.cs
- FixedSOMTableCell.cs
- Merger.cs
- ContextToken.cs
- SamlAuthenticationClaimResource.cs
- SQLCharsStorage.cs
- XsltLoader.cs
- SimpleBitVector32.cs
- TextViewSelectionProcessor.cs
- DiscoveryMessageSequenceGenerator.cs
- Normalization.cs
- SiblingIterators.cs
- KeysConverter.cs
- SqlFlattener.cs
- LocalizationCodeDomSerializer.cs
- DbSourceParameterCollection.cs
- Visual3DCollection.cs
- AsyncResult.cs
- DataGridViewAdvancedBorderStyle.cs
- CngKey.cs
- ErrorHandler.cs
- SqlTransaction.cs
- ZoneMembershipCondition.cs
- CompatibleComparer.cs
- DataComponentMethodGenerator.cs
- ImageBrush.cs
- BamlLocalizabilityResolver.cs
- arc.cs
- ServiceOperationParameter.cs
- TextEditorSelection.cs
- IWorkflowDebuggerService.cs
- BindingSource.cs
- PropertyChangingEventArgs.cs
- BulletedListEventArgs.cs
- PointConverter.cs
- FieldNameLookup.cs
- DataServicePagingProviderWrapper.cs
- StackSpiller.Bindings.cs
- BaseValidator.cs
- CompilationUnit.cs
- Byte.cs
- EtwTrace.cs
- SqlDeflator.cs
- ToolZoneDesigner.cs
- RenderCapability.cs
- PackageRelationshipSelector.cs
- RegistrationServices.cs
- XmlUtil.cs
- XdrBuilder.cs
- MarshalDirectiveException.cs
- Configuration.cs
- NextPreviousPagerField.cs
- PropertyTabAttribute.cs
- EditCommandColumn.cs
- DifferencingCollection.cs
- ComponentSerializationService.cs