Skip to content

Commit

Permalink
T
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Dec 7, 2024
1 parent 99c4915 commit a8880ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/ext/ithaca/BLS.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,22 @@ contract BLSTest is SoladyTest {

function testHashToCurveG2(bytes memory message) public {
bytes memory expected = abi.encode(this.hashToCurveG2Original(message));
bytes memory computed = abi.encode(this.hashToCurveG2Optimized(message));
bytes memory computed = abi.encode(this.hashToCurveG2OptimizedBrutalized(message));
assertEq(computed, expected);
}

function hashToCurveG2Optimized(bytes memory message)
public
view
returns (BLS.G2Point memory result)
{
result = BLS.hashToG2(message);
}

function hashToCurveG2OptimizedBrutalized(bytes memory message)
public
view
returns (BLS.G2Point memory result)
{
_misalignFreeMemoryPointer();
_brutalizeMemory();
Expand Down

0 comments on commit a8880ce

Please sign in to comment.