Re: [PATCH] crypto: add alignment handling to digest layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 04, 2006 at 12:04:07AM +0900, Atsushi Nemoto wrote:
>
> @@ -38,12 +39,24 @@ static void update(struct crypto_tfm *tf
>  			unsigned int bytes_from_page = min(l, ((unsigned int)
>  							   (PAGE_SIZE)) - 
>  							   offset);
> -			char *p = crypto_kmap(pg, 0) + offset;
> +			char *src = crypto_kmap(pg, 0);
> +			char *p = src + offset;
>  
> +			if (unlikely(offset & alignmask)) {
> +				unsigned int bytes =
> +					alignmask + 1 - (offset & alignmask);
> +				bytes = min(bytes, bytes_from_page);
> +				tfm->__crt_alg->cra_digest.dia_update
> +						(crypto_tfm_ctx(tfm), p,
> +						 bytes);

Don't we need to copy this to an aligned buffer?

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux