Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / HMACSHA512.cs / 1305376 / HMACSHA512.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // // // HMACSHA512.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class HMACSHA512 : HMAC { private bool m_useLegacyBlockSize = Utils._ProduceLegacyHmacValues(); // // public constructors // public HMACSHA512 () : this (Utils.GenerateRandom(128)) {} [System.Security.SecuritySafeCritical] // auto-generated public HMACSHA512 (byte[] key) { m_hashName = "SHA512"; m_hash1 = new SHA512Managed(); m_hash2 = new SHA512Managed(); HashSizeValue = 512; BlockSizeValue = BlockSize; base.InitializeKey(key); } private int BlockSize { get { return m_useLegacyBlockSize ? 64 : 128; } } ////// In Whidbey we incorrectly used a block size of 64 bytes for HMAC-SHA-384 and HMAC-SHA-512, /// rather than using the correct value of 128 bytes. Setting this to true causes us to fall /// back to the Whidbey mode which produces incorrect HMAC values. /// /// This value should be set only once, before hashing has begun, since we need to reset the key /// buffer for the block size change to take effect. /// /// The default vaue is off, however this can be toggled for the application by setting the /// legacyHMACMode config switch. /// public bool ProduceLegacyHmacValues { get { return m_useLegacyBlockSize; } set { m_useLegacyBlockSize = value; BlockSizeValue = BlockSize; InitializeKey(KeyValue); } } } } // 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
- EmissiveMaterial.cs
- FormDocumentDesigner.cs
- MatrixAnimationUsingKeyFrames.cs
- TypeUsage.cs
- DataSysAttribute.cs
- ContextMenuStripActionList.cs
- GetPageCompletedEventArgs.cs
- TimersDescriptionAttribute.cs
- AlignmentYValidation.cs
- StylusDownEventArgs.cs
- DocumentApplicationDocumentViewer.cs
- MetadataCollection.cs
- GridErrorDlg.cs
- QilTargetType.cs
- MustUnderstandBehavior.cs
- DataKeyCollection.cs
- OledbConnectionStringbuilder.cs
- FileDialogCustomPlacesCollection.cs
- BamlLocalizationDictionary.cs
- ChannelDispatcherCollection.cs
- FunctionNode.cs
- SharedUtils.cs
- TemplateKey.cs
- IIS7UserPrincipal.cs
- ReceiveSecurityHeaderEntry.cs
- FindSimilarActivitiesVerb.cs
- XmlSecureResolver.cs
- ViewBox.cs
- DbCommandTree.cs
- EntityDataSourceChangedEventArgs.cs
- ControlBuilder.cs
- DataGridRowHeaderAutomationPeer.cs
- TextServicesDisplayAttributePropertyRanges.cs
- ValueTypeFixupInfo.cs
- CodeObject.cs
- XmlObjectSerializerReadContextComplexJson.cs
- HttpPostProtocolReflector.cs
- DbMetaDataFactory.cs
- OracleCommandSet.cs
- HandledEventArgs.cs
- PrinterSettings.cs
- BezierSegment.cs
- KeyPressEvent.cs
- ExplicitDiscriminatorMap.cs
- CollectionViewSource.cs
- AppSettingsSection.cs
- UnsafePeerToPeerMethods.cs
- ContractHandle.cs
- WeakRefEnumerator.cs
- CompositeKey.cs
- StyleSheetDesigner.cs
- DecoderFallbackWithFailureFlag.cs
- File.cs
- Tablet.cs
- CopyOnWriteList.cs
- GraphicsPath.cs
- SecurityKeyIdentifier.cs
- TabControl.cs
- Blend.cs
- XamlParser.cs
- UIElement.cs
- ObservableCollection.cs
- TemplateComponentConnector.cs
- ISFClipboardData.cs
- StreamResourceInfo.cs
- ExtensionQuery.cs
- Cursor.cs
- ScrollData.cs
- InkCanvas.cs
- SemaphoreFullException.cs
- StringBuilder.cs
- DoubleLinkList.cs
- FunctionDetailsReader.cs
- PackageStore.cs
- MgmtConfigurationRecord.cs
- RotateTransform3D.cs
- MulticastIPAddressInformationCollection.cs
- XmlComplianceUtil.cs
- FixedSOMElement.cs
- ConfigurationProperty.cs
- FunctionQuery.cs
- Geometry3D.cs
- _WinHttpWebProxyDataBuilder.cs
- DesignerDataSourceView.cs
- InputProcessorProfiles.cs
- BooleanSwitch.cs
- XpsFontSerializationService.cs
- cookieexception.cs
- DependsOnAttribute.cs
- DefaultAuthorizationContext.cs
- SamlDelegatingWriter.cs
- IdleTimeoutMonitor.cs
- ZoneLinkButton.cs
- DataRelationCollection.cs
- StrongNameMembershipCondition.cs
- initElementDictionary.cs
- TextServicesContext.cs
- Token.cs
- WindowsToolbarAsMenu.cs
- BufferedStream.cs