Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
run: go vet ./...

- name: golangci-lint
uses: golangci/golangci-lint-action@v7 # latest major as of Mar 2025
uses: golangci/golangci-lint-action@v7
with:
version: v2.1.0 # pick a specific linter version
version: v2.1.0
working-directory: ${{ env.PROJECT_DIR }}
args: --timeout=5m
1 change: 1 addition & 0 deletions gnark-whir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
whir-verifier-circuit
26 changes: 13 additions & 13 deletions gnark-whir/keccakSponge/keccakSponge.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
)

type Digest struct {
api frontend.API
uapi *uints.BinaryField[uints.U64]
state [25]uints.U64
absorb_pos int
squeeze_pos int
api frontend.API
uapi *uints.BinaryField[uints.U64]
state [25]uints.U64
absorb_pos int
squeeze_pos int
}

func NewKeccak(api frontend.API) (*Digest, error) {
Expand All @@ -20,17 +20,17 @@ func NewKeccak(api frontend.API) (*Digest, error) {
return nil, err
}
return &Digest{
api: api,
uapi: uapi,
state: newState(),
absorb_pos: 0,
squeeze_pos: 136,
api: api,
uapi: uapi,
state: newState(),
absorb_pos: 0,
squeeze_pos: 136,
}, nil
}

func NewKeccakWithTag(api frontend.API, tag []frontend.Variable) (*Digest, error) {
d, _ := NewKeccak(api)
for i := 136; i < 136 + len(tag); i++ {
for i := 136; i < 136+len(tag); i++ {
d.state[i/8][i%8].Val = tag[i-136]
}

Expand All @@ -47,7 +47,7 @@ func (d *Digest) Absorb(in []frontend.Variable) {
if d.absorb_pos == 136 {
d.state = keccakf.Permute(d.uapi, d.state)
d.absorb_pos = 0
}
}
d.state[d.absorb_pos/8][d.absorb_pos%8] = inputByte
d.absorb_pos++
}
Expand Down Expand Up @@ -79,4 +79,4 @@ func newState() (state [25]uints.U64) {
state[i] = uints.NewU64(0)
}
return
}
}
Loading