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

Implement Pedersen hash #15

Closed
xJonathanLEI opened this issue Jan 10, 2022 · 3 comments · Fixed by #33
Closed

Implement Pedersen hash #15

xJonathanLEI opened this issue Jan 10, 2022 · 3 comments · Fixed by #33

Comments

@xJonathanLEI
Copy link
Owner

We need to implement the equivalent of pedersen_hash from cairo-lang as we'll need it for the signer.

@xJonathanLEI
Copy link
Owner Author

As I'm totally not a cryptographer, the easiest solution to me is to simply create Rust bindings for StarkWare's crypto-cpp library, which already contains the functionalities we need. Tracked here.

@xJonathanLEI
Copy link
Owner Author

The wrapper is now done at starkware-crypto-rs and published to crates.io. It's technically ready for use.

However, it's discovered that a serious performance issue (previously reported here) exists in the library: calling Sign() is very slow. It took over 7 seconds to do a single Sign() call on my machine.

Apparently this is unusable. We need to find an alternative solution.

@xJonathanLEI
Copy link
Owner Author

The performance issue seems to be related to C++ optimization levels, and was fixed in starkware-crypto-rs v0.1.1.

Signing time under the new version is around 180ms on my machine. It's still quite slow, but I think we can deal with it until either a better alternative is available, or we implement it in Rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant