/* Copyright (c) 2009 Ian Piumarta
 * All rights reserved.
 * See the file COPYING for details.
 */

#include "_mpint.h"

/* dst = src */

mp_t *mp_copy(mp_t *dst, mp_t *src)
{
  if (dst != src) {
    mp_size_t w= src->width;
    if (!w) return mp_clear(dst);
    dst->bits= memcpy(_mp_realloc(dst->bits, w), src->bits, MP_BYTES * w);
    dst->width= w;
  }
  return dst;
}

