* Internal crypto test fail: changed 'req->iv'
[not found] <6c4fbd8240af542f2c5e26e990825f1232009aaf.camel.ref@cs.com>
@ 2019-12-30 10:09 ` Richard van Schagen
2019-12-30 15:11 ` Ard Biesheuvel
0 siblings, 1 reply; 2+ messages in thread
From: Richard van Schagen @ 2019-12-30 10:09 UTC (permalink / raw)
To: linux-crypto
I am writing a module for the EIP93 crypto engine. From what I have
been reading on this mailing list, the driver should return the updated
IV in order for the caller to “resume” or “continue” with this IV in
another call.
A code-snippet:
int ivsize = crypto_skcipher_ivsize(skcipher);
If (ivsize)
memcpy(req->iv, rctx->lastiv, ivsize);
Where rctx->lastiv was read from the hardware itself.
The fail message I am getting is:
[ 57.290000] alg: skcipher: changed 'req->iv'
[ 57.370000] alg: skcipher: eip93-cbc-aes encryption co
rrupted request struct on test vector 0, cfg="in-place"
[ 57.380000] alg: skcipher: changed 'req->iv'
[ 57.460000] alg: skcipher: eip93-ctr-aes encryption corrupted
request struct on test vector 0, cfg="in-place"
[ 57.470000] alg: skcipher: changed 'req->iv'
[ 57.560000] alg: skcipher: eip93-rfc3686(ctr)-aes encryption
corrupted request struct on test vector 0, cfg="in-place"
[ 57.570000] alg: skcipher: changed 'req->iv’
Where/How should I return the new/updated IV ?
Thanks,
Richard van Schagen
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Internal crypto test fail: changed 'req->iv'
2019-12-30 10:09 ` Internal crypto test fail: changed 'req->iv' Richard van Schagen
@ 2019-12-30 15:11 ` Ard Biesheuvel
0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2019-12-30 15:11 UTC (permalink / raw)
To: Richard van Schagen; +Cc: open list:HARDWARE RANDOM NUMBER GENERATOR CORE
On Mon, 30 Dec 2019 at 11:10, Richard van Schagen <vschagen@cs.com> wrote:
>
> I am writing a module for the EIP93 crypto engine. From what I have
> been reading on this mailing list, the driver should return the updated
> IV in order for the caller to “resume” or “continue” with this IV in
> another call.
>
> A code-snippet:
>
> int ivsize = crypto_skcipher_ivsize(skcipher);
>
> If (ivsize)
> memcpy(req->iv, rctx->lastiv, ivsize);
>
> Where rctx->lastiv was read from the hardware itself.
>
> The fail message I am getting is:
> [ 57.290000] alg: skcipher: changed 'req->iv'
> [ 57.370000] alg: skcipher: eip93-cbc-aes encryption co
> rrupted request struct on test vector 0, cfg="in-place"
> [ 57.380000] alg: skcipher: changed 'req->iv'
> [ 57.460000] alg: skcipher: eip93-ctr-aes encryption corrupted
> request struct on test vector 0, cfg="in-place"
> [ 57.470000] alg: skcipher: changed 'req->iv'
> [ 57.560000] alg: skcipher: eip93-rfc3686(ctr)-aes encryption
> corrupted request struct on test vector 0, cfg="in-place"
> [ 57.570000] alg: skcipher: changed 'req->iv’
>
> Where/How should I return the new/updated IV ?
>
Are you sure you are not making req->iv point to a different buffer?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-30 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <6c4fbd8240af542f2c5e26e990825f1232009aaf.camel.ref@cs.com>
2019-12-30 10:09 ` Internal crypto test fail: changed 'req->iv' Richard van Schagen
2019-12-30 15:11 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).