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

feat: Generate constant random byte arrays #23

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

ironhaven
Copy link
Contributor

The const_random macro will now accept and generate fixed sized u8
arrays of any size. #22

Implementation detail: This patch replaces the 256 bit fixed sized sha3
hash (SHA3-256) with the sha3 eXtendable-Output Function (SHAKE256).
This is to allow
arbitrarily long byte arrays to be generated. Replacing SHA3-245 is not strictly
necessary because the tiny-keccak crate does not limit the output size of sha3
functions, but I feel that misusing crypto primitives is a code smell.

The `const_random` macro will now accept and generate fixed sized `u8`
arrays of any size.

Implementation detail: This patch replaces the 256 bit fixed sized sha3
hash (sha3-256) with the sha3 eXtendable-Output Function (SHAKE256).
This is to allow
arbitrarily long byte arrays to be generated. This is not strictly
necessary because `tiny-keccak` does not limit the output size of sha3
functions but I feel that misusing crypto primitive is a code smell.
@tkaitchuck tkaitchuck merged commit bce38ee into tkaitchuck:master Oct 25, 2022
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

2 participants