Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ChangeKeyImpl()

byte[] Internal.Cryptography.HMACCommon.ChangeKeyImpl ( ReadOnlySpan< byte > key)
inlineprivate

Definition at line 44 of file HMACCommon.cs.

45 {
46 byte[] result = null;
47 if (key.Length > _blockSize && _blockSize > 0)
48 {
49 if (_lazyHashProvider == null)
50 {
51 _lazyHashProvider = HashProviderDispenser.CreateHashProvider(_hashAlgorithmId);
52 }
55 }
56 HashProvider hMacProvider = _hMacProvider;
57 _hMacProvider = null;
58 hMacProvider?.Dispose(disposing: true);
59 _hMacProvider = HashProviderDispenser.CreateMacProvider(_hashAlgorithmId, key);
60 return result;
61 }
readonly string _hashAlgorithmId
Definition HMACCommon.cs:8
volatile HashProvider _lazyHashProvider
Definition HMACCommon.cs:12
void AppendHashData(byte[] data, int offset, int count)
int FinalizeHashAndReset(Span< byte > destination)

References Internal.Cryptography.HMACCommon._blockSize, Internal.Cryptography.HMACCommon._hashAlgorithmId, Internal.Cryptography.HMACCommon._hMacProvider, Internal.Cryptography.HMACCommon._lazyHashProvider, Internal.Cryptography.HashProvider.AppendHashData(), Internal.Cryptography.HashProviderDispenser.CreateHashProvider(), Internal.Cryptography.HashProviderDispenser.CreateMacProvider(), Internal.Cryptography.HashProvider.Dispose(), Internal.Cryptography.HashProvider.FinalizeHashAndReset(), and System.key.

Referenced by Internal.Cryptography.HMACCommon.HMACCommon(), and Internal.Cryptography.HMACCommon.ChangeKey().