lkml.org 
[lkml]   [2020]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV
    From
    Date
    On 8/21/2020 6:47 AM, Herbert Xu wrote:
    > On Thu, Aug 06, 2020 at 07:35:43PM +0300, Andrei Botila wrote:
    >>
    >> +static bool xts_skcipher_ivsize(struct skcipher_request *req)
    >> +{
    >> + struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
    >> + unsigned int ivsize = crypto_skcipher_ivsize(skcipher);
    >> + u64 size = 0;
    >> +
    >> + if (IS_ALIGNED((unsigned long)req->iv, __alignof__(u64)))
    >> + size = *(u64 *)(req->iv + (ivsize / 2));
    >> + else
    >> + size = get_unaligned((u64 *)(req->iv + (ivsize / 2)));
    >> +
    >> + return !!size;
    >> +}
    >
    > Just go with the get_unaligned unconditionally.
    >
    Won't this lead to sub-optimal code for ARMv7
    in case the IV is aligned?

    Thanks,
    Horia

    \
     
     \ /
      Last update: 2020-09-08 12:37    [W:4.061 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site