mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 20:26:19 +08:00
internal/bigmod: explicitly clear expanded limbs on reset #313
This commit is contained in:
parent
71b196a5ac
commit
65a69ad83c
@ -96,7 +96,8 @@ func (x *Nat) reset(n int) *Nat {
|
||||
x.limbs = make([]uint, n)
|
||||
return x
|
||||
}
|
||||
clear(x.limbs)
|
||||
// Clear both the returned limbs and the previously used ones.
|
||||
clear(x.limbs[:max(n, len(x.limbs))])
|
||||
x.limbs = x.limbs[:n]
|
||||
return x
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user