lib/mpi: Endianness fix
authorMichal Marek <mmarek@suse.com>
Wed, 17 Feb 2016 13:46:59 +0000 (14:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 May 2016 21:48:51 +0000 (14:48 -0700)
commit81b3a56ed84b0f2c1e2ff75ee2e05d5d4cd2462b
treea4241143bc0a777aa4c3aa59ea7316ccd3e2da0c
parent0658e8c5e8cc02f12f9ae3df1f3b87ee7283bb24
lib/mpi: Endianness fix

commit 3ee0cb5fb5eea2110db1b5cb7f67029b7be8a376 upstream.

The limbs are integers in the host endianness, so we can't simply
iterate over the individual bytes. The current code happens to work on
little-endian, because the order of the limbs in the MPI array is the
same as the order of the bytes in each limb, but it breaks on
big-endian.

Fixes: 0f74fbf77d45 ("MPI: Fix mpi_read_buffer")
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/mpi/mpicoder.c