mathtls.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:GAMADV-XTD 作者: taers232c 项目源码 文件源码
def PRF(secret, label, seed, length):
    #Split the secret into left and right halves
    S1 = secret[ : int(math.ceil(len(secret)/2.0))]
    S2 = secret[ int(math.floor(len(secret)/2.0)) : ]

    #Run the left half through P_MD5 and the right half through P_SHA1
    p_md5 = P_hash(md5, S1, concatArrays(stringToBytes(label), seed), length)
    p_sha1 = P_hash(sha, S2, concatArrays(stringToBytes(label), seed), length)

    #XOR the output values and return the result
    for x in range(length):
        p_md5[x] ^= p_sha1[x]
    return p_md5
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号