public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Holger Dengler <dengler@linux.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Harald Freudenberger <freude@linux.ibm.com>
Cc: linux-s390@vger.kernel.org,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: s390 hmac
Date: Tue, 25 Mar 2025 19:10:34 +0100	[thread overview]
Message-ID: <bcaa276c-3c26-44da-b06b-4935bc1384f0@linux.ibm.com> (raw)
In-Reply-To: <Z-JntzkWQqc-Atlc@gondor.apana.org.au>

On 25/03/2025 09:22, Herbert Xu wrote:
> On Mon, Mar 24, 2025 at 11:04:56AM +0100, Harald Freudenberger wrote:
>>
>> that is the ikp bit in the s390_kmac_gr0 struct:
> 
> Thank you Harald!
> 
>> union s390_kmac_gr0 {
>> 	unsigned long reg;
>> 	struct {
>> 		unsigned long		: 48;
>> 		unsigned long ikp	:  1;
>> 		unsigned long iimp	:  1;
>> 		unsigned long ccup	:  1;
> 
> I hope I don't have to worry about ccup and can just leave it
> as zero during import, right?

I've to do some further test to be 100% sure. This bit is an indicator, if the instruction has updated the hardware crypto counter for hmac or not. Normally, it should be initialized with 0 before the first instruction call and after the instruction call the flag indicates, if the counter has been updated or not. If the flag is 1, it should be 1 for the following calls, otherwise the hardware crypto counters show wrong statistics.

I've no idea how to set the bit on import correctly, if parts of the hmac operation has been processed by another cipher implementation. Setting it to 0 means, the partial hmac operation is counters as a full operation. setting it to 1 would mean, that the operation after an import is not reflected in the statistics.

-- 
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
dengler@linux.ibm.com


  reply	other threads:[~2025-03-25 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-23 13:13 s390 hmac Herbert Xu
2025-03-24  7:50 ` Holger Dengler
2025-03-24  8:07   ` Herbert Xu
2025-03-24 10:04 ` Harald Freudenberger
2025-03-25  8:22   ` Herbert Xu
2025-03-25 18:10     ` Holger Dengler [this message]
2025-03-26  0:54       ` Herbert Xu

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=bcaa276c-3c26-44da-b06b-4935bc1384f0@linux.ibm.com \
    --to=dengler@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /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