2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cached-property
|
|
|
|
, eth-typing
|
|
|
|
, eth-utils
|
|
|
|
, pytestCheckHook
|
2024-02-29 20:09:43 +00:00
|
|
|
, pythonAtLeast
|
2022-06-16 17:23:12 +00:00
|
|
|
, pythonOlder
|
2024-02-29 20:09:43 +00:00
|
|
|
, setuptools
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "py-ecc";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "7.0.0";
|
|
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = "py_ecc";
|
|
|
|
rev = "v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-DKe+bI1GEzXg4Y4n5OA1/hWYz9L3X1AvaOFPEnCaAfs=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cached-property
|
|
|
|
eth-typing
|
|
|
|
eth-utils
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# https://github.com/ethereum/py_ecc/issues/133
|
|
|
|
"test_FQ2_object"
|
|
|
|
"test_pairing_bilinearity_on_G1"
|
|
|
|
"test_pairing_bilinearity_on_G2"
|
|
|
|
"test_pairing_composit_check"
|
|
|
|
"test_pairing_is_non_degenerate"
|
|
|
|
"test_pairing_negative_G1"
|
|
|
|
"test_pairing_negative_G2"
|
|
|
|
"test_pairing_output_order"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonImportsCheck = [ "py_ecc" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/ethereum/py_ecc/blob/${src.rev}/CHANGELOG.rst";
|
2022-06-16 17:23:12 +00:00
|
|
|
description = "ECC pairing and bn_128 and bls12_381 curve operations";
|
|
|
|
homepage = "https://github.com/ethereum/py_ecc";
|
|
|
|
license = licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|