def server_session(user, password, salt, A, B, b):
    """
    Server session secret
        Both:  u = H(A, B)

        Host:  S = (Av^u) ^ b              (computes session key)
        Host:  K = H(S)
    """
    N, g, k = get_prime()
    u = get_scramble(A, B)
    v = get_verifier(user, password, salt)
    vu = pow(v, u, N)                       # v^u
    Avu = (A * vu) % N                      # Av^u
    session_secret = pow(Avu, b, N)         # (Av^u) ^ b
    K = hash_digest(hashlib.sha1, session_secret)
    if DEBUG_PRINT:
        print('server session_secret=', binascii.b2a_hex(long2bytes(session_secret)), end='\n')
        print('server session hash K=', binascii.b2a_hex(K))

    return K
Server session secret
        Both:  u = H(A, B)

        Host:  S = (Av^u) ^ b              (computes session key)
        Host:  K = H(S)