iden3 / iden3js

Javascript client library of the iden3 system
GNU General Public License v3.0
25 stars 3 forks source link

Safety check: scalar <= subgroup order #136

Open bellesmarta opened 4 years ago

bellesmarta commented 4 years ago

https://github.com/iden3/iden3js/blob/c2844797f553efdb4762d46016c336cde9ec5524/src/crypto/babyjub-utils.js#L60-L62

If this instruction is checking that the scalar generated is less or equal than the order of the subgroup, then babyjub.p should be replaced by babyjub.subOrder (you can check both parameters at https://github.com/iden3/circomlib/blob/master/src/babyjub.js).