Skip to content

make the Salt fields public - #2122

Closed
lucascompython wants to merge 1 commit into
RustCrypto:masterfrom
lucascompython:master
Closed

make the Salt fields public#2122
lucascompython wants to merge 1 commit into
RustCrypto:masterfrom
lucascompython:master

Conversation

@lucascompython

Copy link
Copy Markdown

This way one could store the bytes of the salt, that are most likely smaller than the b64 representation, and you skip the cost of encoding and decoding.

@tarcieri

Copy link
Copy Markdown
Member

I'd really prefer to keep the implementation details of the type private.

@tarcieri tarcieri closed this Dec 12, 2025
@lucascompython

Copy link
Copy Markdown
Author

Can I ask why?

@tarcieri

Copy link
Copy Markdown
Member

It means the internal representation can't be changed, for example there's a lot of duplication between Salt and StringBuf and they could perhaps use a common internal type.

It would also break the derived Eq/PartialEq implementations since one of the buffers may contain junk at the end and the other one is zeros, but the bytes that are actually within the specified length of the salt are the same and they should compare equal.

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.

2 participants