Re: Alignment in the API, once again

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

 



On Thu, Aug 02, 2007 at 01:02:40AM +0200, Sebastian Siewior wrote:
>
> I noticed this, after my code did not work properly. The reason was,
> that my private ctx was not retrieved with
> crypto_ablkcipher_ctx_aligned() (attached) but with
> crypto_ablkcipher_ctx() (and it was not properly aligned anymore).
> My fault right? 

Yeah if your ctx needs to be aligned you need to use
crypto_tfm_ctx_aligned.

> Shouldn't the behavior of crypto_blkcipher_ctx_aligned() (which is
> currently unused) be the default one?

Most of our existing algorithms don't care about alignment.

> --- a/include/crypto/algapi.h
> +++ b/include/crypto/algapi.h
> @@ -160,6 +160,11 @@ static inline void *crypto_ablkcipher_ct
>  	return crypto_tfm_ctx(&tfm->base);
>  }
>  
> +static inline void *crypto_ablkcipher_ctx_aligned(struct crypto_ablkcipher *tfm)
> +{
> +	return crypto_tfm_ctx_aligned(&tfm->base);
> +}
> +
>  static inline struct crypto_blkcipher *crypto_spawn_blkcipher(
>  	struct crypto_spawn *spawn)

Looks good.  Could you add a description and sign-off?

Thanks,
-- 
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