Re: LRW endian issues?

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

 



On Tue, 10 Feb 2009, Herbert Xu wrote:
> On Fri, Feb 06, 2009 at 03:01:24PM +1100, Herbert Xu wrote:
> > Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx> wrote:
> > > When running "modprobe tcrypt mode=10" on ppc64 (PS3), I get the following
> > > error:
> > > 
> > > | alg: skcipher: Test 8 failed on encryption for lrw(aes-generic)
> 
> Does this patch help?
> 
> diff --git a/crypto/lrw.c b/crypto/lrw.c
> index 8ef664e..358f80b 100644
> --- a/crypto/lrw.c
> +++ b/crypto/lrw.c
> @@ -45,7 +45,13 @@ struct priv {
>  
>  static inline void setbit128_bbe(void *b, int bit)
>  {
> -	__set_bit(bit ^ 0x78, b);
> +	__set_bit(bit ^ (0x80 -
> +#ifdef __BIG_ENDIAN
> +			 BITS_PER_LONG
> +#else
> +			 BITS_PER_BYTE
> +#endif
> +			), b);
>  }
>  
>  static int setkey(struct crypto_tfm *parent, const u8 *key,

Thanks! Now the test succeeds on both ppc64 and ppc32.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@xxxxxxxxxxx
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
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