- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for TestFieldAdd (0.28 seconds)
-
lib/fips140/v1.26.0.zip
fieldElement((uint64(a) * R) % q) if m != exp { t.Fatalf("fieldToMontgomery(%d) = %d, expected %d", a, m, exp) } got := fieldFromMontgomery(m) if got != a { t.Fatalf("fieldFromMontgomery(fieldToMontgomery(%d)) = %d, expected %d", a, got, a) } } } func TestFieldAdd(t *testing.T) { t.Parallel() for _, a := range interestingValues() { for b := range fieldElement(q) { got := fieldAdd(a.m, b) exp := (a.m + b) % q if got != exp { t.Fatalf("%d + %d = %d, expected %d", a, b, got, exp) } } } } func TestFieldSub(t...Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Jan 08 17:58:32 GMT 2026 - 660.3K bytes - Click Count (0) -
lib/fips140/v1.0.0-c2097c7c.zip
mathrand "math/rand/v2" "strconv" "testing" ) func TestFieldReduce(t *testing.T) { for a := uint32(0); a < 2*q*q; a++ { got := fieldReduce(a) exp := fieldElement(a % q) if got != exp { t.Fatalf("reduce(%d) = %d, expected %d", a, got, exp) } } } func TestFieldAdd(t *testing.T) { for a := fieldElement(0); a < q; a++ { for b := fieldElement(0); b < q; b++ { got := fieldAdd(a, b) exp := (a + b) % q if got != exp { t.Fatalf("%d + %d = %d, expected %d", a, b, got, exp) } } } } func TestFieldSub(t *testing.T)...
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Sep 25 19:53:19 GMT 2025 - 642.7K bytes - Click Count (0)