From 319c0bb69d9c90b631710cc833b76f058a20c29b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 23 Aug 2022 15:01:33 +0200 Subject: [PATCH] python310Packages.paranoid-crypto: init at unstable-20220819 --- .../paranoid-crypto/default.nix | 70 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 72 insertions(+) create mode 100644 pkgs/development/python-modules/paranoid-crypto/default.nix diff --git a/pkgs/development/python-modules/paranoid-crypto/default.nix b/pkgs/development/python-modules/paranoid-crypto/default.nix new file mode 100644 index 000000000000..e7bd9c5848df --- /dev/null +++ b/pkgs/development/python-modules/paranoid-crypto/default.nix @@ -0,0 +1,70 @@ +{ lib +, absl-py +, buildPythonPackage +, cryptography +, fetchFromGitHub +, fpylll +, gmpy +, protobuf +, pybind11 +, pytestCheckHook +, pythonOlder +, scipy +, sympy +}: + +buildPythonPackage rec { + pname = "paranoid-crypto"; + version = "unstable-20220819"; + format = "setuptools"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "google"; + repo = "paranoid_crypto"; + # https://github.com/google/paranoid_crypto/issues/11 + rev = "8abccc1619748b93979d1c26234b90d26e88a12e"; + hash = "sha256-4yF7WAFAGGhvWTV/y5dGVA/+9r1dqrXU/0/6Edgw3ow="; + }; + + nativeBuildInputs = [ + protobuf + pybind11 + ]; + + propagatedBuildInputs = [ + absl-py + cryptography + gmpy + scipy + sympy + protobuf + ]; + + checkInputs = [ + fpylll + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "protobuf==3.20.*" "protobuf" + ''; + + disabledTestPaths = [ + # Import issue + "paranoid_crypto/lib/randomness_tests/" + ]; + + pythonImportsCheck = [ + "paranoid_crypto" + ]; + + meta = with lib; { + description = "Library contains checks for well known weaknesses on cryptographic artifacts"; + homepage = "https://github.com/google/paranoid_crypto"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c623e8dff792..e56b6799b75d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6500,6 +6500,8 @@ in { paramz = callPackage ../development/python-modules/paramz { }; + paranoid-crypto = callPackage ../development/python-modules/paranoid-crypto { }; + parfive = callPackage ../development/python-modules/parfive { }; parquet = callPackage ../development/python-modules/parquet { };