func (hc *halfConn) changeCipherSpec() error {
	slog.Debug("<<--------- changeCipherSpec start ------------->>")
	defer slog.Debug("<<--------- changeCipherSpec end ------------->>\n")
	slog.Debug("Seq ->", hc.seq)
	if hc.nextCipher == nil {
		return alertInternalError
	}
	hc.cipher = hc.nextCipher
	hc.mac = hc.nextMac
	hc.nextCipher = nil
	hc.nextMac = nil
	for i := range hc.seq {
		hc.seq[i] = 0
	}
	return nil
}
changeCipherSpec changes the encryption and MAC states
to the ones previously passed to prepareCipherSpec.
package gmtls
import (
	"bytes"
	"crypto/cipher"
	"crypto/subtle"
	"errors"
	"fmt"
	"io"
	"net"
	"sync"
	"sync/atomic"
	"time"
	"encoding/hex"
	"reflect"
	slog "github.com/cihub/seelog"
	"github.com/piligo/gmsm/sm2"
)
type Conn struct {
	conn     net.Conn
	isClient bool
	handshakeMutex sync.Mutex  
	handshakeCond *sync.Cond
	handshakeErr  error    
	vers          uint16   
	haveVers      bool     
	config        *Config  
	handshakeComplete bool
	handshakes       int
	didResume        bool  
	cipherSuite      uint16
	ocspResponse     []byte    
	scts             [][]byte  
	peerCertificates []*sm2.Certificate
	verifiedChains [][]*sm2.Certificate
	serverName string
	secureRenegotiation bool
	clientFinishedIsFirst bool
	closeNotifyErr error
	closeNotifySent bool
	clientFinished [12]byte
	serverFinished [12]byte
	clientProtocol         string
	clientProtocolFallback bool
	in, out   halfConn      
	rawInput  *block        
	input     *block        
	hand      bytes.Buffer  
	buffering bool          
	sendBuf   []byte        
	bytesSent   int64
	packetsSent int64
	activeCall int32
	tmp [16]byte
}
func (c *Conn) LocalAddr() net.Addr {
	return c.conn.LocalAddr()
}
func (c *Conn) RemoteAddr() net.Addr {
	return c.conn.RemoteAddr()
}
func (c *Conn) SetDeadline(t time.Time) error {
	return c.conn.SetDeadline(t)
}
func (c *Conn) SetReadDeadline(t time.Time) error {
	return c.conn.SetReadDeadline(t)
}
func (c *Conn) SetWriteDeadline(t time.Time) error {
	return c.conn.SetWriteDeadline(t)
}
type halfConn struct {
	sync.Mutex
	err            error        
	version        uint16       
	cipher         interface{}  
	mac            macFunction
	seq            [8]byte   
	bfree          *block    
	additionalData [13]byte  
	nextCipher interface{}  
	nextMac    macFunction  
	inDigestBuf, outDigestBuf []byte
}
func (hc *halfConn) setErrorLocked(err error) error {
	hc.err = err
	return err
}
func (hc *halfConn) prepareCipherSpec(version uint16, cipher interface{}, mac macFunction) {
	hc.version = version
	hc.nextCipher = cipher
	hc.nextMac = mac
}