Commit 98942494 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[CRYPTO]: small sha256 cleanup

Looks like open-coded be_to_cpu.  GCC produces rather poor code for this. 
be_to_cpu produces asm()s which are ~4 times shorter.

Compile-tested only.

I am not sure whether input can be 32bit-unaligned.
If it indeed can be, replace:

((u32*)(input))[I]  ->  get_unaligned( ((u32*)(input))+I )
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 11bde9b1
...@@ -63,15 +63,7 @@ static inline u32 RORu32(u32 x, u32 y) ...@@ -63,15 +63,7 @@ static inline u32 RORu32(u32 x, u32 y)
static inline void LOAD_OP(int I, u32 *W, const u8 *input) static inline void LOAD_OP(int I, u32 *W, const u8 *input)
{ {
u32 t1 = input[(4 * I)] & 0xff; W[I] = __be32_to_cpu( ((u32*)(input))[I] );
t1 <<= 8;
t1 |= input[(4 * I) + 1] & 0xff;
t1 <<= 8;
t1 |= input[(4 * I) + 2] & 0xff;
t1 <<= 8;
t1 |= input[(4 * I) + 3] & 0xff;
W[I] = t1;
} }
static inline void BLEND_OP(int I, u32 *W) static inline void BLEND_OP(int I, u32 *W)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment