def lmots_sig_to_pub(sig, S, lmots_type, message):
signature = LmotsSignature.deserialize(sig)
if (signature.type != lmots_type):
raise ValueError(err_unknown_typecode)
n, p, w, ls = lmots_params[lmots_type]
hashQ = H(S + signature.C + message + D_MESG)
V = hashQ + checksum(hashQ, w, ls)
hash = SHA256.new()
hash.update(S)
for i, y in enumerate(signature.y):
tmp = y
for j in xrange(coef(V, i, w), 2**w - 1):
tmp = H(S + tmp + u16str(i) + u8str(j) + D_ITER)
hash.update(tmp)
hash.update(D_PBLC)
return hash.digest()
# ***************************************************************
# |
# LMS N-time signatures functions |
# |
# ***************************************************************
评论列表
文章目录