{
    "Function": "slitherConstructorConstantVariables",
    "File": "src/util/ECCMath.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "library ECCMath {\n    error InvalidPoint();\n\n    // https://eips.ethereum.org/EIPS/eip-197#definition-of-the-groups\n    uint256 internal constant GX = 1;\n    uint256 internal constant GY = 2;\n\n    struct Point {\n        uint256 x;\n        uint256 y;\n    }\n\n    /// @notice returns the corresponding public key of the private key\n    /// @dev calculates G^k, aka G^privateKey = publicKey\n    function publicKey(uint256 privateKey) internal view returns (Point memory) {\n        return ecMul(Point(GX, GY), privateKey);\n    }\n\n    /// @notice calculates point^scalar\n    /// @dev returns (1,1) if the ecMul failed or invalid parameters\n    /// @return corresponding point\n    function ecMul(Point memory point, uint256 scalar) internal view returns (Point memory) {\n        bytes memory data = abi.encode(point, scalar);\n        if (scalar == 0 || (point.x == 0 && point.y == 0)) return Point(1, 1);\n        (bool res, bytes memory ret) = address(0x07).staticcall{gas: 6000}(data);\n        if (!res) return Point(1, 1);\n        return abi.decode(ret, (Point));\n    }\n\n    /// @dev after encryption, both the seller and buyer private keys can decrypt\n    /// @param encryptToPub public key to which the message gets encrypted\n    /// @param encryptWithPriv private key to use for encryption\n    /// @param message arbitrary 32 bytes\n    function encryptMessage(Point memory encryptToPub, uint256 encryptWithPriv, bytes32 message)\n        internal\n        view\n        returns (Point memory buyerPub, bytes32 encryptedMessage)\n    {\n        Point memory sharedPoint = ecMul(encryptToPub, encryptWithPriv);\n        bytes32 sharedKey = hashPoint(sharedPoint);\n        encryptedMessage = message ^ sharedKey;\n        buyerPub = publicKey(encryptWithPriv);\n    }\n\n    /// @notice decrypts a message that was encrypted using `encryptMessage()`\n    /// @param sharedPoint G^k1^k2 where k1 and k2 are the\n    ///      private keys of the two parties that can decrypt\n    function decryptMessage(Point memory sharedPoint, bytes32 encryptedMessage)\n        internal\n        pure\n        returns (bytes32 decryptedMessage)\n    {\n        return encryptedMessage ^ hashPoint(sharedPoint);\n    }\n\n    /// @dev we hash the point because unsure if x,y is normal distribution (source needed)\n    function hashPoint(Point memory point) internal pure returns (bytes32) {\n        return keccak256(abi.encode(point));\n    }\n}"
}