Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1491623
| From | Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] crypto: sha1-powerpc: little-endian support |
| Date | 2016-09-27 02:50 +0200 |
| Message-ID | <slOKR-2t3-11@gated-at.bofh.it> (permalink) |
| References | <skEud-7Xs-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Fri, Sep 23, 2016 at 04:31:56PM -0300, Marcelo Cerri wrote: > The driver does not handle endianness properly when loading the input > data. Indeed. I tested in both endianesses and it's working fine. Thanks! Herbert, can we go ahead with this fix? > > Signed-off-by: Marcelo Cerri <marcelo.cerri@canonical.com> > --- > arch/powerpc/crypto/sha1-powerpc-asm.S | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/crypto/sha1-powerpc-asm.S b/arch/powerpc/crypto/sha1-powerpc-asm.S > index 125e165..82ddc9b 100644 > --- a/arch/powerpc/crypto/sha1-powerpc-asm.S > +++ b/arch/powerpc/crypto/sha1-powerpc-asm.S > @@ -7,6 +7,15 @@ > #include <asm/ppc_asm.h> > #include <asm/asm-offsets.h> > > +#ifdef __BIG_ENDIAN__ > +#define LWZ(rt, d, ra) \ > + lwz rt,d(ra) > +#else > +#define LWZ(rt, d, ra) \ > + li rt,d; \ > + lwbrx rt,rt,ra > +#endif > + > /* > * We roll the registers for T, A, B, C, D, E around on each > * iteration; T on iteration t is A on iteration t+1, and so on. > @@ -23,7 +32,7 @@ > #define W(t) (((t)%16)+16) > > #define LOADW(t) \ > - lwz W(t),(t)*4(r4) > + LWZ(W(t),(t)*4,r4) > > #define STEPD0_LOAD(t) \ > andc r0,RD(t),RB(t); \ > @@ -33,7 +42,7 @@ > add r0,RE(t),r15; \ > add RT(t),RT(t),r6; \ > add r14,r0,W(t); \ > - lwz W((t)+4),((t)+4)*4(r4); \ > + LWZ(W((t)+4),((t)+4)*4,r4); \ > rotlwi RB(t),RB(t),30; \ > add RT(t),RT(t),r14 > > -- > 2.7.4 > -- Paulo Flabiano Smorigo IBM Linux Technology Center
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] crypto: sha1-powerpc: little-endian support Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-23 21:40 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> - 2016-09-27 02:50 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-28 15:20 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 15:30 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-28 15:30 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Michael Ellerman <mpe@ellerman.id.au> - 2016-10-04 08:30 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-10-04 14:10 +0200
Re: [PATCH] crypto: sha1-powerpc: little-endian support Herbert Xu <herbert@gondor.apana.org.au> - 2016-10-02 16:40 +0200
csiph-web