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
- BindingManagerDataErrorEventArgs.cs
- PropertyRef.cs
- CodePageUtils.cs
- InkCollectionBehavior.cs
- ColorTranslator.cs
- SimpleType.cs
- Calendar.cs
- XmlAttributeOverrides.cs
- StorageAssociationTypeMapping.cs
- WorkflowRuntimeService.cs
- TransmissionStrategy.cs
- XmlDocumentSchema.cs
- ElapsedEventArgs.cs
- codemethodreferenceexpression.cs
- LabelExpression.cs
- OAVariantLib.cs
- TemplateEditingService.cs
- DuplicateWaitObjectException.cs
- RadioButtonFlatAdapter.cs
- DrawingAttributesDefaultValueFactory.cs
- XslVisitor.cs
- DBSqlParser.cs
- SimpleHandlerFactory.cs
- ValueConversionAttribute.cs
- DataTableMappingCollection.cs
- TextStore.cs
- DataListCommandEventArgs.cs
- DockingAttribute.cs
- BoundField.cs
- BooleanExpr.cs
- TextTreeNode.cs
- DetailsViewDeletedEventArgs.cs
- ContractComponent.cs
- XmlReaderSettings.cs
- PersistenceProviderFactory.cs
- InkCanvasSelectionAdorner.cs
- Animatable.cs
- SamlAssertion.cs
- ProxyHelper.cs
- DataView.cs
- PseudoWebRequest.cs
- HMACSHA512.cs
- DesignerProperties.cs
- Helpers.cs
- DigestComparer.cs
- RSAPKCS1SignatureDeformatter.cs
- ThreadStaticAttribute.cs
- NativeRecognizer.cs
- WebPartEditorCancelVerb.cs
- webproxy.cs
- DataGridViewLinkCell.cs
- ProjectionCamera.cs
- Processor.cs
- HWStack.cs
- Transform.cs
- DataGridHeaderBorder.cs
- StrongName.cs
- CodeIdentifier.cs
- BaseEntityWrapper.cs
- oledbmetadatacolumnnames.cs
- WebPartCollection.cs
- ExceptionUtil.cs
- MemberDescriptor.cs
- FixedFlowMap.cs
- TraceProvider.cs
- StringToken.cs
- InputEventArgs.cs
- KnownColorTable.cs
- ControlIdConverter.cs
- SqlUserDefinedTypeAttribute.cs
- XMLDiffLoader.cs
- ISessionStateStore.cs
- _SSPIWrapper.cs
- CommunicationObject.cs
- MethodExpression.cs
- BackgroundFormatInfo.cs
- PageVisual.cs
- PerfCounterSection.cs
- DynamicDataResources.Designer.cs
- EncryptedXml.cs
- XslTransform.cs
- SqlTopReducer.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- Vector3DValueSerializer.cs
- X500Name.cs
- TheQuery.cs
- NetworkInformationException.cs
- LinqDataSourceSelectEventArgs.cs
- LoginDesigner.cs
- TreeNodeEventArgs.cs
- _UncName.cs
- TextHidden.cs
- HMAC.cs
- WebPartCatalogCloseVerb.cs
- XmlElement.cs
- Line.cs
- KoreanLunisolarCalendar.cs
- NativeWindow.cs
- ListChangedEventArgs.cs
- ListView.cs