INNER CODE UNIT · Python

generate_point_from_seed

schollz/pake · ed25519_points.py:36

def generate_point_from_seed(seed: str) -> tuple:
    """
    Generate an ed25519 point from a seed string.
    Returns the point as a big integer representation.
    """
    scalar = hash_to_scalar(seed)

    # Generate point using scalar multiplication with the base point
    # In practice, this would use Edwards25519 scalar base multiplication
    private_key = Ed25519PrivateKey.from_private_bytes(scalar)
    public_key = private_key.public_key()

    # Get the raw 32-byte point encoding
    point_bytes = public_key.public_bytes(
        encoding=serialization.Encoding.Raw, format=serialization.PublicFormat.Raw
    )

    # Convert to big integer (as stored in the Go implementation)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…