mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 04:06:18 +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.z)
|
||||||
destroyBytes(ke.peerZ)
|
destroyBytes(ke.peerZ)
|
||||||
destroyBigInt(ke.r)
|
destroyBigInt(ke.r)
|
||||||
destroyPublicKey(ke.secret)
|
|
||||||
destroyPublicKey(ke.peerSecret)
|
|
||||||
destroyPublicKey(ke.v)
|
destroyPublicKey(ke.v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
_sm2ec "github.com/emmansun/gmsm/internal/sm2ec"
|
_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 {
|
type sm2Curve struct {
|
||||||
newPoint func() *_sm2ec.SM2P256Point
|
newPoint func() *_sm2ec.SM2P256Point
|
||||||
params *elliptic.CurveParams
|
params *elliptic.CurveParams
|
||||||
|
@ -487,12 +487,6 @@ func (ke *KeyExchange) Destroy() {
|
|||||||
if ke.r != nil {
|
if ke.r != nil {
|
||||||
ke.r.SetInt64(0)
|
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 {
|
if ke.g1 != nil {
|
||||||
ke.g1.SetOne()
|
ke.g1.SetOne()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user