1 { lib, stdenv, fetchurl }:
3 stdenv.mkDerivation rec {
8 url = "https://www.bearssl.org/bearssl-${version}.tar.gz";
9 sha256 = "057zhgy9w4y8z2996r0pq5k2k39lpvmmvz4df8db8qa9f6hvn1b7";
12 outputs = [ "bin" "lib" "dev" "out" ];
14 enableParallelBuilding = true;
17 "AR=${stdenv.cc.targetPrefix}ar"
18 "CC=${stdenv.cc.targetPrefix}cc"
19 "LD=${stdenv.cc.targetPrefix}cc"
20 "LDDLL=${stdenv.cc.targetPrefix}cc"
21 ] ++ lib.optional stdenv.hostPlatform.isStatic "DLL=no";
25 install -D build/brssl $bin/brssl
26 install -D build/testcrypto $bin/testcrypto
27 install -Dm644 -t $lib/lib build/libbearssl.*
28 install -Dm644 -t $dev/include inc/*.h
34 homepage = "https://www.bearssl.org/";
35 description = "An implementation of the SSL/TLS protocol written in C";
37 BearSSL is an implementation of the SSL/TLS protocol (RFC 5246)
38 written in C. It aims at offering the following features:
40 * Be correct and secure. In particular, insecure protocol versions and
41 choices of algorithms are not supported, by design; cryptographic
42 algorithm implementations are constant-time by default.
44 * Be small, both in RAM and code footprint. For instance, a minimal
45 server implementation may fit in about 20 kilobytes of compiled code
46 and 25 kilobytes of RAM.
48 * Be highly portable. BearSSL targets not only “big” operating systems
49 like Linux and Windows, but also small embedded systems and even
50 special contexts like bootstrap code.
52 * Be feature-rich and extensible. SSL/TLS has many defined cipher
53 suites and extensions; BearSSL should implement most of them, and
54 allow extra algorithm implementations to be added afterwards,
55 possibly from third parties.
57 license = lib.licenses.mit;
58 platforms = lib.platforms.all;