def myhmac(hash_function, message, key):
    blocksize = hash_function().block_size;
    if (len(key) > blocksize):
        key = hash_function(key).digest()
    if (len(key) < blocksize):
        key += (b'\x00' * (blocksize - len(key)));

    opad = raw_xor(b'\x5c' * blocksize, key);
    ipad = raw_xor(b'\x36' * blocksize, key);
    
    return hash_function(opad + hash_function(ipad + message).digest()).digest();


# To understand SRP, look at how you generate an AES key from DH; now,
# just observe you can do the "opposite" operation an generate a numeric
# parameter from a hash. Then:

# eplace A and B with C and S (client & server)

# C & S           Agree on N=[NIST Prime], g=2, k=3, I (email), P (password)
dataset/ETHPy150Open reschly/cryptopals/prob36.py/myhmac/original