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

Pedersen function of signature.js cannot hash starknet public keys #11

Open
merkle-groot opened this issue Nov 28, 2021 · 0 comments
Open

Comments

@merkle-groot
Copy link

Issue

Signaure.js serves as a library to perform cryptographic functions required in starknet smart-contracts. The Pedersen Hash implementation in it doesn't allow for hashing of starknet public keys.

The issue is due to failure of assertion inside the function, which only takes input between 0 (not included) to '800000000000011000000000000000000000000000000000000000000000001'.

assert(x.gte(zeroBn) && x.lt(prime), 'Invalid input: ' + input[i]);

The python implementation of the same function is able to compute the pedersen hash.

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

1 participant