Skip to content

[frontend] Add message tweaking function#820

Closed
paulcadman wants to merge 1 commit into08-20-_frontend_add_hash_chain_verificationfrom
add_message_tweak_function
Closed

[frontend] Add message tweaking function#820
paulcadman wants to merge 1 commit into08-20-_frontend_add_hash_chain_verificationfrom
add_message_tweak_function

Conversation

@paulcadman
Copy link
Copy Markdown
Contributor

@paulcadman paulcadman commented Aug 27, 2025

This PR adds a Keccak256 tweak circuit that will be used to hash the messagfe in the hash-based signature scheme.

Copy link
Copy Markdown
Contributor Author

paulcadman commented Aug 27, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread crates/frontend/src/circuits/hash_based_sig/tweak/message.rs
@paulcadman paulcadman changed the base branch from hash_tweaking_function to graphite-base/820 August 27, 2025 18:26
@paulcadman paulcadman force-pushed the add_message_tweak_function branch from b497b5d to e0e55b4 Compare August 27, 2025 18:27
@paulcadman paulcadman changed the base branch from graphite-base/820 to 08-20-_frontend_add_hash_chain_verification August 27, 2025 18:27
@paulcadman paulcadman marked this pull request as ready for review August 28, 2025 15:23
@paulcadman paulcadman requested a review from jadnohra August 28, 2025 15:48
@paulcadman paulcadman force-pushed the 08-20-_frontend_add_hash_chain_verification branch from b59374d to fb9a470 Compare August 28, 2025 17:46
@paulcadman paulcadman force-pushed the add_message_tweak_function branch from e0e55b4 to 4564793 Compare August 28, 2025 17:46
Copy link
Copy Markdown
Contributor

@jadnohra jadnohra left a comment

Choose a reason for hiding this comment

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

These requests are debatable, happy to discuss.

Function Names

  • verify_chain_tweak() → compute_chain_hash()
  • verify_message_tweak() → compute_message_hash()
  • verify_chain() → verify_hash_chain()
  • verify_tweaked_keccak() → compute_tweaked_hash()

Issue: "verify" prefix misleading - these build hash circuits, don't verify signatures

Variable Names

  • coordinate → starting_position (clearer semantics)
  • signature_chunk → signature_hash (it's a hash, not a chunk)
  • param → domain_param (more specific)
  • end_hash → public_key_element (describes role)

Module Structure

Current:
hash_based_sig/
├── chain.rs
└── tweak/chain.rs // name collision

Suggested:
hash_based_sig/
├── chain_verification.rs
└── hashing/
├── chain.rs
└── message.rs

Comment thread crates/frontend/src/circuits/hash_based_sig/tweak/message.rs Outdated
Comment thread crates/frontend/src/circuits/hash_based_sig/hashing/message.rs
@paulcadman paulcadman force-pushed the add_message_tweak_function branch from db9c4d1 to 7fc6c27 Compare September 1, 2025 08:39
@paulcadman paulcadman force-pushed the 08-20-_frontend_add_hash_chain_verification branch from 5f86282 to 77b3d19 Compare September 1, 2025 08:39
Copy link
Copy Markdown
Contributor Author

I've made the changes to the module structure and variable names that you suggested. For function names, I've changed to using the convention of adding a circuit_ prefix to functions that build a circuit.

@paulcadman paulcadman requested a review from jadnohra September 1, 2025 08:41
@paulcadman paulcadman force-pushed the 08-20-_frontend_add_hash_chain_verification branch from 77b3d19 to 3e16df7 Compare September 1, 2025 12:08
@paulcadman paulcadman force-pushed the add_message_tweak_function branch from 7fc6c27 to c6feda2 Compare September 1, 2025 12:08
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Sep 1, 2025

Merge activity

  • Sep 1, 3:16 PM UTC: paulcadman added this pull request to the Graphite merge queue.
  • Sep 1, 3:16 PM UTC: CI is running for this pull request on a draft pull request (#897) due to your merge queue CI optimization settings.
  • Sep 1, 3:22 PM UTC: Merged by the Graphite merge queue via draft PR: #897.

graphite-app bot pushed a commit that referenced this pull request Sep 1, 2025
This PR adds a Keccak256 tweak circuit that will be used to hash the messagfe in the hash-based signature scheme.
@graphite-app graphite-app bot closed this Sep 1, 2025
@graphite-app graphite-app bot deleted the add_message_tweak_function branch September 1, 2025 15:22
lockedloop pushed a commit that referenced this pull request Sep 8, 2025
This PR adds a Keccak256 tweak circuit that will be used to hash the messagfe in the hash-based signature scheme.
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