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

Can the Expander implementations be made public? #640

Open
tmarkovski opened this issue Apr 23, 2023 · 4 comments
Open

Can the Expander implementations be made public? #640

tmarkovski opened this issue Apr 23, 2023 · 4 comments

Comments

@tmarkovski
Copy link

The trait Expander in ark_ff and its Xmd and Xof implementations are currently private. We have a need to use the expanders directly for other implementations, like hash_to_scalar (using both ExpandXmd and ExpandXof, as this BBS spec defines two ciphersuites using each expander).
The provided HashToField trait doesn't allow custom implementation since the expanders are private, and the DefaultFieldHasher is only using a subset of the expander module.
Can these module be made public?

@mmagician
Copy link
Member

Yeah I don't see why not. Feel free to submit a PR. If possible, try to keep the existing implementation as default, maybe this doesn't require a breaking change?

@tmarkovski
Copy link
Author

No, I believe it can be done without introducing breaking change. Will make a PR, thanks.

@burdges
Copy link
Contributor

burdges commented Apr 26, 2023

This is one of many problems with the hash-to-curve code. Fixed by #643

The default is really determined by the curve, so it makes no sense to say "default" per se. it does make sense to have a trait on the curve that does everything, which also gives a nicer interface.

@burdges
Copy link
Contributor

burdges commented May 9, 2023

In #643 I improved memory handling for hashing to non-prime order fields, which changes the field trait. If you only hash to prime order fields, then in the short term you could fork whatever parts of #643 you require.

I do this in https://github.com/w3f/ring-vrf/blob/master/ark-transcript/src/lib.rs#L450 for example.

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

No branches or pull requests

3 participants