From 73719cbe8806c7179fbd4e9a6b4e7be62813cf94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Ch=C3=A9ron?= Date: Sun, 25 Aug 2019 08:55:54 +0200 Subject: [PATCH] Add AES-GCM-SIV to AEAD benchmarks --- benchs/Bench.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/benchs/Bench.hs b/benchs/Bench.hs index b6d034e..bc1d668 100644 --- a/benchs/Bench.hs +++ b/benchs/Bench.hs @@ -6,6 +6,7 @@ module Main where import Gauge.Main import Crypto.Cipher.AES +import qualified Crypto.Cipher.AESGCMSIV as AESGCMSIV import Crypto.Cipher.Blowfish import Crypto.Cipher.CAST5 import qualified Crypto.Cipher.ChaChaPoly1305 as CP @@ -167,6 +168,7 @@ benchAE = [ bench "ChaChaPoly1305" $ nf (cp key32) (input64, input1024) , bench "AES-GCM" $ nf (gcm key32) (input64, input1024) , bench "AES-CCM" $ nf (ccm key32) (input64, input1024) + , bench "AES-GCM-SIV" $ nf (gcmsiv key32) (input64, input1024) ] where cp k (ini, plain) = let iniState = throwCryptoError $ CP.initialize k (throwCryptoError $ CP.nonce12 nonce12) @@ -186,6 +188,11 @@ benchAE = state = throwCryptoError $ aeadInit mode ctx nonce12 in aeadSimpleEncrypt state ini plain 16 + gcmsiv k (ini, plain) = + let ctx = throwCryptoError (cipherInit k) :: AES256 + iv = throwCryptoError (AESGCMSIV.nonce nonce12) + in AESGCMSIV.encrypt ctx iv ini plain + input64 = B.replicate 64 0 input1024 = B.replicate 1024 0