Commit faae8908 authored by Herbert Xu's avatar Herbert Xu

crypto: padlock - Fix compile error on i386

The previous change to allow hashing from states other than the
initial broke compilation on i386 because the inline assembly
tried to squeeze a u64 into a 32-bit register.  As we've already
checked for 32-bit overflows we can simply truncate it to u32,
or unsigned long so that we don't truncate at all on x86-64.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b5ebd44e
...@@ -103,7 +103,8 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in, ...@@ -103,7 +103,8 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in,
ts_state = irq_ts_save(); ts_state = irq_ts_save();
asm volatile (".byte 0xf3,0x0f,0xa6,0xc8" /* rep xsha1 */ asm volatile (".byte 0xf3,0x0f,0xa6,0xc8" /* rep xsha1 */
: \ : \
: "c"(state.count + count), "a"(state.count), \ : "c"((unsigned long)state.count + count), \
"a"((unsigned long)state.count), \
"S"(in), "D"(result)); "S"(in), "D"(result));
irq_ts_restore(ts_state); irq_ts_restore(ts_state);
...@@ -165,7 +166,8 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in, ...@@ -165,7 +166,8 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in,
ts_state = irq_ts_save(); ts_state = irq_ts_save();
asm volatile (".byte 0xf3,0x0f,0xa6,0xd0" /* rep xsha256 */ asm volatile (".byte 0xf3,0x0f,0xa6,0xd0" /* rep xsha256 */
: \ : \
: "c"(state.count + count), "a"(state.count), \ : "c"((unsigned long)state.count + count), \
"a"((unsigned long)state.count), \
"S"(in), "D"(result)); "S"(in), "D"(result));
irq_ts_restore(ts_state); irq_ts_restore(ts_state);
......
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