MCPcopy Create free account
hub / github.com/egonelbre/exp / FuzzFieldAdd8

Function FuzzFieldAdd8

mldsa/simd_test.go:43–70  ·  view source on GitHub ↗
(f *testing.F)

Source from the content-addressed store, hash-verified

41}
42
43func FuzzFieldAdd8(f *testing.F) {
44 var z uint32
45 f.Add(
46 z, z, z, z, z, z, z, z,
47 z, z, z, z, z, z, z, z,
48 )
49 f.Fuzz(func(t *testing.T,
50 a0, a1, a2, a3, a4, a5, a6, a7 uint32,
51 b0, b1, b2, b3, b4, b5, b6, b7 uint32,
52 ) {
53 inA := [8]uint32{a0, a1, a2, a3, a4, a5, a6, a7}
54 inB := [8]uint32{b0, b1, b2, b3, b4, b5, b6, b7}
55 exp := [8]FieldElement{}
56
57 for i := range inA {
58 exp[i] = FieldAdd(FieldElement(inA[i]), FieldElement(inB[i]))
59 }
60
61 inA8 := Uint32x8FromArray(inA)
62 inB8 := Uint32x8FromArray(inB)
63 got8 := FieldAdd8(inA8, inB8)
64 got := FieldElement8AsArray(got8)
65
66 if exp != got {
67 t.Fatalf("wrong result a:%v b:%v exp:%v got:%v", inA, inB, exp, got)
68 }
69 })
70}
71
72func FuzzFieldSub8(f *testing.F) {
73 var z uint32

Callers

nothing calls this directly

Calls 6

FieldAddFunction · 0.85
FieldElementTypeAlias · 0.85
Uint32x8FromArrayFunction · 0.85
FieldAdd8Function · 0.85
FieldElement8AsArrayFunction · 0.85
AddMethod · 0.65

Tested by

no test coverage detected