bn: preallocate arrays
bn: perform internal shifts in-place