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:49:11 +0000 (14:49 -0700)
commit0cfe76f7852f2f10477da2d2380383d8dcee54fb
tree2766431f35eb02a0c76f7e1e590cb2ef74fd3fb8
parent1e2d4433b4db1961bd9f881209ed782ebf267a1c
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