privacy-scaling-explorations / zk-kit

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

fix(utils): f1-field test now uses prime order #252

Closed 0xbok closed 7 months ago

0xbok commented 7 months ago

Description

f1-field test is using composite order for which inverse of some of the non-zero elements doesn't exist. The invinv fn produces garbage for these values and inv test uses those values for assertion. This commit changes the order to prime number.

I've also tried to improve the tests as some functions were tested on trivial values.

Related Issue(s)

Closes #251

Checklist

0xbok commented 7 months ago

@cedoor unrelated tests are failing due to some noir issues, so this shouldn't block this pr from merging?

cedoor commented 7 months ago

@cedoor unrelated tests are failing due to some noir issues, so this shouldn't block this pr from merging?

No, that's not related to this PR.