Skip to content

jh: implement SerializableState#889

Merged
newpavlov merged 1 commit into
RustCrypto:masterfrom
Ap4sh:ap4sh/jh-serializable-state
Jun 29, 2026
Merged

jh: implement SerializableState#889
newpavlov merged 1 commit into
RustCrypto:masterfrom
Ap4sh:ap4sh/jh-serializable-state

Conversation

@Ap4sh

@Ap4sh Ap4sh commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

part of #546

adds SerializableState for JhCore and exposes it through the public Jh224, Jh256, Jh384, and Jh512 wrappers via FixedHashTraits

the serialized core state stores the 128-byte compressor state plus the processed block count, matching the wrapper-level serialization tests used by the other hash crates

tests:

  • cargo test -p jh --all-features
  • cargo hack test --feature-powerset
  • RUSTFLAGS='-Dwarnings' cargo +1.85.1 hack test --feature-powerset
  • RUSTFLAGS='-Dwarnings' cargo +1.85.1 hack build --target thumbv7em-none-eabi --each-feature --exclude-features default,std
  • RUSTFLAGS='-Dwarnings' cargo +1.85.1 hack build --target wasm32-unknown-unknown --each-feature --exclude-features default,std
  • cargo fmt --all -- --check
  • cargo clippy --all -- -D warnings
  • typos

@Ap4sh Ap4sh force-pushed the ap4sh/jh-serializable-state branch from 05f9b44 to aedabb5 Compare June 28, 2026 17:06

@newpavlov newpavlov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would prefer to resolve #546 as well since it's unclear on the first glance that it's correct to use Compressor finalization like this, but I guess it's fine to merge it now.

@newpavlov newpavlov merged commit e499ef4 into RustCrypto:master Jun 29, 2026
11 checks passed
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