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
- WebPartCancelEventArgs.cs
- XmlAttributeOverrides.cs
- IntegerValidatorAttribute.cs
- CryptoApi.cs
- PageWrapper.cs
- DurableMessageDispatchInspector.cs
- Model3D.cs
- ProfileBuildProvider.cs
- TextChangedEventArgs.cs
- TableCellCollection.cs
- GC.cs
- XPathNavigator.cs
- DataGridItemCollection.cs
- ClockController.cs
- XmlBindingWorker.cs
- SHA256.cs
- PolicyValidator.cs
- coordinatorscratchpad.cs
- KnownTypesHelper.cs
- printdlgexmarshaler.cs
- GiveFeedbackEvent.cs
- XPathDocumentIterator.cs
- NativeMethods.cs
- HttpConfigurationContext.cs
- UxThemeWrapper.cs
- ZipIOBlockManager.cs
- ExpressionParser.cs
- Site.cs
- DataServiceClientException.cs
- XmlSchemaSimpleTypeUnion.cs
- Variable.cs
- DataGridToolTip.cs
- WindowHideOrCloseTracker.cs
- DBParameter.cs
- SafeCoTaskMem.cs
- Quad.cs
- TraceInternal.cs
- InkPresenter.cs
- ItemCollection.cs
- WebCategoryAttribute.cs
- InfocardExtendedInformationCollection.cs
- recordstatescratchpad.cs
- ObjectDataSourceSelectingEventArgs.cs
- ExternalFile.cs
- VoiceChangeEventArgs.cs
- SmtpException.cs
- SafePointer.cs
- TdsParameterSetter.cs
- LassoHelper.cs
- TimeZone.cs
- ToggleButton.cs
- Localizer.cs
- SchemaSetCompiler.cs
- MobileListItem.cs
- BufferedWebEventProvider.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- XmlTextReader.cs
- ObjectDataSourceView.cs
- TableLayoutStyle.cs
- SetterBaseCollection.cs
- SoapServerMethod.cs
- ContainerUIElement3D.cs
- Variant.cs
- EntityViewGenerationAttribute.cs
- Models.cs
- __Filters.cs
- SequentialOutput.cs
- RotateTransform.cs
- MaskedTextBoxDesignerActionList.cs
- CookieParameter.cs
- EventHandlersStore.cs
- SqlTriggerAttribute.cs
- HwndAppCommandInputProvider.cs
- DataGridrowEditEndingEventArgs.cs
- MinMaxParagraphWidth.cs
- InstancePersistenceContext.cs
- ExtentKey.cs
- Rotation3D.cs
- TaiwanLunisolarCalendar.cs
- RijndaelManagedTransform.cs
- DataGridViewColumnConverter.cs
- FixedHighlight.cs
- ReadOnlyDictionary.cs
- TraceContext.cs
- PropertyManager.cs
- ScriptingWebServicesSectionGroup.cs
- DbConnectionClosed.cs
- EntityContainerRelationshipSet.cs
- GregorianCalendar.cs
- ErrorInfoXmlDocument.cs
- StateBag.cs
- ToolStripItemClickedEventArgs.cs
- TextEvent.cs
- SystemMulticastIPAddressInformation.cs
- DbConnectionOptions.cs
- KnownAssembliesSet.cs
- NativeRecognizer.cs
- FormParameter.cs
- EntityDataSourceSelectingEventArgs.cs
- IndexerNameAttribute.cs