summaryrefslogtreecommitdiffstats
path: root/lib/mpi/mpiutil.c
diff options
context:
space:
mode:
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>2012-05-09 17:37:56 +0300
committerJames Morris <james.l.morris@oracle.com>2012-05-26 11:51:03 +1000
commit7cf4206a99d1b3e61bdbc7cbbf4a7bf6a9dfcc68 (patch)
treea77ad8cffa35427352cd18f94ed9339640e4d473 /lib/mpi/mpiutil.c
parent9e235dcaf4f63d88a7e9ce5735ba5c2eb2719603 (diff)
downloadblackbird-obmc-linux-7cf4206a99d1b3e61bdbc7cbbf4a7bf6a9dfcc68.tar.gz
blackbird-obmc-linux-7cf4206a99d1b3e61bdbc7cbbf4a7bf6a9dfcc68.zip
Remove unused code from MPI library
MPI library is used by RSA verification implementation. Few files contains functions which are never called. James Morris has asked to remove all of them. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Requested-by: James Morris <james.l.morris@oracle.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'lib/mpi/mpiutil.c')
-rw-r--r--lib/mpi/mpiutil.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/lib/mpi/mpiutil.c b/lib/mpi/mpiutil.c
index 26e4ed31e256..657979f71bef 100644
--- a/lib/mpi/mpiutil.c
+++ b/lib/mpi/mpiutil.c
@@ -106,13 +106,6 @@ int mpi_resize(MPI a, unsigned nlimbs)
return 0;
}
-void mpi_clear(MPI a)
-{
- a->nlimbs = 0;
- a->nbits = 0;
- a->flags = 0;
-}
-
void mpi_free(MPI a)
{
if (!a)
@@ -128,84 +121,3 @@ void mpi_free(MPI a)
kfree(a);
}
EXPORT_SYMBOL_GPL(mpi_free);
-
-/****************
- * Note: This copy function should not interpret the MPI
- * but copy it transparently.
- */
-int mpi_copy(MPI *copied, const MPI a)
-{
- size_t i;
- MPI b;
-
- *copied = NULL;
-
- if (a) {
- b = mpi_alloc(a->nlimbs);
- if (!b)
- return -ENOMEM;
-
- b->nlimbs = a->nlimbs;
- b->sign = a->sign;
- b->flags = a->flags;
- b->nbits = a->nbits;
-
- for (i = 0; i < b->nlimbs; i++)
- b->d[i] = a->d[i];
-
- *copied = b;
- }
-
- return 0;
-}
-
-int mpi_set(MPI w, const MPI u)
-{
- mpi_ptr_t wp, up;
- mpi_size_t usize = u->nlimbs;
- int usign = u->sign;
-
- if (RESIZE_IF_NEEDED(w, (size_t) usize) < 0)
- return -ENOMEM;
-
- wp = w->d;
- up = u->d;
- MPN_COPY(wp, up, usize);
- w->nlimbs = usize;
- w->nbits = u->nbits;
- w->flags = u->flags;
- w->sign = usign;
- return 0;
-}
-
-int mpi_set_ui(MPI w, unsigned long u)
-{
- if (RESIZE_IF_NEEDED(w, 1) < 0)
- return -ENOMEM;
- w->d[0] = u;
- w->nlimbs = u ? 1 : 0;
- w->sign = 0;
- w->nbits = 0;
- w->flags = 0;
- return 0;
-}
-
-MPI mpi_alloc_set_ui(unsigned long u)
-{
- MPI w = mpi_alloc(1);
- if (!w)
- return w;
- w->d[0] = u;
- w->nlimbs = u ? 1 : 0;
- w->sign = 0;
- return w;
-}
-
-void mpi_swap(MPI a, MPI b)
-{
- struct gcry_mpi tmp;
-
- tmp = *a;
- *a = *b;
- *b = tmp;
-}
OpenPOWER on IntegriCloud