chancehudson / scalarff

Simple scalars in prime fields
https://docs.rs/scalarff
0 stars 0 forks source link

Ordering of prime fields? #1

Closed Sword-Smith closed 2 months ago

Sword-Smith commented 2 months ago

In the mathematical sense prime fields are not ordered. Since any ordering won't satisfy the 1st condition of "Total order" here. So I was just wondering if you're sure it's a good idea to add PartialOrd to the FieldElement trait.

Maybe I'm missing something. In twenty-first (where the "oxfoi" implementation you are using lives), we do actually have a concept of incrementing a "oxfoi" element which can be interpreted as assuming an ordering. But PartialOrd is not implemented. Just curious to hear your thoughts on this.

chancehudson commented 2 months ago

Good catch, ordered comparisons should be made between the real representations (BigUint).