diff --git a/test/src/concrete/Flow.expression.t.sol b/test/src/concrete/Flow.expression.t.sol index 4ee547d0..f2760611 100644 --- a/test/src/concrete/Flow.expression.t.sol +++ b/test/src/concrete/Flow.expression.t.sol @@ -55,8 +55,7 @@ contract FlowExpressionTest is FlowTest, IInterpreterCallerV2 { SignedContextV1[] memory signedContext = new SignedContextV1[](matrixCallerContext.length); { - // Ensure the fuzzed key is within the valid range for secp256k1 - uint256 aliceKey = (fuzzedKeyAlice % (SECP256K1_ORDER - 1)) + 1; + uint256 aliceKey = boundPrivateKey(fuzzedKeyAlice); for (uint256 i = 0; i < matrixCallerContext.length; i++) { signedContext[i] = vm.signContext(aliceKey, aliceKey, matrixCallerContext[i]); } diff --git a/test/src/concrete/Flow.signedContext.t.sol b/test/src/concrete/Flow.signedContext.t.sol index beabbeae..971218f9 100644 --- a/test/src/concrete/Flow.signedContext.t.sol +++ b/test/src/concrete/Flow.signedContext.t.sol @@ -23,9 +23,8 @@ contract FlowSignedContextTest is FlowTest { vm.assume(fuzzedKeyBob != fuzzedKeyAlice); (IFlowV5 flow, EvaluableV2 memory evaluable) = deployFlow(); - // Ensure the fuzzed key is within the valid range for secp256k1 - uint256 aliceKey = (fuzzedKeyAlice % (SECP256K1_ORDER - 1)) + 1; - uint256 bobKey = (fuzzedKeyBob % (SECP256K1_ORDER - 1)) + 1; + uint256 aliceKey = boundPrivateKey(fuzzedKeyAlice); + uint256 bobKey = boundPrivateKey(fuzzedKeyBob); SignedContextV1[] memory signedContexts = new SignedContextV1[](2); @@ -56,9 +55,8 @@ contract FlowSignedContextTest is FlowTest { vm.assume(fuzzedKeyBob != fuzzedKeyAlice); (IFlowV5 flow, EvaluableV2 memory evaluable) = deployFlow(); - // Ensure the fuzzed key is within the valid range for secp256k1 - uint256 aliceKey = (fuzzedKeyAlice % (SECP256K1_ORDER - 1)) + 1; - uint256 bobKey = (fuzzedKeyBob % (SECP256K1_ORDER - 1)) + 1; + uint256 aliceKey = boundPrivateKey(fuzzedKeyAlice); + uint256 bobKey = boundPrivateKey(fuzzedKeyBob); SignedContextV1[] memory signedContext = new SignedContextV1[](1); signedContext[0] = vm.signContext(aliceKey, aliceKey, context0);