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
- ExpressionBuilder.cs
- BamlLocalizableResource.cs
- ProcessHost.cs
- RichTextBox.cs
- HashMembershipCondition.cs
- RelationalExpressions.cs
- EdmPropertyAttribute.cs
- _CacheStreams.cs
- ObjectViewEntityCollectionData.cs
- MarshalByRefObject.cs
- AutomationPatternInfo.cs
- StateMachineTimers.cs
- LoadRetryAsyncResult.cs
- NoResizeHandleGlyph.cs
- MemberDomainMap.cs
- UniqueEventHelper.cs
- FocusManager.cs
- DataMemberFieldEditor.cs
- InternalBufferManager.cs
- SafeArrayTypeMismatchException.cs
- MemberCollection.cs
- SByteStorage.cs
- FrameworkElementAutomationPeer.cs
- TreeNodeClickEventArgs.cs
- ProviderCommandInfoUtils.cs
- Freezable.cs
- ArgumentValidation.cs
- GenerateScriptTypeAttribute.cs
- PrintDialogException.cs
- ScalarOps.cs
- XmlAutoDetectWriter.cs
- XmlSigningNodeWriter.cs
- SchemaAttDef.cs
- NullExtension.cs
- DataGridViewHeaderCell.cs
- Cursor.cs
- Adorner.cs
- ObjectItemCollection.cs
- SequenceFullException.cs
- Condition.cs
- Keywords.cs
- FontInfo.cs
- PixelFormatConverter.cs
- SystemIcmpV4Statistics.cs
- CookieProtection.cs
- LiteralDesigner.cs
- DoubleLink.cs
- CompilationLock.cs
- MetaForeignKeyColumn.cs
- _ListenerAsyncResult.cs
- MenuItem.cs
- ManipulationCompletedEventArgs.cs
- Color.cs
- CompilerGlobalScopeAttribute.cs
- Formatter.cs
- SQLBinaryStorage.cs
- ObjectStateEntryDbDataRecord.cs
- LocalServiceSecuritySettings.cs
- Encoding.cs
- GestureRecognizer.cs
- ToolboxDataAttribute.cs
- DirectoryNotFoundException.cs
- StronglyTypedResourceBuilder.cs
- SecurityContext.cs
- SpeakInfo.cs
- UnsafePeerToPeerMethods.cs
- DataGridAddNewRow.cs
- KeyTime.cs
- BoundPropertyEntry.cs
- PermissionListSet.cs
- WebPartRestoreVerb.cs
- AvTrace.cs
- AccessDataSourceView.cs
- RenderOptions.cs
- XPathMessageContext.cs
- COSERVERINFO.cs
- TokenizerHelper.cs
- ThreadStartException.cs
- ButtonFieldBase.cs
- Ticks.cs
- MetadataImporter.cs
- GPPOINT.cs
- BoolExpr.cs
- CodeTypeParameter.cs
- TextCharacters.cs
- ModuleElement.cs
- DataRowExtensions.cs
- SecurityTokenRequirement.cs
- BinHexDecoder.cs
- StringToken.cs
- Lock.cs
- SmiRequestExecutor.cs
- TCPClient.cs
- SafeBitVector32.cs
- FormsAuthenticationEventArgs.cs
- TileModeValidation.cs
- TokenBasedSet.cs
- QueryOpeningEnumerator.cs
- AutoCompleteStringCollection.cs
- ExpressionBuilder.cs