From c98775a5228d53b205272fd10cdebb8aaa53eb9d Mon Sep 17 00:00:00 2001 From: Petar Ivanov <29689712+dartdart26@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:54:14 +0300 Subject: [PATCH] feat: add external seed in rand precompile APIs Needed for the future. Adding it now to stabilize the API of the the rand precompiles. Not used in random computation yet. --- fhevm/contracts_test.go | 4 ++-- fhevm/fhelib.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fhevm/contracts_test.go b/fhevm/contracts_test.go index 49eeb14..0914087 100644 --- a/fhevm/contracts_test.go +++ b/fhevm/contracts_test.go @@ -1687,7 +1687,7 @@ func FheLibBitXor(t *testing.T, fheUintType tfhe.FheUintType, scalar bool) { } func FheLibRand(t *testing.T, fheUintType tfhe.FheUintType) { - signature := "fheRand(bytes1)" + signature := "fheRand(bytes1,uint256)" depth := 1 environment := newTestEVMEnvironment() environment.depth = depth @@ -1741,7 +1741,7 @@ func FheLibRand(t *testing.T, fheUintType tfhe.FheUintType) { } func FheLibRandBounded(t *testing.T, fheUintType tfhe.FheUintType, upperBound64 uint64) { - signature := "fheRandBounded(uint256,bytes1)" + signature := "fheRandBounded(uint256,bytes1,uint256)" depth := 1 environment := newTestEVMEnvironment() environment.depth = depth diff --git a/fhevm/fhelib.go b/fhevm/fhelib.go index 0db2521..79a76e8 100644 --- a/fhevm/fhelib.go +++ b/fhevm/fhelib.go @@ -97,13 +97,13 @@ var fhelibMethods = []*FheLibMethod{ }, { name: "fheRand", - argTypes: "(bytes1)", + argTypes: "(bytes1,uint256)", requiredGasFunction: fheRandRequiredGas, runFunction: fheRandRun, }, { name: "fheRandBounded", - argTypes: "(uint256,bytes1)", + argTypes: "(uint256,bytes1,uint256)", requiredGasFunction: fheRandBoundedRequiredGas, runFunction: fheRandBoundedRun, },