- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for TestFieldAdd (0.1 sec)
-
lib/fips140/v1.1.0-rc1.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...Registered: Tue Dec 30 11:13:12 UTC 2025 - Last Modified: Thu Dec 11 16:27:41 UTC 2025 - 663K bytes - Viewed (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)...
Registered: Tue Dec 30 11:13:12 UTC 2025 - Last Modified: Thu Sep 25 19:53:19 UTC 2025 - 642.7K bytes - Viewed (0)