Skip to content

Implement string comparison#115

Open
alvra wants to merge 3 commits into
dalek-cryptography:mainfrom
alvra:main
Open

Implement string comparison#115
alvra wants to merge 3 commits into
dalek-cryptography:mainfrom
alvra:main

Conversation

@alvra

@alvra alvra commented Sep 19, 2023

Copy link
Copy Markdown

This PR implements ConstantTimeEq for str.

@AaronFeickert AaronFeickert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It may be useful to document that this will short-circuit if the strings do not have the same length.

@alvra

alvra commented Feb 13, 2024

Copy link
Copy Markdown
Author

I've added a note similar to the one for slices.

@AaronFeickert AaronFeickert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would also be helpful to add a few tests for this.

@tbu-

tbu- commented May 20, 2024

Copy link
Copy Markdown

I'm interested in this change. Is there anything blocking it?

The workaround is very simple, just call as_bytes() and then ct_eq().

@musjj

musjj commented Jan 30, 2025

Copy link
Copy Markdown

Would love to see this get merged too. Any blockers?

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.

4 participants