mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
crypto: use clear from go1.21 (#29307)
This commit is contained in:
parent
d0566e4165
commit
efad15f9f4
2 changed files with 3 additions and 9 deletions
|
|
@ -287,7 +287,5 @@ func PubkeyToAddress(p ecdsa.PublicKey) common.Address {
|
|||
}
|
||||
|
||||
func zeroBytes(bytes []byte) {
|
||||
for i := range bytes {
|
||||
bytes[i] = 0
|
||||
}
|
||||
clear(bytes)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,12 +44,8 @@ func (BitCurve *BitCurve) ScalarMult(Bx, By *big.Int, scalar []byte) (*big.Int,
|
|||
// Unpack the result and clear temporaries.
|
||||
x := new(big.Int).SetBytes(point[:32])
|
||||
y := new(big.Int).SetBytes(point[32:])
|
||||
for i := range point {
|
||||
point[i] = 0
|
||||
}
|
||||
for i := range padded {
|
||||
scalar[i] = 0
|
||||
}
|
||||
clear(point)
|
||||
clear(scalar)
|
||||
if res != 1 {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue