sm2/9: key exchange destroy, fix #80

This commit is contained in:
Sun Yimin 2022-08-30 09:54:29 +08:00 committed by GitHub
parent 3f9e1d5bd9
commit fb7041acbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 9 deletions

View File

@ -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)
}

View File

@ -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

View File

@ -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()
}