Test vectors for Ed25519
Encoding is Little-Endian ( section 5.1.2.)

All values are coded as octet strings, and integers are coded using
little-endian convention, i.e., a 32-octet string h h[0],...h[31]
represents the integer h[0] + 2^8 * h[1] + ... + 2^248 * h[31].


Key Generation (section 5.1.5)


Hash the 32-byte private key using SHA-512, storing the digest in
a 64-octet large buffer, denoted h.  Only the lower 32 bytes are
used for generating the public key.


Therefore you have 32-byte private key that needs to be hashed with SHA-512.


Prune the buffer: The lowest three bits of the first octet are
cleared, the highest bit of the last octet is cleared, and the
second highest bit of the last octet is set.


This is for the lower 32-byte output of the SHA-512


Interpret the buffer as the little-endian integer, forming a
secret scalar s.  Perform a fixed-base scalar multiplication
[s]B.



Public key (5.1.5)


The public key A is the encoding of the point [s]B.  First,
encode the y-coordinate (in the range 0 &lt;= y &lt; p) as a little-
endian string of 32 octets.  The most significant bit of the
final octet is always zero.  To form the encoding of the point
[s]B, copy the least significant bit of the x coordinate to the
most significant bit of the final octet.  The result is the
public key.



Python Sample (Section 6)


   # Points are represented as tuples (X, Y, Z, T) of extended
   # coordinates, with x = X/Z, y = Y/Z, x*y = T/Z

    def point_compress(P):
        zinv = modp_inv(P[2])
        x = P[0] * zinv % p
        y = P[1] * zinv % p
        return int.to_bytes(y | ((x &amp; 1) &lt;&lt; 255), 32, &quot;little&quot;)
    
    def point_decompress(s):
        if len(s) != 32:
            raise Exception(&quot;Invalid input length for decompression&quot;)
        y = int.from_bytes(s, &quot;little&quot;)
        sign = y &gt;&gt; 255
        y &amp;= (1 &lt;&lt; 255) - 1
    
        x = recover_x(y, sign)
        if x is None:
            return None
        else:
            return (x, y, 1, x*y % p)
    
    ## These are functions for manipulating the private key.
    
    def secret_expand(secret):
        if len(secret) != 32:
            raise Exception(&quot;Bad size of private key&quot;)
        h = sha512(secret)
        a = int.from_bytes(h[:32], &quot;little&quot;)
        a &amp;= (1 &lt;&lt; 254) - 8
        a |= (1 &lt;&lt; 254)
        return (a, h[32:])
    
    def secret_to_public(secret):
        (a, dummy) = secret_expand(secret)
        return point_compress(point_mul(a, G))