chacha

The ChaCha20 stream cipher (docs.ppad.tech/chacha).
git clone git://git.ppad.tech/chacha.git
Log | Files | Refs | README | LICENSE

commit 7ac8e830d35eb56c0bdec6e413272f103dd7d274
parent 80cc74597a6032b39f9b131ea1e06cc9dda9944e
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat,  8 Aug 2026 11:07:59 -0230

docs: misc example patch-ups

Diffstat:
MREADME.md | 6+++---
Mlib/Crypto/Cipher/ChaCha20.hs | 6+++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -20,13 +20,13 @@ A sample GHCi session: > -- encrypt some plaintext using a secret key and nonce > let key = "don't tell anyone my secret key!" > let non = "or my nonce!" - > let Right ciphertext = ChaCha20.cipher key 1 non "but you can share the plaintext" + > let Right ciphertext = ChaCha20.cipher key 1 non "but you can share the ciphertext" > ciphertext - "\192*c\248A\204\211n\130y8\197\146k\245\178Y\197=\180_\223\138\146:^\206\&0\v[\201" + "\192*c\248A\204\211n\130y8\197\146k\245\178Y\197=\180_\223\153\151+_\197\&6\SUBF\197\160" > > -- use the cipher with the same key, counter, and nonce to decrypt the ciphertext > ChaCha20.cipher key 1 non ciphertext - Right "but you can share the plaintext" + Right "but you can share the ciphertext" ``` ## Documentation diff --git a/lib/Crypto/Cipher/ChaCha20.hs b/lib/Crypto/Cipher/ChaCha20.hs @@ -332,11 +332,11 @@ serialize (ChaCha m) = do -- -- >>> let key = "don't tell anyone my secret key!" -- >>> let non = "or my nonce!" --- >>> let cip = cipher key 1 non "but you can share the plaintext" +-- >>> let Right cip = cipher key 1 non "but you can share the ciphertext" -- >>> cip --- "\192*c\248A\204\211n\130y8\197\146k\245\178Y\197=\180_\223\138\146:^\206\&0\v[\201" +-- "\192*c\248A\204\211n\130y8\197\146k\245\178Y\197=\180_\223\153\151+_\197\&6\SUBF\197\160" -- >>> cipher key 1 non cip --- Right "but you can share the plaintext" +-- Right "but you can share the ciphertext" cipher :: BS.ByteString -- ^ 256-bit key -> Word32 -- ^ 32-bit counter