mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
crypto: fix KeccakState undefined reference in ziren build tag
This commit is contained in:
parent
92c302f22c
commit
dbb657241f
1 changed files with 3 additions and 2 deletions
|
|
@ -21,6 +21,7 @@ package crypto
|
||||||
import (
|
import (
|
||||||
"github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime"
|
"github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/crypto/keccak"
|
||||||
)
|
)
|
||||||
|
|
||||||
// zirenKeccakState implements the KeccakState interface using the Ziren zkvm_runtime.
|
// zirenKeccakState implements the KeccakState interface using the Ziren zkvm_runtime.
|
||||||
|
|
@ -31,7 +32,7 @@ type zirenKeccakState struct {
|
||||||
dirty bool // whether new data has been written since last hash
|
dirty bool // whether new data has been written since last hash
|
||||||
}
|
}
|
||||||
|
|
||||||
func newZirenKeccakState() KeccakState {
|
func newZirenKeccakState() keccak.KeccakState {
|
||||||
return &zirenKeccakState{
|
return &zirenKeccakState{
|
||||||
buf: make([]byte, 0, 512), // pre-allocate reasonable capacity
|
buf: make([]byte, 0, 512), // pre-allocate reasonable capacity
|
||||||
}
|
}
|
||||||
|
|
@ -85,7 +86,7 @@ func (s *zirenKeccakState) computeHashIfNeeded() {
|
||||||
|
|
||||||
// NewKeccakState creates a new KeccakState
|
// NewKeccakState creates a new KeccakState
|
||||||
// This uses a Ziren-optimized implementation that leverages the zkvm_runtime.Keccak256 system call.
|
// This uses a Ziren-optimized implementation that leverages the zkvm_runtime.Keccak256 system call.
|
||||||
func NewKeccakState() KeccakState {
|
func NewKeccakState() keccak.KeccakState {
|
||||||
return newZirenKeccakState()
|
return newZirenKeccakState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue