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

Add lifetime to CustomizedExtArg #1561

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

sylvainpelissier
Copy link
Contributor

Add a explicit lifetime for CustomizedExtArg. It seems to be needed. See RustCrypto/hashes#573.

@tarcieri tarcieri requested a review from newpavlov April 28, 2024 23:22
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

Hm, this is a bit unfortunate, but I guess it's the most practical solution with the current version of Rust.

@newpavlov newpavlov merged commit 5acf43b into RustCrypto:master Apr 30, 2024
9 checks passed
@tarcieri
Copy link
Member

Hmm, this sort of API seems problematic for building generic abstractions over customized hashes. I think customization should probably be limited to a single bytestring in order to promote generic abstractions.

The cSHAKE function name seems unrelated to customization, or rather to the extent it's related it's very much cSHAKE-specific.

@sylvainpelissier
Copy link
Contributor Author

I agree It would make the trait more generic. Function name is used to build TupleHash, ParallelHash and KMAC from cSHAKE beside that I don't see other usage. For Blake2 it would handle the Salt parameter in addition to the Personalization but I don't know if it is used in practice. Do you want me to remove CustomizedExtArg ?

@tarcieri
Copy link
Member

tarcieri commented May 3, 2024

@sylvainpelissier even if both constructions took 2-tuples of byte slices, the parameters aren't interchangeable: the cSHAKE function name is something very specific to cSHAKE.

Do you want me to remove CustomizedExtArg ?

That's my vote. I think for the purposes of generic abstractions for customization the best we can do is a single byte slice.

@newpavlov
Copy link
Member

I am also fine with having simple byte slice customization only.

@sylvainpelissier
Copy link
Contributor Author

I agree, I removed it in #1564.

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.

3 participants