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
- XamlDesignerSerializationManager.cs
- TimeStampChecker.cs
- Soap.cs
- VisualBasicReference.cs
- Compress.cs
- WebBrowserProgressChangedEventHandler.cs
- BitmapEffectInput.cs
- CodeParameterDeclarationExpressionCollection.cs
- XmlNamespaceMappingCollection.cs
- DictionaryContent.cs
- ArglessEventHandlerProxy.cs
- ProfileEventArgs.cs
- EntityTypeEmitter.cs
- BindingListCollectionView.cs
- SignedInfo.cs
- DesignerEventService.cs
- DataGridViewBindingCompleteEventArgs.cs
- _LazyAsyncResult.cs
- invalidudtexception.cs
- _LazyAsyncResult.cs
- ConditionalExpression.cs
- ResourceReferenceExpressionConverter.cs
- TemplateBamlRecordReader.cs
- Viewport3DVisual.cs
- ByteStreamGeometryContext.cs
- TextWriterEngine.cs
- RuntimeTrackingProfile.cs
- XmlnsCompatibleWithAttribute.cs
- DelegateOutArgument.cs
- XmlNodeComparer.cs
- NativeCompoundFileAPIs.cs
- CodeExpressionCollection.cs
- QilName.cs
- NameValuePair.cs
- ProfileInfo.cs
- Quaternion.cs
- Button.cs
- QueryCoreOp.cs
- DataGridParentRows.cs
- ApplicationException.cs
- AdapterUtil.cs
- MetadataItemEmitter.cs
- GetLedgerRequest.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- PersianCalendar.cs
- AnnotationDocumentPaginator.cs
- EntityDataSourceState.cs
- TimeZone.cs
- SpeechRecognizer.cs
- AddInController.cs
- AspProxy.cs
- SqlWebEventProvider.cs
- LinkClickEvent.cs
- XmlCompatibilityReader.cs
- AutoSizeToolBoxItem.cs
- Message.cs
- RegexGroup.cs
- Propagator.ExtentPlaceholderCreator.cs
- RepeatButton.cs
- TreeNodeCollection.cs
- ActivityTrace.cs
- TableItemPattern.cs
- ImpersonationContext.cs
- XmlSchemaInclude.cs
- WebPartUtil.cs
- mediaeventargs.cs
- Attributes.cs
- CompletedAsyncResult.cs
- NameTable.cs
- NotifyParentPropertyAttribute.cs
- CfgArc.cs
- DataColumnCollection.cs
- MasterPageBuildProvider.cs
- HtmlHistory.cs
- AdapterUtil.cs
- InstanceData.cs
- AdornerLayer.cs
- LinqExpressionNormalizer.cs
- XmlSchemaInferenceException.cs
- ConstrainedDataObject.cs
- DispatcherFrame.cs
- HeaderElement.cs
- CodeTypeDelegate.cs
- DataReaderContainer.cs
- DataSet.cs
- MatrixKeyFrameCollection.cs
- TraceUtils.cs
- Compiler.cs
- GeneralTransform3DCollection.cs
- EventNotify.cs
- CompModSwitches.cs
- FacetValueContainer.cs
- InputScopeNameConverter.cs
- XComponentModel.cs
- WorkerRequest.cs
- SqlWebEventProvider.cs
- InkCanvasFeedbackAdorner.cs
- WebPartConnectionsCloseVerb.cs
- CFStream.cs
- OpCopier.cs