'Return a tuple of (g, p) for a Diffe-Hellman process, with p being as
close to bits bits as possible.
@type bits: L{int}
@rtype:     L{tuple}'

def getDHPrime(self, bits):

    primesKeys = sorted(self.primes.keys(), key=(lambda i: abs((i - bits))))
    realBits = primesKeys[0]
    return random.choice(self.primes[realBits])
