privacy-scaling-explorations / zk-kit

A monorepo of reusable libraries for zero-knowledge technologies.
https://zkkit.pse.dev/
MIT License
257 stars 53 forks source link

refactor(utils): update F1Field.e(res) function to remove the comparison checks with this._order #247

Closed aakansha1234 closed 1 month ago

aakansha1234 commented 1 month ago

F1Field.e(res) checks if it is >= this._order to determine if it needs to take a modulus with this._order. However, in v8 bigint implementation, this check is already present. So this check is not necessary as bigint implementation already does that. This commit removes these checks.

https://github.com/v8/v8/blob/497d8573dc80b1b69052a834bec894cf5d4238e7/src/builtins/builtins-bigint.tq#L380-L383

I was just reading zk-kit's F1Field code after studying modular arithmetic. Please let me know if this is useful!

Checklist

gitpoap-bot[bot] commented 1 month ago

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 ZK-KIT Contributor:

GitPOAP: 2024 ZK-KIT Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

cedoor commented 1 month ago

@aakansha1234 Thank you vm!