/* Allocate and zero more components. Does not consume bi.  */
static void ICACHE_FLASH_ATTR more_comps(bigint *bi, int n)
/* Allocate and zero more components. Does not consume bi.  */
static void ICACHE_FLASH_ATTR more_comps(bigint *bi, int n)
{
    if (n > bi->max_comps)
    {
        bi->max_comps = max(bi->max_comps * 2, n);
        bi->comps = (comp*)realloc(bi->comps, bi->max_comps * COMP_BYTE_SIZE);
    }
    if (n > bi->size)
    {
        memset(&bi->comps[bi->size], 0, (n-bi->size)*COMP_BYTE_SIZE);
    }
    bi->size = n;
}