summaryrefslogtreecommitdiff
path: root/src/keypair.go
blob: e7961a8eb843af375261eb82c76f06fc624a8dd1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import (
	"crypto/cipher"
	"sync"
)

type KeyPair struct {
	recv      cipher.AEAD
	recvNonce uint64
	send      cipher.AEAD
	sendNonce uint64
}

type KeyPairs struct {
	mutex      sync.RWMutex
	current    *KeyPair
	previous   *KeyPair
	next       *KeyPair
	newKeyPair chan bool
}