Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid byte[] allocations as part of byte[] comparisons #2158

Merged
merged 3 commits into from Jul 26, 2023

Conversation

stephentoub
Copy link
Collaborator

Fixes #2154
Fixes #2153

  • Changes Utility.AreEqual to be non-allocating
  • Changes SymmetricSignatureProvider.Verify to not allocate a byte[] for a hash
  • Changes SymmetricSignatureProvider.Verify to use StartsWith for the comparison rather than Utility.AreEqual

- Changes Utility.AreEqual to be non-allocating
- Changes SymmetricSignatureProvider.Verify to not allocate a byte[] for a hash
- Changes SymmetricSignatureProvider.Verify to use StartsWith for the comparison rather than Utility.AreEqual
Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@stephentoub
Copy link
Collaborator Author

Feedback addressed. Thanks.

Copy link
Contributor

@keegan-caruso keegan-caruso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I want @brentschmaltz to take a look too

@keegan-caruso keegan-caruso merged commit 84b78b9 into AzureAD:dev7x Jul 26, 2023
1 check passed
@stephentoub stephentoub deleted the areequalalloc branch July 27, 2023 01:08
@jennyf19 jennyf19 added this to the 7.0.0-preview2 milestone Jul 27, 2023
brentschmaltz pushed a commit that referenced this pull request Jul 28, 2023
* Avoid byte[] allocations in as part of byte[] comparisons

- Changes Utility.AreEqual to be non-allocating
- Changes SymmetricSignatureProvider.Verify to not allocate a byte[] for a hash
- Changes SymmetricSignatureProvider.Verify to use StartsWith for the comparison rather than Utility.AreEqual

* Use AreEqual instead of StartsWith
brentschmaltz pushed a commit that referenced this pull request Sep 6, 2023
* Avoid byte[] allocations in as part of byte[] comparisons

- Changes Utility.AreEqual to be non-allocating
- Changes SymmetricSignatureProvider.Verify to not allocate a byte[] for a hash
- Changes SymmetricSignatureProvider.Verify to use StartsWith for the comparison rather than Utility.AreEqual

* Use AreEqual instead of StartsWith
brentschmaltz pushed a commit that referenced this pull request Sep 7, 2023
* Avoid byte[] allocations in as part of byte[] comparisons

- Changes Utility.AreEqual to be non-allocating
- Changes SymmetricSignatureProvider.Verify to not allocate a byte[] for a hash
- Changes SymmetricSignatureProvider.Verify to use StartsWith for the comparison rather than Utility.AreEqual

* Use AreEqual instead of StartsWith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants