{"id":26933548,"url":"https://github.com/ppad-tech/hkdf","last_synced_at":"2025-04-02T09:19:33.986Z","repository":{"id":271869597,"uuid":"914819462","full_name":"ppad-tech/hkdf","owner":"ppad-tech","description":"(mirror of https://git.ppad.tech/hkdf)","archived":false,"fork":false,"pushed_at":"2025-03-01T04:22:32.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T05:21:07.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppad-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-10T11:21:45.000Z","updated_at":"2025-03-01T04:22:35.000Z","dependencies_parsed_at":"2025-03-01T05:30:04.433Z","dependency_job_id":null,"html_url":"https://github.com/ppad-tech/hkdf","commit_stats":null,"previous_names":["ppad-tech/hkdf"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fhkdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fhkdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fhkdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fhkdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppad-tech","download_url":"https://codeload.github.com/ppad-tech/hkdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785456,"owners_count":20833498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-02T09:19:33.291Z","updated_at":"2025-04-02T09:19:33.975Z","avatar_url":"https://github.com/ppad-tech.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hkdf\n\n[![](https://img.shields.io/hackage/v/ppad-hkdf?color=blue)](https://hackage.haskell.org/package/ppad-hkdf)\n![](https://img.shields.io/badge/license-MIT-brightgreen)\n[![](https://img.shields.io/badge/haddock-hkdf-lightblue)](https://docs.ppad.tech/hkdf)\n\nA HMAC-based key derivation function (HKDF) per\n[RFC5869](https://datatracker.ietf.org/doc/html/rfc5869).\n\n## Usage\n\nA sample GHCi session:\n\n```\n  \u003e :set -XOverloadedStrings\n  \u003e -- import qualified\n  \u003e import qualified Crypto.KDF.HMAC as KDF\n  \u003e\n  \u003e -- supply your own HMAC function\n  \u003e import qualified Crypto.Hash.SHA256 as SHA256\n  \u003e\n  \u003e -- derive a 32-byte key from a secret\n  \u003e KDF.derive SHA256.hmac \"my salt\" \"my optional info\" 32 \"my secret input\"\n  \"\\EM\\232\\v\\140\\202\\230\\f2:\\221n\\221\\209\\233\\US\\209\u003e\\174_!\\138\\255\\\\C\\150\\237^X\\226\\tt\\252\"\n```\n\n## Documentation\n\nHaddocks (API documentation, etc.) are hosted at\n[docs.ppad.tech/hkdf][hadoc].\n\n## Performance\n\nThe aim is best-in-class performance for pure, highly-auditable Haskell\ncode.\n\nCurrent benchmark figures on my mid-2020 MacBook Air look like (use\n`cabal bench` to run the benchmark suite):\n\n```\n  benchmarking ppad-hkdf/HKDF-SHA256/derive (outlen 32)\n  time                 12.69 μs   (12.58 μs .. 12.84 μs)\n                       0.999 R²   (0.999 R² .. 1.000 R²)\n  mean                 12.82 μs   (12.75 μs .. 12.89 μs)\n  std dev              231.0 ns   (190.1 ns .. 299.9 ns)\n  variance introduced by outliers: 16% (moderately inflated)\n\n  benchmarking ppad-hkdf/HKDF-SHA512/derive (outlen 32)\n  time                 12.24 μs   (12.16 μs .. 12.31 μs)\n                       1.000 R²   (1.000 R² .. 1.000 R²)\n  mean                 12.27 μs   (12.22 μs .. 12.32 μs)\n  std dev              172.4 ns   (131.6 ns .. 246.5 ns)\n  variance introduced by outliers: 11% (moderately inflated)\n```\n\n## Security\n\nThis library aims at the maximum security achievable in a\ngarbage-collected language under an optimizing compiler such as GHC, in\nwhich strict constant-timeness can be [challenging to achieve][const].\n\nThe HKDF implementation within has been tested against the [Project\nWycheproof vectors][wyche] available for SHA-256 and SHA-512, using\nthe HMAC functions from [ppad-sha256][sh256] and [ppad-sha512][sh512]\nrespectively.\n\nIf you discover any vulnerabilities, please disclose them via\nsecurity@ppad.tech.\n\n## Development\n\nYou'll require [Nix][nixos] with [flake][flake] support enabled. Enter a\ndevelopment shell with:\n\n```\n$ nix develop\n```\n\nThen do e.g.:\n\n```\n$ cabal repl ppad-hkdf\n```\n\nto get a REPL for the main library.\n\n[nixos]: https://nixos.org/\n[flake]: https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html\n[hadoc]: https://docs.ppad.tech/hkdf\n[sh256]: https://git.ppad.tech/sha256\n[sh512]: https://git.ppad.tech/sha512\n[const]: https://www.chosenplaintext.ca/articles/beginners-guide-constant-time-cryptography.html\n[wyche]: https://github.com/C2SP/wycheproof\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fhkdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppad-tech%2Fhkdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fhkdf/lists"}