/* Allow a binary sequence to be imported as a bigint.  */
bigint* ICACHE_FLASH_ATTR bi_import(BI_CTX *ctx, const uint8_t *data, int size)
/* Allow a binary sequence to be imported as a bigint.  */
bigint* ICACHE_FLASH_ATTR bi_import(BI_CTX *ctx, const uint8_t *data, int size)
{
    bigint *biR = alloc(ctx, (size+COMP_BYTE_SIZE-1)/COMP_BYTE_SIZE);
    int i, j = 0, offset = 0;
    memset(biR->comps, 0, biR->size*COMP_BYTE_SIZE);
    for (i = size-1; i >= 0; i--)
    {
        biR->comps[offset] += data[i] << (j*8);
        if (++j == COMP_BYTE_SIZE)
        {
            j = 0;
            offset ++;
        }
    }
    return trim(biR);
}