Skip to content

Commit

Permalink
Merge pull request ethereum#121 from zama-ai/petar/raw-fhe-pub-key
Browse files Browse the repository at this point in the history
Return raw FHE public key if called directly
  • Loading branch information
dartdart26 authored Jun 22, 2023
2 parents 5b237b1 + 6f68c19 commit 4818f9c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,12 @@ func (e *fhePubKey) Run(accessibleState PrecompileAccessibleState, caller common
accessibleState.Interpreter().evm.Logger.Error(msg, "existing", existing.Hex(), "pksHash", pksHash.Hex())
return nil, errors.New(msg)
}
return toEVMBytes(pksBytes), nil
// If we have a single byte with the value of 1, return as an EVM array. Otherwise, returh the raw bytes.
if len(input) == 1 && input[0] == 1 {
return toEVMBytes(pksBytes), nil
} else {
return pksBytes, nil
}
}

type trivialEncrypt struct{}
Expand Down

0 comments on commit 4818f9c

Please sign in to comment.