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

how to sign a msg hash instead of msg with rust bindings? #229

Open
zhiqiangxu opened this issue Jul 17, 2024 · 3 comments
Open

how to sign a msg hash instead of msg with rust bindings? #229

zhiqiangxu opened this issue Jul 17, 2024 · 3 comments

Comments

@zhiqiangxu
Copy link

zhiqiangxu commented Jul 17, 2024

It's not crystally clear from the signatures alone here:

pub fn sign(
                &self,
                msg: &[u8],
                dst: &[u8],
                aug: &[u8],
            )

The golang version is much clearer and can be tuned here:

	if useHash {
		q = HashToG2(msg, dst, augSingle)
	} else {
		q = EncodeToG2(msg, dst, augSingle)
	}

How to make sign do EncodeToG2 instead of HashToG2 in rust?

@dot-asm
Copy link
Collaborator

dot-asm commented Jul 25, 2024

Apparently there is no way. Rust bindings were originally put together with specific applications in mind, and I guess it wasn't originally a concern. And it wasn't an issue so far... Is it a general question or is there actual requirement for it?

@zhiqiangxu
Copy link
Author

@dot-asm For me, this is a genuine requirement. I'm somewhat surprised that the API differs between Go and Rust.

@dot-asm
Copy link
Collaborator

dot-asm commented Jul 30, 2024

I fail to interpret the response unambiguously. It sill sounds more like a general question,as if you personally are genuinely surprised there is a difference. Is there an actual requirement in form of a protocol specification?

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

2 participants