Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0aa0 committed Jul 25, 2023
1 parent c9f3927 commit e89c919
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/contracts/middleware/BLSPublicKeyCompendium.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ contract BLSPublicKeyCompendium is IBLSPublicKeyCompendium {

// e(sigma + P * gamma, [-1]_2) = e(H(m) + [1]_1 * gamma, P')
require(BN254.pairing(
signedMessageHash.plus(BN254.scalar_mul(pubkeyG1, gamma)),
signedMessageHash.plus(pubkeyG1.scalar_mul(gamma)),
BN254.negGeneratorG2(),
messageHash.plus(BN254.scalar_mul(BN254.generatorG1(), gamma)),
messageHash.plus(BN254.generatorG1().scalar_mul(gamma)),
pubkeyG2
), "BLSPublicKeyCompendium.registerBLSPublicKey: G1 and G2 private key do not match");

Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/BLSPublicKeyCompendiumUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ contract BLSPublicKeyCompendiumUnitTests is Test {
vm.prank(alice);
compendium.registerBLSPublicKey(signedMessageHash, pubKeyG1, pubKeyG2);

assert(compendium.operatorToPubkeyHash(alice) == BN254.hashG1Point(pubKeyG1));
assert(compendium.pubkeyHashToOperator(BN254.hashG1Point(pubKeyG1)) == alice);
assertEq(compendium.operatorToPubkeyHash(alice), BN254.hashG1Point(pubKeyG1), "pubkey hash not stored correctly");
assertEq(compendium.pubkeyHashToOperator(BN254.hashG1Point(pubKeyG1)), alice, "operator address not stored correctly");
}

function testRegisterBLSPublicKey_NoMatch_Reverts() public {
Expand Down

0 comments on commit e89c919

Please sign in to comment.