* Who will copy the AAD data to dest. buffer
@ 2016-09-02 14:35 Harsh Jain
2016-09-02 14:42 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: Harsh Jain @ 2016-09-02 14:35 UTC (permalink / raw)
To: Herbert Xu, linux-crypto, Stephan Mueller
Hi Herbert,
Is copy of AAD data to destination buffer when dst != src is mandatory
requirements for crypto drivers or we can skip this copy. Actually I
am bit confused, In following link Stephen had mentioned caller will
memcpy the AAD to destination buffer but authenc.c also copies the AAD
to dest. buffer.
http://www.chronox.de/libkcapi/html/ch02s02.html
Secondly When AAD data remains unchanged in AEAD encryption/decryption
operations. Why we copy the same data to destination buffer?
Thanks & Regards
Harsh Jain
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Who will copy the AAD data to dest. buffer
2016-09-02 14:35 Who will copy the AAD data to dest. buffer Harsh Jain
@ 2016-09-02 14:42 ` Herbert Xu
2016-09-03 5:15 ` Harsh Jain
0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2016-09-02 14:42 UTC (permalink / raw)
To: Harsh Jain; +Cc: linux-crypto, Stephan Mueller
On Fri, Sep 02, 2016 at 08:05:04PM +0530, Harsh Jain wrote:
> Hi Herbert,
>
> Is copy of AAD data to destination buffer when dst != src is mandatory
> requirements for crypto drivers or we can skip this copy. Actually I
> am bit confused, In following link Stephen had mentioned caller will
> memcpy the AAD to destination buffer but authenc.c also copies the AAD
> to dest. buffer.
>
> http://www.chronox.de/libkcapi/html/ch02s02.html
It has to be copied if src != dst.
> Secondly When AAD data remains unchanged in AEAD encryption/decryption
> operations. Why we copy the same data to destination buffer?
This greatly simplifies the implementation of the AEAD algorithms
because we can throw away src and use the dst only. For example,
authenc hashes the AAD and ciphertext. If we didn't force the
copy it would have to hash them separately, meaning the use of
the slow init/update/final interface. With the copy it can use
the digest interface.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Who will copy the AAD data to dest. buffer
2016-09-02 14:42 ` Herbert Xu
@ 2016-09-03 5:15 ` Harsh Jain
2016-09-03 13:19 ` Stephan Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Harsh Jain @ 2016-09-03 5:15 UTC (permalink / raw)
To: Herbert Xu; +Cc: linux-crypto, Stephan Mueller
Thanks Herbert for clarification. It means Libkcapi documentation
needs update of chapter "Aead Cipher API".
Regards
Harsh Jain
On Fri, Sep 2, 2016 at 8:12 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Fri, Sep 02, 2016 at 08:05:04PM +0530, Harsh Jain wrote:
>> Hi Herbert,
>>
>> Is copy of AAD data to destination buffer when dst != src is mandatory
>> requirements for crypto drivers or we can skip this copy. Actually I
>> am bit confused, In following link Stephen had mentioned caller will
>> memcpy the AAD to destination buffer but authenc.c also copies the AAD
>> to dest. buffer.
>>
>> http://www.chronox.de/libkcapi/html/ch02s02.html
>
> It has to be copied if src != dst.
>
>> Secondly When AAD data remains unchanged in AEAD encryption/decryption
>> operations. Why we copy the same data to destination buffer?
>
> This greatly simplifies the implementation of the AEAD algorithms
> because we can throw away src and use the dst only. For example,
> authenc hashes the AAD and ciphertext. If we didn't force the
> copy it would have to hash them separately, meaning the use of
> the slow init/update/final interface. With the copy it can use
> the digest interface.
>
> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-03 13:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-02 14:35 Who will copy the AAD data to dest. buffer Harsh Jain
2016-09-02 14:42 ` Herbert Xu
2016-09-03 5:15 ` Harsh Jain
2016-09-03 13:19 ` Stephan Mueller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox