mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-12 12:06:18 +08:00
drbg: rollback hash drbg change
This commit is contained in:
parent
10a97b4c51
commit
95bc8792f8
@ -181,7 +181,7 @@ func (hd *HashDrbg) Generate(b, additional []byte) error {
|
|||||||
}
|
}
|
||||||
if hd.gm { // leftmost(Hash(V))
|
if hd.gm { // leftmost(Hash(V))
|
||||||
md.Write(hd.v)
|
md.Write(hd.v)
|
||||||
md.Sum(b[:0])
|
copy(b, md.Sum(nil))
|
||||||
md.Reset()
|
md.Reset()
|
||||||
} else {
|
} else {
|
||||||
limit := uint64(m+md.Size()-1) / uint64(md.Size())
|
limit := uint64(m+md.Size()-1) / uint64(md.Size())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user