Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct pairing docstrings #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions contracts/BN256G1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ library BN256G1 {
PP);
}

/// @dev Checks if e(P, Q) = e (R,S).
/// @dev Checks if 1 = e(P, Q)*e(R, S).
/// @param input: 12 values of 256 bits each:
/// *) x-coordinate of point P
/// *) y-coordinate of point P
/// *) x real coordinate of point Q
/// *) x imaginary coordinate of point Q
/// *) y real coordinate of point Q
/// *) x real coordinate of point Q
/// *) y imaginary coordinate of point Q
/// *) y real coordinate of point Q
/// *) x-coordinate of point R
/// *) y-coordinate of point R
/// *) x real coordinate of point S
/// *) x imaginary coordinate of point S
/// *) y real coordinate of point S
/// *) x real coordinate of point S
/// *) y imaginary coordinate of point S
/// @return true if e(P, Q) = e (R,S).
/// *) y real coordinate of point S
/// @return true if 1 = e(P, Q)*e(R, S).
function bn256CheckPairing(uint256[12] memory input) internal returns (bool) {
uint256[1] memory result;
bool success;
Expand All @@ -121,22 +121,22 @@ library BN256G1 {
return result[0] == 1;
}

/// @dev Checks if e(P, Q) = e (R,S)*e(T,U)...
/// @dev Checks if 1 = e(P, Q)*e (R,S)*e(T,U)...
/// @param input: A modulo 6 length array of values of 256 bits each:
/// *) x-coordinate of point P
/// *) y-coordinate of point P
/// *) x real coordinate of point Q
/// *) x imaginary coordinate of point Q
/// *) y real coordinate of point Q
/// *) x real coordinate of point Q
/// *) y imaginary coordinate of point Q
/// *) y real coordinate of point Q
/// *) x-coordinate of point R
/// *) y-coordinate of point R
/// *) x real coordinate of point S
/// *) x imaginary coordinate of point S
/// *) y real coordinate of point S
/// *) x real coordinate of point S
/// *) y imaginary coordinate of point S
/// *) y real coordinate of point S
/// *) and so forth with additional pairing checks
/// @return true if e(input[0,1], input[2,3,4,5]) = e(input[6,7], input[8,9,10,11])*e(input[12,13], input[14,15,16,17])...
/// @return true if 1 = e(input[0,1], input[2,3,4,5])*e(input[6,7], input[8,9,10,11])*e(input[12,13], input[14,15,16,17])...
function bn256CheckPairingBatch(uint256[] memory input) internal returns (bool) {
uint256[1] memory result;
bool success;
Expand Down