starkex-resources icon indicating copy to clipboard operation
starkex-resources copied to clipboard

Pedersen function of signature.js cannot hash starknet public keys

Open merkle-groot opened this issue 3 years ago • 0 comments

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.

merkle-groot avatar Nov 28 '21 09:11 merkle-groot