Skip to content

Commit

Permalink
Merge pull request ethereum#106 from zama-ai/petar/reencrypt-required…
Browse files Browse the repository at this point in the history
…-gas-input

Fix reencrypt input handling on RequiredGas()
  • Loading branch information
dartdart26 authored Jun 7, 2023
2 parents 0727953 + 6148be1 commit db57ed7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,8 @@ type reencrypt struct{}

func (e *reencrypt) RequiredGas(accessibleState PrecompileAccessibleState, input []byte) uint64 {
logger := accessibleState.Interpreter().evm.Logger
if len(input) != 32 {
logger.Error("reencrypt RequiredGas() input len must be 32 bytes", "input", hex.EncodeToString(input), "len", len(input))
if len(input) != 64 {
logger.Error("reencrypt RequiredGas() input len must be 64 bytes", "input", hex.EncodeToString(input), "len", len(input))
return 0
}
ct := getVerifiedCiphertext(accessibleState, common.BytesToHash(input))
Expand Down

0 comments on commit db57ed7

Please sign in to comment.