{ "name": "nettle", "version": "4.0", "summary": "Nettle: a low-level cryptographic library (hashes, ciphers, MACs, AEAD; public-key in libhogweed over GMP)", "category": "library", "license": "LGPL-3.0-or-later OR GPL-2.0-or-later", "homepage": "https://www.lysator.liu.se/~nisse/nettle/", "source": { "url": "https://mirrors.kernel.org/gnu/nettle/nettle-4.0.tar.gz", "sha256": "3addbc00da01846b232fb3bc453538ea5468da43033f21bb345cb1e9073f5094" }, "watch": {"kind": "index", "url": "https://mirrors.kernel.org/gnu/nettle/", "regex": "nettle-([0-9]+(?:\\.[0-9]+)+)\\.tar\\.gz"}, "deps": [ "gmp" ], "env_packages": [], "static": true, "nss": false, "check": "t=$(mktemp -d) && printf abc | bin/nettle-hash -a sha256 | has -x 'ba7816bf8f01cfea 414140de5dae2223 b00361a396177a9c b410ff61f20015ad sha256' && check_lib \"hogweed nettle\" \"nettle/sha2.h nettle/aes.h nettle/gcm.h nettle/rsa.h nettle/yarrow.h nettle/version.h\" 'struct sha256_ctx h; uint8_t d[32], key[16] = {0}, iv[12] = {0}, ct[16], pt[16], tag[16]; struct gcm_aes128_ctx g; struct rsa_public_key pub; struct rsa_private_key priv; struct yarrow256_ctx y; int ok; sha256_init(&h); sha256_update(&h, 3, (const uint8_t *)\"abc\"); sha256_digest(&h, d); gcm_aes128_set_key(&g, key); gcm_aes128_set_iv(&g, 12, iv); gcm_aes128_encrypt(&g, 16, ct, (const uint8_t *)\"bvs nettle 16 b.\"); gcm_aes128_digest(&g, tag); gcm_aes128_set_iv(&g, 12, iv); gcm_aes128_decrypt(&g, 16, pt, ct); yarrow256_init(&y, 0, NULL); yarrow256_seed(&y, 32, d); rsa_public_key_init(&pub); rsa_private_key_init(&priv); ok = rsa_generate_keypair(&pub, &priv, &y, (nettle_random_func *)yarrow256_random, NULL, NULL, 1024, 30); printf(\"nettle %d.%d: SHA-256 of abc, AES-128-GCM there and back, a 1024-bit RSA key pair\\n\", nettle_version_major(), nettle_version_minor()); return d[0] != 0xba || d[31] != 0xad || memcmp(pt, \"bvs nettle 16 b.\", 16) || !ok' > \"$t/lib\" && echo 'nettle 4.0: nettle-hash gives the SHA-256 of abc; SHA-256, AES-128-GCM and an RSA key pair through check_lib (libhogweed)'" }