Skip to content

Commit

Permalink
feat: add external seed in rand precompile APIs
Browse files Browse the repository at this point in the history
Needed for the future. Adding it now to stabilize the API of the the
rand precompiles. Not used in random computation yet.
  • Loading branch information
dartdart26 committed Jun 19, 2024
1 parent 47dccc3 commit c98775a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fhevm/contracts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions fhevm/fhelib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit c98775a

Please sign in to comment.