From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Date: Thu, 2 Oct 2014 08:33:53 +0800 > David Miller <davem@xxxxxxxxxxxxx> wrote: >> >> Anyways, I suspect that we need to use get_unaligned_be{32,64}() in >> generic SHA256 and SHA512. > > The other option is to set cra_alignmask and have the crypto API > handle this. So the question is what is the cost benefit of using > a normal load vs. get_unaligned_*? > > Most in-kernel crypto uses should be using aligned input/output. > In these specific hash functions we only read the u32/u64 inputs a byte at a time once, to get them into the work buffer. If we have the crypto layer do it, we'll bounce the data around once to the crypto layer bounce buffer, then once again into the hash implementation's work buffer. I think it's better to avoid the extra copy right? -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html