Skip to content

Commit

Permalink
feat: expose vector iterator in sis package
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Jan 9, 2025
1 parent 455b89a commit dcf62e0
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions ecc/bls12-377/fr/sis/sis.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ecc/bls12-377/fr/sis/sis_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions field/babybear/sis/sis.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion field/babybear/sis/sis_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions field/generator/internal/templates/sis/sis.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (r *RSis) Hash(v, res []{{ .FF }}.Element) error {
k := make([]{{ .FF }}.Element, r.Degree)

// inner hash
r.InnerHash(&vectorIterator{v: v}, res, k)
r.InnerHash(&VectorIterator{v: v}, res, k)


// reduces mod Xᵈ+1
Expand Down Expand Up @@ -210,12 +210,12 @@ type ElementIterator interface {
Next() ({{ .FF }}.Element, bool)
}

type vectorIterator struct {
type VectorIterator struct {
v {{ .FF }}.Vector
i int
}

func (vi *vectorIterator) Next() ({{ .FF }}.Element, bool) {
func (vi *VectorIterator) Next() ({{ .FF }}.Element, bool) {
if vi.i == len(vi.v) {
return {{ .FF }}.Element{}, false
}
Expand Down
2 changes: 1 addition & 1 deletion field/generator/internal/templates/sis/sis.test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestLimbDecomposeBytes(t *testing.T) {
logTwoBound := 8

for cc:=0;cc<{{- if $f31 }}1{{- else }}3{{- end}}; cc++ {
vr := NewLimbIterator(&vectorIterator{v:a}, logTwoBound/8)
vr := NewLimbIterator(&VectorIterator{v:a}, logTwoBound/8)
m := make({{ .FF }}.Vector, nbElmts*{{ .FF }}.Bytes*8/logTwoBound)
for i := 0; i < len(m); i++ {
m[i][0] = vr.NextLimb()
Expand Down
6 changes: 3 additions & 3 deletions field/goldilocks/sis/sis.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion field/goldilocks/sis/sis_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions field/koalabear/sis/sis.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion field/koalabear/sis/sis_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dcf62e0

Please sign in to comment.