(digit=10)
return p, primitive_root(p), randrange(2, p)
Return three number tuple as private key.

    Elgamal encryption is based on the mathmatical problem
    called the Discrete Logarithm Problem (DLP). For example,

    `a^{b} \equiv c \pmod p`

    In general, if a and b are known, c is easily
    calculated. If b is unknown, it is hard to use
    a and c to get b.

    Parameters
    ==========

    digit : Key length in binary

    Returns
    =======

    (p, r, d) : p = prime number, r = primitive root, d = random number


    Examples
    ========

    >>> from sympy.crypto.crypto import elgamal_private_key
    >>> from sympy.ntheory import is_primitive_root, isprime
    >>> a, b, _ = elgamal_private_key()
    >>> isprime(a)
    True
    >>> is_primitive_root(b, a)
    True
Return three number tuple as private key.
Return three number tuple as private key .
def elgamal_private_key(digit=10):
    """
    Return three number tuple as private key.

    Elgamal encryption is based on the mathmatical problem
    called the Discrete Logarithm Problem (DLP). For example,

    `a^{b} \equiv c \pmod p`

    In general, if a and b are known, c is easily
    calculated. If b is unknown, it is hard to use
    a and c to get b.

    Parameters
    ==========

    digit : Key length in binary

    Returns
    =======

    (p, r, d) : p = prime number, r = primitive root, d = random number


    Examples
    ========

    >>> from sympy.crypto.crypto import elgamal_private_key
    >>> from sympy.ntheory import is_primitive_root, isprime
    >>> a, b, _ = elgamal_private_key()
    >>> isprime(a)
    True
    >>> is_primitive_root(b, a)
    True

    """
    p = nextprime(2**digit)
    return p, primitive_root(p), randrange(2, p)
def elgamal_private_key ( digit = 10 ) : p = nextprime ( 2 ** digit ) return p , primitive_root ( p ) , randrange ( 2 , p )