mirror of
https://github.com/logos-messaging/noise.git
synced 2026-01-02 14:13:07 +00:00
Skip first block when rekeying
This commit is contained in:
parent
d3253d3baa
commit
8f09b6f6b7
11
box/box.go
11
box/box.go
@ -228,7 +228,7 @@ func (noise255) NewCipher(cc []byte) CipherContext {
|
||||
|
||||
type noise255ctx struct {
|
||||
cc []byte
|
||||
keystream [104]byte
|
||||
keystream [168]byte
|
||||
}
|
||||
|
||||
func (n *noise255ctx) Reset(cc []byte) {
|
||||
@ -264,11 +264,12 @@ func (n *noise255ctx) rekey() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
n.cc = n.keystream[64:]
|
||||
for i := range n.cc {
|
||||
n.cc[i] = 0
|
||||
ks := n.keystream[64:]
|
||||
for i := range ks {
|
||||
ks[i] = 0
|
||||
}
|
||||
c.XORKeyStream(n.cc, n.cc)
|
||||
c.XORKeyStream(ks, ks)
|
||||
n.cc = ks[64:]
|
||||
}
|
||||
|
||||
func (n *noise255ctx) mac(keystream, ciphertext, authtext []byte) [16]byte {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user