Re: [PATCH 2/2] crypto: authenc - move saved IV in front of the ablkcipher request

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

 



On Tue, Feb 23, 2010 at 07:22:37AM +0100, Steffen Klassert wrote:
>
> @@ -558,13 +556,18 @@ static int crypto_authenc_init_tfm(struct crypto_tfm *tfm)
>  	ctx->auth = auth;
>  	ctx->enc = enc;
>  
> -	tfm->crt_aead.reqsize = max_t(unsigned int,
> -				crypto_ahash_reqsize(auth) + ctx->reqoff +
> -				sizeof(struct authenc_request_ctx) +
> +	ctx->reqoff = ALIGN(2 * crypto_ahash_digestsize(auth) +
> +			    crypto_ahash_alignmask(auth),
> +			    crypto_ahash_alignmask(auth) + 1) +
> +		      crypto_ablkcipher_ivsize(enc);
> +
> +	tfm->crt_aead.reqsize = sizeof(struct authenc_request_ctx) +
> +				ctx->reqoff +
> +				max_t(unsigned int,
> +				crypto_ahash_reqsize(auth) +
>  				sizeof(struct ahash_request),
>  				sizeof(struct skcipher_givcrypt_request) +
> -				crypto_ablkcipher_reqsize(enc) +
> -				crypto_ablkcipher_ivsize(enc));
> +				crypto_ablkcipher_reqsize(enc));

Hmm, I just noticed that both before and after the patch we're
only including the hash request size for the encrypt case, and
not the givencrypt case.  Is there a reason for this?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
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-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux