From patchwork Wed Dec 20 20:09:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 10126517 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6776460390 for ; Wed, 20 Dec 2017 20:09:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58F2E298DB for ; Wed, 20 Dec 2017 20:09:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D166298EC; Wed, 20 Dec 2017 20:09:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E561F298DB for ; Wed, 20 Dec 2017 20:09:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755222AbdLTUJ4 (ORCPT ); Wed, 20 Dec 2017 15:09:56 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:46611 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755752AbdLTUJt (ORCPT ); Wed, 20 Dec 2017 15:09:49 -0500 Received: by mail-wm0-f68.google.com with SMTP id r78so12178456wme.5 for ; Wed, 20 Dec 2017 12:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pVGXsSCvyaxIqMzPFalqdst3oJLqa/xpc2H8+nm0dcA=; b=wJgWXa7gEi+EvGF4WmMoK+6qDJ7+4b7KXFQQiKJ8tKV/UDCqdaM2aHnipfcMffjdxG C6ZJHNnqb5hd1BW7QNKBqFWB0E7XESegrSmNUXWxfjVM49/EEvXDC47WGjwZJMl4CYax NPC1I1u+fenNsOOiYPGL+FKSmcs3NgpO62qEAW+fo9BA1xX0uS/LmQczCAeGrdVWY5Va OPyYeuDHd+D1KO6kNZf7OvZ+1HAx/eD/4mdHJV8ovjMS1LI8Mv1JThMKYJS749XbRxVR XwRzAc3dIbY3kCn3K4qdfndfOb7dmNJrU4lOiCsgbXFfXZbGQ+4+V/6b0e2jzA1eBKKZ 5eMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pVGXsSCvyaxIqMzPFalqdst3oJLqa/xpc2H8+nm0dcA=; b=ACtX2GLGlFaYvuVLLNuDIFrR8d0thxVwtCR9EkUlaM8WDCRIW/BmruWQZXI6gV6fV8 FXusQ3uc+eK8K/uLDshZMsl6AF3uDoVv6jeWnBESY8Wy003HsxI7f99vLWZGJY0xK+Sz CxgvuZITXddBwoGMajQl7L1/Ez0WYW+P9qjpWPDRi7cq6NQMyHvRDEbrlNMg+HfQfrQd 6VGtPM/qH03rzkuawqtj34CmffN+wxPiMR0m3Dv2PB+7eNILgUCWSV+fiUm4RA/v1kKt d15schgoH9uleYzAHAjwKw2y87bhGuhUfBOcGmfMkK+M+dR2OButEAMr44eNiGycsmNk keqw== X-Gm-Message-State: AKGB3mLeJdzWnDgNhWGbYsiYHuT2Ec7x5EEIDVR8x7CwH89ArFXwAUr2 bWtWsXKD6dRMYs7CkPcN9r74vw== X-Google-Smtp-Source: ACJfBot99ecktfk397JPbfDZhZQNGbC/BU6+CgLjYt1lZVfmhg2mzRjPzoraM6qQnyZDVTUnw0KEJw== X-Received: by 10.28.170.137 with SMTP id t131mr7141774wme.137.1513800587847; Wed, 20 Dec 2017 12:09:47 -0800 (PST) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id c2sm16542911wrg.57.2017.12.20.12.09.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Dec 2017 12:09:47 -0800 (PST) From: Corentin Labbe 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 Subject: [PATCH RFC 3/3] crypto: tools: Add cryptostat userspace Date: Wed, 20 Dec 2017 20:09:27 +0000 Message-Id: <1513800567-12764-4-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513800567-12764-1-git-send-email-clabbe@baylibre.com> References: <1513800567-12764-1-git-send-email-clabbe@baylibre.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an example tool for getting easily crypto statistics. Signed-off-by: Corentin Labbe --- 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