2017-06-24 13:34:17 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/cipher"
|
2017-06-26 11:14:02 +00:00
|
|
|
"sync"
|
2017-06-24 13:34:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type KeyPair struct {
|
2017-06-24 20:03:52 +00:00
|
|
|
recv cipher.AEAD
|
2017-06-26 11:14:02 +00:00
|
|
|
recvNonce uint64
|
2017-06-24 20:03:52 +00:00
|
|
|
send cipher.AEAD
|
2017-06-26 11:14:02 +00:00
|
|
|
sendNonce uint64
|
|
|
|
}
|
|
|
|
|
|
|
|
type KeyPairs struct {
|
|
|
|
mutex sync.RWMutex
|
|
|
|
current *KeyPair
|
|
|
|
previous *KeyPair
|
|
|
|
next *KeyPair
|
|
|
|
newKeyPair chan bool
|
2017-06-24 13:34:17 +00:00
|
|
|
}
|