FieldReduceOnceRef reduces a value a < 2q.
(a uint32)
| 91 | |
| 92 | // FieldReduceOnceRef reduces a value a < 2q. |
| 93 | func FieldReduceOnceRef(a uint32) FieldElement { |
| 94 | x, b := bits.Sub64(uint64(a), uint64(q), 0) |
| 95 | return FieldElement(x + b*q) |
| 96 | } |
| 97 | |
| 98 | // FieldAdd returns a + b mod q. |
| 99 | func FieldAdd(a, b FieldElement) FieldElement { |