Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA384Cng.cs / 1305376 / SHA384Cng.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-384 hashing algorithm
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class SHA384Cng : SHA384 {
private BCryptHashAlgorithm m_hashAlgorithm;
//
//
//
[System.Security.SecurityCritical]
public SHA384Cng() {
Contract.Ensures(m_hashAlgorithm != null);
m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha384,
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.
// ==++==
//
// 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-384 hashing algorithm
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class SHA384Cng : SHA384 {
private BCryptHashAlgorithm m_hashAlgorithm;
//
//
//
[System.Security.SecurityCritical]
public SHA384Cng() {
Contract.Ensures(m_hashAlgorithm != null);
m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.Sha384,
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
- HttpApplication.cs
- Input.cs
- ByteStreamGeometryContext.cs
- DataListCommandEventArgs.cs
- GlobalizationSection.cs
- Matrix.cs
- FileSystemInfo.cs
- ActiveXContainer.cs
- RuntimeVariableList.cs
- StreamWithDictionary.cs
- ScrollEvent.cs
- ToolStripRendererSwitcher.cs
- WorkflowTransactionOptions.cs
- SqlClientFactory.cs
- GeneralTransform3DGroup.cs
- WebFormsRootDesigner.cs
- EntityDesignerDataSourceView.cs
- XPathDocumentNavigator.cs
- ListParaClient.cs
- FixedPage.cs
- TextUtf8RawTextWriter.cs
- Border.cs
- baseshape.cs
- ImageAttributes.cs
- TableLayoutPanelCodeDomSerializer.cs
- RenderCapability.cs
- ScriptReferenceBase.cs
- IndexedGlyphRun.cs
- Attributes.cs
- HMACMD5.cs
- Membership.cs
- HttpRequest.cs
- CompositeControl.cs
- RijndaelManagedTransform.cs
- InputProcessorProfilesLoader.cs
- safemediahandle.cs
- EmbeddedMailObjectsCollection.cs
- DocumentPage.cs
- Win32MouseDevice.cs
- InvokePattern.cs
- SqlParameterizer.cs
- InkCanvasSelectionAdorner.cs
- TextEditorCopyPaste.cs
- PerformanceCounterPermission.cs
- ICollection.cs
- FilteredXmlReader.cs
- StubHelpers.cs
- TabItem.cs
- ellipse.cs
- SRef.cs
- SettingsPropertyCollection.cs
- DecimalKeyFrameCollection.cs
- UnsafeNativeMethods.cs
- XmlILModule.cs
- CollectionBase.cs
- XmlTextReader.cs
- Queue.cs
- TypeReference.cs
- CorrelationResolver.cs
- MouseBinding.cs
- PagePropertiesChangingEventArgs.cs
- CryptoHelper.cs
- ExtensionFile.cs
- Tracer.cs
- WsatTransactionHeader.cs
- TriggerCollection.cs
- WindowsTokenRoleProvider.cs
- PropertyOverridesTypeEditor.cs
- SqlCacheDependencyDatabase.cs
- DataGridViewCellStyleChangedEventArgs.cs
- DisplayInformation.cs
- CompositionDesigner.cs
- HostingEnvironment.cs
- Stylesheet.cs
- Durable.cs
- ValueSerializer.cs
- GridViewSelectEventArgs.cs
- Buffer.cs
- PeerSecurityManager.cs
- FieldAccessException.cs
- TreeNodeCollectionEditor.cs
- ErrorProvider.cs
- XmlIlGenerator.cs
- UserPersonalizationStateInfo.cs
- AppDomainUnloadedException.cs
- HandlerWithFactory.cs
- ContentControl.cs
- DBPropSet.cs
- SecondaryIndexList.cs
- XamlVector3DCollectionSerializer.cs
- _TimerThread.cs
- Camera.cs
- ToolStripInSituService.cs
- SerializationObjectManager.cs
- ShaderRenderModeValidation.cs
- DocumentGrid.cs
- ContentPathSegment.cs
- ProcessInfo.cs
- MissingMemberException.cs
- StyleHelper.cs