mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
crypto: fix KeccakState undefined reference in ziren build tag
This commit is contained in:
parent
cb08c7e2bb
commit
19def6bfe2
1 changed files with 3 additions and 2 deletions
|
|
@ -21,6 +21,7 @@ package crypto
|
|||
import (
|
||||
"github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/crypto/keccak"
|
||||
)
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
func newZirenKeccakState() KeccakState {
|
||||
func newZirenKeccakState() keccak.KeccakState {
|
||||
return &zirenKeccakState{
|
||||
buf: make([]byte, 0, 512), // pre-allocate reasonable capacity
|
||||
}
|
||||
|
|
@ -85,7 +86,7 @@ func (s *zirenKeccakState) computeHashIfNeeded() {
|
|||
|
||||
// NewKeccakState creates a new KeccakState
|
||||
// This uses a Ziren-optimized implementation that leverages the zkvm_runtime.Keccak256 system call.
|
||||
func NewKeccakState() KeccakState {
|
||||
func NewKeccakState() keccak.KeccakState {
|
||||
return newZirenKeccakState()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue