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

sha: make compress consume blocks #579

Closed
wants to merge 3 commits into from

Conversation

baloo
Copy link
Member

@baloo baloo commented May 11, 2024

To align with the semantics of block_buffer::BlockBuffer::digest_blocks signature which works with &[Block] and not &[[u8; N]].

@baloo baloo force-pushed the baloo/sha1/compress-block branch from 461de5b to 5a174a3 Compare May 11, 2024 06:17
@baloo baloo changed the title sha1: make compress consume blocks sha: make compress consume blocks May 11, 2024
@baloo baloo force-pushed the baloo/sha1/compress-block branch from 5a174a3 to 4174340 Compare May 11, 2024 06:19
baloo added 3 commits May 10, 2024 23:31
To align with the semantics of `block_buffer::BlockBuffer::digest_blocks`
signature which works with `&[Block]` and not `&[[u8; N]]`.
@baloo baloo force-pushed the baloo/sha1/compress-block branch from 4174340 to 7704e67 Compare May 11, 2024 06:31
@newpavlov
Copy link
Member

We intentionally use byte arrays in compression functions for two reasons:

  • To prepare ground for future migration to const generics (plus, it's useful for hybrid-array as well).
  • To not deal with the somewhat annoying Block imports everywhere.

The compression functions are usually fixed-sized, so I don't think it's worth to expose them to types introduced for dealing with genericity.

@newpavlov newpavlov closed this May 11, 2024
@baloo
Copy link
Member Author

baloo commented May 11, 2024

  • To prepare ground for future migration to const generics (plus, it's useful for hybrid-array as well).

Just to be clear, this was post hybrid-array migration. Block is an alias for hybrid_array::Array already.

@baloo baloo deleted the baloo/sha1/compress-block branch May 11, 2024 20:05
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