'''discrete log algorithms'''

def discreteLog(a, b, bound):  # brute force version
    '''Returns x so a**x ==  b, or None if no solution
    for x < bound, fo some integer bound
    Assume a and b are objects in a group that has
    group operations * and ** defined.'''
    a_x = 1
    for x in range(bound):
        if a_x == b: return x
        a_x = a_x * a
    return None

def babyGiantModP(a, b, p):
    '''Solve the dicrete log problem mod p using the Shanks algorithm,
    of order sqrt(p).  Return x so pow(a, x, p) is b % p, or return None.
    '''
    #code for HW 9

def babyGiant(a, b, bound):
    '''Solve the dicrete log problem using the Shanks algorithm,
    of order sqrt(bound).
    Assume a and b are objects in a group that has
    group operations * and ** defined.    
    '''
    # code later

