about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/SP800-90B_EntropyAssessment/default.nix
blob: f2ff558168d54f90ff2c21d1d5d0b5840cb30b20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, stdenv
, fetchFromGitHub
, bzip2
, libdivsufsort
, jsoncpp
, openssl
, mpfr
}:

stdenv.mkDerivation rec {
  pname = "SP800-90B_EntropyAssessment";
  version = "1.1.6";

  src = fetchFromGitHub {
    owner = "usnistgov";
    repo = "SP800-90B_EntropyAssessment";
    rev = "v${version}";
    hash = "sha256-KZQ7kC0PbBkjLEQZIqYakQ91OvCxruhdfUwiRHtno3w=";
  };

  buildInputs = [ bzip2 libdivsufsort jsoncpp openssl mpfr ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace "-march=native" ""
  '';

  sourceRoot = "source/cpp";

  makeFlags = [
    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
    "ARCH=${stdenv.hostPlatform.linuxArch}"
  ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    cp ea_* $out/bin
    runHook postInstall
  '';

  meta = {
    homepage = "https://github.com/usnistgov/SP800-90B_EntropyAssessment";
    description = "Implementation of min-entropy assessment methods included in Special Publication 800-90B";
    platforms = lib.platforms.linux;
    license = lib.licenses.free; #this software uses the NIST software license
    maintainers = with lib.maintainers; [ orichter thillux ];
  };
}