parameters: (msg, key_tuple, k=None)
return_statement: return elg.sign(msg, k)
docstring: Create an ElGamal signature.
  
      :Parameters:
          - `msg`: string of data signature applies to 
          - `key_tuple`: tuple ElGamal key integers (p, g, x)
            (see `ElGamal key tuple`_)
          - `k`: integer (must be relatively prime to p-1)
  
      :Returns: tuple (integer, integer) ElGamal signature values (a, b)
      
      .. _ElGamal key tuple:
  
      ElGamal key tuple:
              
          - `p`: integer ElGamal prime
          - `g`: integer ElGamal random "g" value
          - `x`: integer ElGamal private key
docstring_summary: Create an ElGamal signature.
docstring_tokens: Create an ElGamal signature .
function: def sign_ElGamal(msg, key_tuple, k=None):
      """Create an ElGamal signature.
  
      :Parameters:
          - `msg`: string of data signature applies to 
          - `key_tuple`: tuple ElGamal key integers (p, g, x)
            (see `ElGamal key tuple`_)
          - `k`: integer (must be relatively prime to p-1)
  
      :Returns: tuple (integer, integer) ElGamal signature values (a, b)
      
      .. _ElGamal key tuple:
  
      ElGamal key tuple:
              
          - `p`: integer ElGamal prime
          - `g`: integer ElGamal random "g" value
          - `x`: integer ElGamal private key
      """
      import Crypto.PublicKey.ElGamal as ELG
      if k is None: # generate our own prime k value (k relatively prime to p-1)
          import Crypto.Util.number as NUM
          import Crypto.Util.randpool as RND
          rnd = RND.RandomPool()
          q = key_tuple[0] # no restrictions on bit length for k, good enough?
          k = NUM.getPrime(8*len(STN.int2str(q)), rnd.get_bytes)
      elg = ELG.construct((key_tuple[0], key_tuple[1], 0, key_tuple[2]))
      return elg.sign(msg, k)
function_tokens: def sign_ElGamal ( msg , key_tuple , k = None ) : import Crypto . PublicKey . ElGamal as ELG if k is None : # generate our own prime k value (k relatively prime to p-1) import Crypto . Util . number as NUM import Crypto . Util . randpool as RND rnd = RND . RandomPool ( ) q = key_tuple [ 0 ] # no restrictions on bit length for k, good enough? k = NUM . getPrime ( 8 * len ( STN . int2str ( q ) ) , rnd . get_bytes ) elg = ELG . construct ( ( key_tuple [ 0 ] , key_tuple [ 1 ] , 0 , key_tuple [ 2 ] ) ) return elg . sign ( msg , k )