public static void ge_scalarmult_base(ge_p3 h, byte[] a) {
        byte[] e = new byte[64];
        byte carry;
        ge_p1p1 r = new ge_p1p1();
        ge_p2 s = new ge_p2();
        ge_precomp t = new ge_precomp();
        int i;

        for (i = 0; i < 32; ++i) {
            e[2 * i + 0] = (byte) ((a[i] >>> 0) & 15);
            e[2 * i + 1] = (byte) ((a[i] >>> 4) & 15);
        }
  /* each e[i] is between 0 and 15 */
  /* e[63] is between 0 and 7 */

        carry = 0;
        for (i = 0; i < 63; ++i) {
            e[i] += carry;
            carry = (byte) (e[i] + 8);
            carry >>= 4;
            e[i] -= carry << 4;
        }
        e[63] += carry;
  /* each e[i] is between -8 and 8 */

        ge_p3_0.ge_p3_0(h);
        for (i = 1; i < 64; i += 2) {
            select(t, i / 2, e[i]);
            ge_madd.ge_madd(r, h, t);
            ge_p1p1_to_p3.ge_p1p1_to_p3(h, r);
        }

        ge_p3_dbl.ge_p3_dbl(r, h);
        ge_p1p1_to_p2.ge_p1p1_to_p2(s, r);
        ge_p2_dbl.ge_p2_dbl(r, s);
        ge_p1p1_to_p2.ge_p1p1_to_p2(s, r);
        ge_p2_dbl.ge_p2_dbl(r, s);
        ge_p1p1_to_p2.ge_p1p1_to_p2(s, r);
        ge_p2_dbl.ge_p2_dbl(r, s);
        ge_p1p1_to_p3.ge_p1p1_to_p3(h, r);

        for (i = 0; i < 64; i += 2) {
            select(t, i / 2, e[i]);
            ge_madd.ge_madd(r, h, t);
            ge_p1p1_to_p3.ge_p1p1_to_p3(h, r);
        }
    }
public static void ge_scalarmult_base ( ge_p3 h , byte [ ] a ) { byte [ ] e = new byte [ 64 ] ; byte carry ; ge_p1p1 r = new ge_p1p1 ( ) ; ge_p2 s = new ge_p2 ( ) ; ge_precomp t = new ge_precomp ( ) ; int i ; for ( i = 0 ; i < 32 ; ++ i ) { e [ 2 * i + 0 ] = ( byte ) ( ( a [ i ] > > > 0 ) & 15 ) ; e [ 2 * i + 1 ] = ( byte ) ( ( a [ i ] > > > 4 ) & 15 ) ; } carry = 0 ; for ( i = 0 ; i < 63 ; ++ i ) { e [ i ] += carry ; carry = ( byte ) ( e [ i ] + 8 ) ; carry >>= 4 ; e [ i ] -= carry << 4 ; } e [ 63 ] += carry ; ge_p3_0 . ge_p3_0 ( h ) ; for ( i = 1 ; i < 64 ; i += 2 ) { select ( t , i / 2 , e [ i ] ) ; ge_madd . ge_madd ( r , h , t ) ; ge_p1p1_to_p3 . ge_p1p1_to_p3 ( h , r ) ; } ge_p3_dbl . ge_p3_dbl ( r , h ) ; ge_p1p1_to_p2 . ge_p1p1_to_p2 ( s , r ) ; ge_p2_dbl . ge_p2_dbl ( r , s ) ; ge_p1p1_to_p2 . ge_p1p1_to_p2 ( s , r ) ; ge_p2_dbl . ge_p2_dbl ( r , s ) ; ge_p1p1_to_p2 . ge_p1p1_to_p2 ( s , r ) ; ge_p2_dbl . ge_p2_dbl ( r , s ) ; ge_p1p1_to_p3 . ge_p1p1_to_p3 ( h , r ) ; for ( i = 0 ; i < 64 ; i += 2 ) { select ( t , i / 2 , e [ i ] ) ; ge_madd . ge_madd ( r , h , t ) ; ge_p1p1_to_p3 . ge_p1p1_to_p3 ( h , r ) ; } }
/*
h = a * B
where a = a[0]+256*a[1]+...+256^31 a[31]
B is the Ed25519 base point (x,4/5) with x positive.

Preconditions:
a[31] <= 127