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
- LinkLabel.cs
- BindingOperations.cs
- CoreChannel.cs
- ObjectListSelectEventArgs.cs
- RequestQueue.cs
- ContainerUIElement3D.cs
- CollectionViewGroupInternal.cs
- ToggleButton.cs
- DataGridViewSortCompareEventArgs.cs
- TripleDES.cs
- NameValuePermission.cs
- WeakEventTable.cs
- XslTransform.cs
- PageAsyncTask.cs
- ZipIORawDataFileBlock.cs
- StateMachineAction.cs
- CodeTypeParameter.cs
- XmlDataSourceView.cs
- EncoderExceptionFallback.cs
- XmlnsCache.cs
- UrlAuthorizationModule.cs
- EmptyEnumerator.cs
- Point4D.cs
- SQLBinary.cs
- InternalEnumValidatorAttribute.cs
- Crypto.cs
- DbConnectionPoolIdentity.cs
- TextCollapsingProperties.cs
- JavaScriptObjectDeserializer.cs
- AuthenticatedStream.cs
- XmlMtomReader.cs
- FunctionQuery.cs
- WindowClosedEventArgs.cs
- TemplateBuilder.cs
- MetadataStore.cs
- _SingleItemRequestCache.cs
- PageClientProxyGenerator.cs
- PeerNameRecord.cs
- Compiler.cs
- AsyncStreamReader.cs
- DataGridItemAttachedStorage.cs
- DataGridViewColumnHeaderCell.cs
- LogicalExpressionEditor.cs
- LogSwitch.cs
- User.cs
- ScrollChrome.cs
- VolatileEnlistmentState.cs
- SqlOuterApplyReducer.cs
- ApplicationFileParser.cs
- XomlSerializationHelpers.cs
- BindingSource.cs
- DataComponentMethodGenerator.cs
- WrappedIUnknown.cs
- SelectionItemProviderWrapper.cs
- MsmqOutputMessage.cs
- TraceInternal.cs
- HybridObjectCache.cs
- XamlSerializerUtil.cs
- DesignerAdapterAttribute.cs
- FillRuleValidation.cs
- ZipIOLocalFileDataDescriptor.cs
- BamlStream.cs
- PenContext.cs
- cache.cs
- HttpsTransportElement.cs
- RealizationDrawingContextWalker.cs
- SafeNativeMethods.cs
- SchemaMerger.cs
- MouseGesture.cs
- XmlSchemaElement.cs
- TraceInternal.cs
- PropertyBuilder.cs
- EntityDataSourceWrapperCollection.cs
- WindowsFormsSynchronizationContext.cs
- ByteStream.cs
- WSHttpBindingCollectionElement.cs
- XmlSchemaAll.cs
- InvalidCommandTreeException.cs
- CryptoConfig.cs
- XmlQueryOutput.cs
- HMACSHA384.cs
- TimeoutException.cs
- Persist.cs
- RelationalExpressions.cs
- ExtensibleClassFactory.cs
- OutputCacheProfile.cs
- SqlCacheDependencyDatabaseCollection.cs
- StreamWriter.cs
- SerializationSectionGroup.cs
- QueryOptionExpression.cs
- DesignRelationCollection.cs
- TraceSection.cs
- AncestorChangedEventArgs.cs
- AssertFilter.cs
- Command.cs
- ContextMenu.cs
- UserControl.cs
- XmlTextEncoder.cs
- DockPanel.cs
- TextComposition.cs