From: Corentin Labbe <clabbe@baylibre.com>
To: davem@davemloft.net, herbert@gondor.apana.org.au, nhorman@tuxdriver.com
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH RFC 3/3] crypto: tools: Add cryptostat userspace
Date: Wed, 20 Dec 2017 20:09:27 +0000 [thread overview]
Message-ID: <1513800567-12764-4-git-send-email-clabbe@baylibre.com> (raw)
In-Reply-To: <1513800567-12764-1-git-send-email-clabbe@baylibre.com>
Add an example tool for getting easily crypto statistics.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
tools/crypto/cryptostat | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100755 tools/crypto/cryptostat
diff --git a/tools/crypto/cryptostat b/tools/crypto/cryptostat
new file mode 100755
index 000000000000..314e108eb608
--- /dev/null
+++ b/tools/crypto/cryptostat
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+for dn in `ls /sys/kernel/crypto/`
+do
+ dnpath=/sys/kernel/crypto/$dn/
+ algtype=$(cat $dnpath/algtype)
+ algname=$(cat $dnpath/algname)
+ echo "$dn ($algtype) $algname"
+ case $algtype in
+ hash)
+ echo -e "\tHash: $(cat $dnpath/enc_cnt)\tbytes $(cat $dnpath/enc_tlen)"
+ ;;
+ cipher)
+ echo -e "\tEncrypt: $(cat $dnpath/enc_cnt)\tbytes $(cat $dnpath/enc_tlen)"
+ echo -e "\tDecrypt: $(cat $dnpath/dec_cnt)\tbytes $(cat $dnpath/dec_tlen)"
+ ;;
+ compress)
+ echo -e "\tCompress: $(cat $dnpath/enc_cnt)\tbytes $(cat $dnpath/enc_tlen)"
+ echo -e "\tDecompress: $(cat $dnpath/dec_cnt)\tbytes $(cat $dnpath/dec_tlen)"
+ ;;
+ asymetric)
+ echo -e "\tEncrypt: $(cat $dnpath/enc_cnt)\tbytes $(cat $dnpath/enc_tlen)"
+ echo -e "\tDecrypt: $(cat $dnpath/dec_cnt)\tbytes $(cat $dnpath/dec_tlen)"
+ echo -e "\tVerify: $(cat $dnpath/verify_cnt)"
+ echo -e "\tSign: $(cat $dnpath/sign_cnt)"
+ ;;
+ rng)
+ echo -e "\tGenerate: $(cat $dnpath/enc_cnt)\tbytes $(cat $dnpath/enc_tlen)"
+ echo -e "\tSeed: $(cat $dnpath/dec_cnt)"
+ ;;
+ kpp)
+ echo -e "\tSet_secret: $(cat $dnpath/dec_cnt)"
+ echo -e "\tGenerate_public_key: $(cat $dnpath/enc_cnt)"
+ echo -e "\tCompute_shared_secret: $(cat $dnpath/verify_cnt)"
+ ;;
+ *)
+ echo -e "\t$(cat $dnpath/enc_cnt)\tbytes $(cat $dnpath/enc_tlen)"
+ ;;
+ esac
+done
--
2.13.6
next prev parent reply other threads:[~2017-12-20 20:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 20:09 [PATCH RFC 0/3] crypto: Implement a generic crypto statistics Corentin Labbe
2017-12-20 20:09 ` [PATCH RFC 1/3] crypto: Prevent to register duplicate cra_driver_name Corentin Labbe
2017-12-21 6:27 ` Stephan Mueller
2017-12-21 6:35 ` Herbert Xu
2017-12-21 12:35 ` LABBE Corentin
2017-12-21 20:05 ` LABBE Corentin
2017-12-20 20:09 ` [PATCH RFC 2/3] crypto: Implement a generic crypto statistics Corentin Labbe
2017-12-20 23:37 ` Randy Dunlap
2017-12-21 6:38 ` Stephan Mueller
2017-12-21 20:03 ` LABBE Corentin
2017-12-22 6:38 ` Herbert Xu
2017-12-20 20:09 ` Corentin Labbe [this message]
2017-12-20 23:37 ` [PATCH RFC 3/3] crypto: tools: Add cryptostat userspace Randy Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513800567-12764-4-git-send-email-clabbe@baylibre.com \
--to=clabbe@baylibre.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome