nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 absl-py,
4 buildPythonPackage,
5 cryptography,
6 fetchFromGitHub,
7 fpylll,
8 gmpy,
9 protobuf,
10 pybind11,
11 pytestCheckHook,
12 scipy,
13 sympy,
14}:
15
16buildPythonPackage {
17 pname = "paranoid-crypto";
18 version = "unstable-20220819";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "google";
23 repo = "paranoid_crypto";
24 # https://github.com/google/paranoid_crypto/issues/11
25 rev = "8abccc1619748b93979d1c26234b90d26e88a12e";
26 hash = "sha256-4yF7WAFAGGhvWTV/y5dGVA/+9r1dqrXU/0/6Edgw3ow=";
27 };
28
29 nativeBuildInputs = [
30 protobuf
31 pybind11
32 ];
33
34 propagatedBuildInputs = [
35 absl-py
36 cryptography
37 gmpy
38 scipy
39 sympy
40 protobuf
41 ];
42
43 nativeCheckInputs = [
44 fpylll
45 pytestCheckHook
46 ];
47
48 postPatch = ''
49 substituteInPlace requirements.txt \
50 --replace "protobuf==3.20.*" "protobuf"
51 '';
52
53 disabledTestPaths = [
54 # Import issue
55 "paranoid_crypto/lib/randomness_tests/"
56 ];
57
58 pythonImportsCheck = [ "paranoid_crypto" ];
59
60 meta = {
61 description = "Library contains checks for well known weaknesses on cryptographic artifacts";
62 homepage = "https://github.com/google/paranoid_crypto";
63 license = with lib.licenses; [ asl20 ];
64 maintainers = with lib.maintainers; [ fab ];
65 };
66}