System\IO\Hashing\XxHashShared.cs (35)
29public const int NumStripesPerBlock = (SecretLengthBytes - StripeLengthBytes) / SecretConsumeRateBytes;
30public const int AccumulatorCount = StripeLengthBytes / sizeof(ulong);
32public const int InternalBufferStripes = InternalBufferLengthBytes / StripeLengthBytes;
120Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0);
206const int StripesPerBlock = (SecretLengthBytes - StripeLengthBytes) / SecretConsumeRateBytes;
207const int BlockLen = StripeLengthBytes * StripesPerBlock;
213int stripesNumber = (int)((length - 1 - offset) / StripeLengthBytes);
215Accumulate512(accumulators, source + length - StripeLengthBytes, secret + (SecretLengthBytes - StripeLengthBytes - SecretLastAccStartBytes));
229ScrambleAccumulators(accumulators, secret + (SecretLengthBytes - StripeLengthBytes));
230Accumulate(accumulators, source + ((int)stripesToEndOfBlock * StripeLengthBytes), secret, (int)stripesAfterBlock);
275if (source.Length - sourceIndex > NumStripesPerBlock * StripeLengthBytes)
277ulong stripes = (ulong)(source.Length - sourceIndex - 1) / StripeLengthBytes;
284ScrambleAccumulators(accumulators, secret + (SecretLengthBytes - StripeLengthBytes));
286sourceIndex += (int)stripesToEnd * StripeLengthBytes;
293ScrambleAccumulators(accumulators, secret + (SecretLengthBytes - StripeLengthBytes));
294sourceIndex += NumStripesPerBlock * StripeLengthBytes;
300sourceIndex += (int)stripes * StripeLengthBytes;
305source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
318source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
367if (state.BufferedCount >= StripeLengthBytes)
369uint stripes = (state.BufferedCount - 1) / StripeLengthBytes;
374accumulateData = buffer + state.BufferedCount - StripeLengthBytes;
378byte* lastStripe = stackalloc byte[StripeLengthBytes];
379int catchupSize = StripeLengthBytes - (int)state.BufferedCount;
381new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes));
386Accumulate512(accumulators, accumulateData, secret + (SecretLengthBytes - StripeLengthBytes - SecretLastAccStartBytes));
516byte* secretForScramble = secret + (SecretLengthBytes - StripeLengthBytes);
603source += StripeLengthBytes;