mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 20:26:19 +08:00
sm2/9: key exchange destroy, fix #80
This commit is contained in:
parent
3f9e1d5bd9
commit
fb7041acbc
@ -53,8 +53,6 @@ func (ke *KeyExchange) Destroy() {
|
||||
destroyBytes(ke.z)
|
||||
destroyBytes(ke.peerZ)
|
||||
destroyBigInt(ke.r)
|
||||
destroyPublicKey(ke.secret)
|
||||
destroyPublicKey(ke.peerSecret)
|
||||
destroyPublicKey(ke.v)
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ import (
|
||||
_sm2ec "github.com/emmansun/gmsm/internal/sm2ec"
|
||||
)
|
||||
|
||||
// TODO: will merge it with sm2p256_generic.go from golang 1.18 with generic support.
|
||||
type sm2Curve struct {
|
||||
newPoint func() *_sm2ec.SM2P256Point
|
||||
params *elliptic.CurveParams
|
||||
|
@ -487,12 +487,6 @@ func (ke *KeyExchange) Destroy() {
|
||||
if ke.r != nil {
|
||||
ke.r.SetInt64(0)
|
||||
}
|
||||
if ke.secret != nil {
|
||||
ke.secret.Set(bn256.Gen1)
|
||||
}
|
||||
if ke.peerSecret != nil {
|
||||
ke.peerSecret.Set(bn256.Gen1)
|
||||
}
|
||||
if ke.g1 != nil {
|
||||
ke.g1.SetOne()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user