drbg: rollback hash drbg change

This commit is contained in:
Sun Yimin 2024-06-05 13:07:29 +08:00 committed by GitHub
parent 10a97b4c51
commit 95bc8792f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,7 +181,7 @@ func (hd *HashDrbg) Generate(b, additional []byte) error {
}
if hd.gm { // leftmost(Hash(V))
md.Write(hd.v)
md.Sum(b[:0])
copy(b, md.Sum(nil))
md.Reset()
} else {
limit := uint64(m+md.Size()-1) / uint64(md.Size())