fix: endianness of nonce function

This commit is contained in:
Richard Ramos 2022-12-21 12:46:15 -04:00
parent 962299d8b4
commit d654270130
No known key found for this signature in database
GPG Key ID: BD36D48BC9FFC88C

View File

@ -67,8 +67,10 @@ func (c *CipherState) hasKey() bool {
} }
func (cs *CipherState) nonce() []byte { func (cs *CipherState) nonce() []byte {
var nonceBytes [12]byte // RFC7539 specifies 12 bytes for nonce. // RFC7539 specifies 12 bytes for nonce.
binary.BigEndian.PutUint64(nonceBytes[4:], cs.n) // TODO: extract this to function setup when creating handshake pattern
var nonceBytes [12]byte
binary.LittleEndian.PutUint64(nonceBytes[4:], cs.n)
return nonceBytes[:] return nonceBytes[:]
} }