Skip to content

Instantly share code, notes, and snippets.

@GrygrFlzr
Created December 17, 2017 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GrygrFlzr/764c8330aed214d00dc973a7cad28961 to your computer and use it in GitHub Desktop.
Save GrygrFlzr/764c8330aed214d00dc973a7cad28961 to your computer and use it in GitHub Desktop.
#!/bin/bash
# generate 1KB test file
head -c 1024 </dev/urandom >randbytes
TIMEFORMAT=%R
# benchmark encryption
echo "Encryption Benchmark"
echo " | hm602 | lh210 |"
echo "---+-------+-------+"
for version in {1..6}
do
HMTIME=$( { time for i in {1..1000};
do \
./honokamiku -e -w$version -b randbytes - ww_v${version}_test \
<randbytes >/dev/null 2>&1; \
done; } 2>&1 )
LHTIME=$( { time for i in {1..1000};
do \
./libhonoka -e -w$version -b randbytes - ww_v${version}_test \
<randbytes >/dev/null 2>&1; \
done; } 2>&1 )
echo "v$version | $HMTIME | $LHTIME |"
done
echo
# benchmark decryption
echo "Decryption Benchmark"
echo " | hm602 | lh210 |"
echo "---+-------+-------+"
for version in {1..6}
do
HMTIME=$( { time for i in {1..1000};
do \
./honokamiku -w$version ww_v${version}_test /dev/null >/dev/null 2>&1; \
done; } 2>&1 )
LHTIME=$( { time for i in {1..1000};
do \
./libhonoka -w$version ww_v${version}_test /dev/null >/dev/null 2>&1; \
done; } 2>&1 )
echo "v$version | $HMTIME | $LHTIME |"
done
# cleanup
rm randbytes
rm ww_v*_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment