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
- UnicastIPAddressInformationCollection.cs
- HwndTarget.cs
- ViewLoader.cs
- OrderPreservingSpoolingTask.cs
- GridToolTip.cs
- sitestring.cs
- TagMapInfo.cs
- XmlToDatasetMap.cs
- SqlDataSourceQueryConverter.cs
- ApplyHostConfigurationBehavior.cs
- odbcmetadatacolumnnames.cs
- WebGetAttribute.cs
- Soap.cs
- EncryptedKey.cs
- EventSchemaTraceListener.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- UrlSyndicationContent.cs
- InheritanceContextHelper.cs
- Listen.cs
- NotFiniteNumberException.cs
- Hex.cs
- ForceCopyBuildProvider.cs
- PasswordRecovery.cs
- XsdValidatingReader.cs
- BasicExpressionVisitor.cs
- TextModifier.cs
- Size.cs
- BitmapSource.cs
- Descriptor.cs
- HelpInfo.cs
- OutputBuffer.cs
- UserUseLicenseDictionaryLoader.cs
- ProviderConnectionPointCollection.cs
- CurrentChangingEventManager.cs
- FontEmbeddingManager.cs
- TextSchema.cs
- FrameworkContextData.cs
- XmlBufferReader.cs
- compensatingcollection.cs
- QuaternionConverter.cs
- ComPlusInstanceContextInitializer.cs
- XmlKeywords.cs
- MonthChangedEventArgs.cs
- backend.cs
- WindowsIdentity.cs
- TakeOrSkipWhileQueryOperator.cs
- ButtonRenderer.cs
- PhysicalOps.cs
- ClockController.cs
- DataViewListener.cs
- ProfessionalColors.cs
- Constraint.cs
- Rules.cs
- UnSafeCharBuffer.cs
- Authorization.cs
- BuildProviderUtils.cs
- SchemaNamespaceManager.cs
- InputLanguageEventArgs.cs
- Util.cs
- SystemWebSectionGroup.cs
- Utility.cs
- TextLine.cs
- ScriptControl.cs
- TrustSection.cs
- FrameworkPropertyMetadata.cs
- CollectionView.cs
- IntegerValidator.cs
- KeyEvent.cs
- MouseEventArgs.cs
- Menu.cs
- Rotation3DKeyFrameCollection.cs
- OleDbConnection.cs
- OleDbEnumerator.cs
- SqlDataSource.cs
- SamlSubject.cs
- KeyedPriorityQueue.cs
- util.cs
- X509Utils.cs
- SmiEventSink.cs
- DateTimeHelper.cs
- EncoderReplacementFallback.cs
- ByteBufferPool.cs
- codemethodreferenceexpression.cs
- ReaderWriterLockWrapper.cs
- InvalidCastException.cs
- User.cs
- FontStyles.cs
- ResourcesChangeInfo.cs
- UpdateEventArgs.cs
- figurelength.cs
- DynamicControl.cs
- QueryNode.cs
- WorkflowMarkupElementEventArgs.cs
- WebServiceTypeData.cs
- SettingsPropertyValueCollection.cs
- MatrixCamera.cs
- CustomErrorCollection.cs
- X509AudioLogo.cs
- NameValueCollection.cs
- NameSpaceExtractor.cs