lib/mpi: refactor mpi_read_from_buffer() in terms of mpi_read_raw_data()
authorNicolai Stange <nicstange@gmail.com>
Thu, 26 May 2016 21:19:55 +0000 (23:19 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 31 May 2016 08:42:01 +0000 (16:42 +0800)
commit20b5b7f3c2df2fb69b3b27dc83314b8891614ba5
tree48df6ac9ff7c440bc8c26646dbc225e363ed6adf
parentcdf24b42c6740ec429e85a8405e5e917abac8595
lib/mpi: refactor mpi_read_from_buffer() in terms of mpi_read_raw_data()

mpi_read_from_buffer() and mpi_read_raw_data() do basically the same thing
except that the former extracts the number of payload bits from the first
two bytes of the input buffer.

Besides that, the data copying logic is exactly the same.

Replace the open coded buffer to MPI instance conversion by a call to
mpi_read_raw_data().

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/mpi/mpicoder.c