Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Signed-off-by: Sally MacFarlane <[email protected]>
  • Loading branch information
macfarla committed Apr 26, 2023
2 parents ccbdd7b + 05a631c commit c401c4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions src/main/java/net/consensys/linea/zktracer/module/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ public static Boolean[] byteBits(final UnsignedByte b) {
return bits;
}

public static byte boolToByte(boolean b) {
if (b) {
return 1;
}
return 0;
}

/**
* Checks if the shifted UInt256 argument overflows a given maximum value, and throws an exception
* with an error message if it does.
Expand Down Expand Up @@ -126,9 +119,21 @@ public static UInt256 multiplyRange(Bytes[] range1, Bytes[] range2) {
UInt256 sum = UInt256.ZERO;
for (int i = 0; i < range1.length; i++) {
UInt256 prod =
UInt256.fromBytes(range1[i]).multiply(UInt256.fromBytes(range2[range2.length - i - 1]));
UInt256.fromBytes(range1[i]).multiply(UInt256.fromBytes(range2[range2.length - i - 1]));
sum = sum.add(prod);
}
return sum;
}
/**
* Converts a boolean value to a byte (1 for true and 0 for false).
*
* @param b The boolean value to be converted.
* @return A byte representing the input boolean value.
*/
public static byte boolToByte(boolean b) {
if (b) {
return 1;
}
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MulTracerTest extends AbstractModuleTracerCorsetTest {

@ParameterizedTest()
@MethodSource("provideRandomAluMulArguments")
void aluModTest(OpCode opCode, final Bytes32 arg1, Bytes32 arg2) {
void aluMulTest(OpCode opCode, final Bytes32 arg1, Bytes32 arg2) {
runTest(opCode, List.of(arg1, arg2));
}

Expand Down

0 comments on commit c401c4c

Please sign in to comment.