# How is the precomputed table for 25519 Elliptic curve generated?

I am wondering how the precomputed table for scalar multiplication for elliptic curve (in my case 25519) is generated/precomputed?

The piece of code which uses this header file is:

/* base[i][j] = (j+1)*256^i*B */
/*static const ge_precomp base[32][8] = {
#include "base.h"
} ;*/


ge_precomp is defined as

ge_precomp (Duif): (y+x,y-x,2dxy)


Is there a paper or a piece of code where I can see how this table is generated? I am not trying to learn more about elliptic curves, I simply want to precompute this myself because of the specifics of my project.

I guess I would have to add point B to itself for (j+1)*256^i mod p times for each i and j. Is there a less compute intensive way to do this on an e.g. Raspberry Pi?