[release/10.0.1xx-preview1] Fix array length Fixes #45632 #46654
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #45632
Description and impact
#42775 changed the hash function we used from one that generates a 64-byte hash to one that generates an 8-byte hash. We were only actually using 16 bytes of the hash, but 16 bytes of an 8-byte hash is a source array not long enough error. This upgrades to a 16-byte hash from the same hash family.
This hash function doesn't need to be cryptographically secure since it's just used for a named pipe we use for elevation. Without this change, a user with an MSI-based SDK installation who creates a non-admin command prompt then tries to run (almost) any workload command will be prompted to elevate as expected, but regardless of what they respond, it will then fail. The only workaround is to create an admin prompt or use a file-based installation.
Regression
Yes - changing a hash function to a more secure one (even though we don't use it for security) caused this.
Risk
Low – This changes which hash function we use, but we use one from the same family.
Testing

I was able to reproduce the bug first as described then using my custom-built SDK. I made this change then tried to reproduce it again and failed. Here's the side-by-side version of failure then success:
I have pushed this change to our internal repo and started a build. When that finishes, I will install it just to verify again that this problem is properly resolved.