Skip to content

Migrate to digest::newtype! #678

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

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft

Migrate to digest::newtype! #678

wants to merge 18 commits into from

Conversation

newpavlov
Copy link
Member

@newpavlov newpavlov commented Apr 7, 2025

Depends on RustCrypto/traits#1799.

Crates:

  • ascon‑hash
  • belt‑hash
  • blake2
  • fsb
  • gost94
  • groestl
  • jh
  • k12
  • kupyna
  • md2
  • md4
  • md5
  • ripemd
  • sha1-checked
  • sha1
  • sha2
  • sha3
  • shabal
  • skein
  • sm3
  • streebog
  • tiger
  • whirlpool

@newpavlov newpavlov changed the title Migrate to the digest::newtype! macro Migrate to digest::newtype! Apr 8, 2025

impl SerializableState for $name {
// TODO: implement properly with U400
type SerializedStateSize = digest::consts::U0;
Copy link
Member Author

Choose a reason for hiding this comment

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

To properly implement this trait we need to implement optimized serialization for eager hashes (otherwise we would need to implement ArraySize for U537 and U569). I plan to do it in later PRs.


fn serialize(&self) -> SerializedState<Self> {
todo!()
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a placeholder impl. To implement it properly we probably need to resolve #546 first.

@newpavlov newpavlov mentioned this pull request May 5, 2025
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.

1 participant