/* Do a full copy of the bigint object.  */
bigint* ICACHE_FLASH_ATTR bi_clone(BI_CTX *ctx, const bigint *bi)
/* Do a full copy of the bigint object.  */
bigint* ICACHE_FLASH_ATTR bi_clone(BI_CTX *ctx, const bigint *bi)
{
    bigint *biR = alloc(ctx, bi->size);
    check(bi);
    memcpy(biR->comps, bi->comps, bi->size*COMP_BYTE_SIZE);
    return biR;
}