commit 847775bf37703a0ebf5111c1929c61779554da36
parent 1ecbfd7ddc3731a9ff532bfe181b104d4490061d
Author: Jared Tobin <jared@jtobin.io>
Date: Sat, 31 Oct 2026 14:25:37 +0400
bench: add 1024 and 4096-byte cipher cases
The existing case encrypts 114 bytes, which fits in two blocks; the
longer inputs show throughput on multi-block paths.
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/bench/Main.hs b/bench/Main.hs
@@ -35,9 +35,17 @@ non :: BS.ByteString
non = fromJust . B16.decode $
"000000090000004a00000000"
+plain_1k :: BS.ByteString
+plain_1k = BS.replicate 1024 0x42
+
+plain_4k :: BS.ByteString
+plain_4k = BS.replicate 4096 0x42
+
suite :: Benchmark
suite =
bgroup "ppad-chacha" [
bench "cipher" $ nf (ChaCha20.cipher key 1 non) plain
+ , bench "cipher (1024B)" $ nf (ChaCha20.cipher key 1 non) plain_1k
+ , bench "cipher (4096B)" $ nf (ChaCha20.cipher key 1 non) plain_4k
]