aead

Pure Haskell AEAD-ChaCha20-Poly1305 (docs.ppad.tech/aead).
git clone git://git.ppad.tech/aead.git
Log | Files | Refs | README | LICENSE

commit b6179f44be357fb8737a3c00e5e9e29dc8c8249e
parent 88859fcc42aa6187cb7e3c028e5da807c5a3df2e
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 21 Jun 2025 14:39:54 +0400

release: v0.3.0

Diffstat:
MCHANGELOG | 5+++++
MREADME.md | 20+++++++++-----------
Mflake.lock | 16++++++++--------
Mppad-aead.cabal | 6+++---
4 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,5 +1,10 @@ # Changelog +- 0.2.0 (2025-06-21) + * The 'encrypt' and 'decrypt' functions are now total, returning 'Left + InvalidKey', 'Left InvalidNonce', or 'Left InvalidMAC' values when + passed the corresponding bad inputs. + - 0.1.0 (2025-03-09) * Initial release, supporting the ChaCha20-Poly1305 configuration. diff --git a/README.md b/README.md @@ -53,23 +53,21 @@ The aim is best-in-class performance for pure, highly-auditable Haskell code. Current benchmark figures on a simple input from the RFC8439 appendices -on my mid-2020 MacBook Air look like (use `cabal bench` to run the +on an M4 Silicon MacBook Air look like (use `cabal bench` to run the benchmark suite): ``` benchmarking ppad-aead/encrypt - time 23.27 μs (22.45 μs .. 24.06 μs) - 0.993 R² (0.989 R² .. 0.996 R²) - mean 22.67 μs (22.17 μs .. 23.21 μs) - std dev 1.795 μs (1.486 μs .. 2.180 μs) - variance introduced by outliers: 78% (severely inflated) + time 10.03 μs (10.02 μs .. 10.03 μs) + 1.000 R² (1.000 R² .. 1.000 R²) + mean 10.04 μs (10.04 μs .. 10.05 μs) + std dev 9.024 ns (7.330 ns .. 11.99 ns) benchmarking ppad-aead/decrypt - time 25.92 μs (25.15 μs .. 26.64 μs) - 0.993 R² (0.990 R² .. 0.996 R²) - mean 25.88 μs (25.23 μs .. 26.56 μs) - std dev 2.183 μs (1.860 μs .. 2.642 μs) - variance introduced by outliers: 80% (severely inflated) + time 10.06 μs (10.05 μs .. 10.07 μs) + 1.000 R² (1.000 R² .. 1.000 R²) + mean 10.07 μs (10.06 μs .. 10.08 μs) + std dev 26.50 ns (21.66 ns .. 32.02 ns) ``` ## Security diff --git a/flake.lock b/flake.lock @@ -85,11 +85,11 @@ ] }, "locked": { - "lastModified": 1749626971, - "narHash": "sha256-+jWE4Kq7Q2KB5jCu2S++TQYHujVVkqsamnf0BXKDTIA=", + "lastModified": 1750501666, + "narHash": "sha256-vIZrbi7ozlsZ0yMUxz7BAX7KsgTvsWS+MfCJEfGxu+o=", "ref": "master", - "rev": "efad15250e776b00cf37535c18ffc01c520fc679", - "revCount": 18, + "rev": "9adca9651d3098b8fa2ce48f663c5ac6105dc90e", + "revCount": 20, "type": "git", "url": "git://git.ppad.tech/chacha.git" }, @@ -139,11 +139,11 @@ ] }, "locked": { - "lastModified": 1749628515, - "narHash": "sha256-6idwz4Wh+MHGgNorwWyGEUKxovBEtlEYx0JdHNYBE0I=", + "lastModified": 1750502056, + "narHash": "sha256-0KJgniap/pyKsEvTh2SgA/D4zzX194P/oAzJv3fSVdM=", "ref": "master", - "rev": "21be7b8655da65e8da88fa89ad155b5d91bf5885", - "revCount": 15, + "rev": "9a67f66c8d0a9292aa5b86a620be6c4d8c7d66d2", + "revCount": 17, "type": "git", "url": "git://git.ppad.tech/poly1305.git" }, diff --git a/ppad-aead.cabal b/ppad-aead.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: ppad-aead -version: 0.1.0 +version: 0.2.0 synopsis: A pure AEAD-ChaCha20-Poly1305 construction license: MIT license-file: LICENSE @@ -29,8 +29,8 @@ library build-depends: base >= 4.9 && < 5 , bytestring >= 0.9 && < 0.13 - , ppad-chacha >= 0.1 && < 0.2 - , ppad-poly1305 >= 0.2 && < 0.3 + , ppad-chacha >= 0.2 && < 0.3 + , ppad-poly1305 >= 0.3 && < 0.4 test-suite aead-tests type: exitcode-stdio-1.0