change AEAD interface to use byte slices, simplifying its usage

This commit is contained in:
Lucas Clemente
2016-04-18 14:37:34 +02:00
parent dc4e3c73e4
commit 9cbeb49d49
8 changed files with 62 additions and 110 deletions

View File

@@ -1,14 +1,9 @@
package crypto
import (
"bytes"
"io"
"github.com/lucas-clemente/quic-go/protocol"
)
import "github.com/lucas-clemente/quic-go/protocol"
// An AEAD implements QUIC's authenticated encryption and associated data
type AEAD interface {
Open(packetNumber protocol.PacketNumber, associatedData []byte, ciphertext io.Reader) (*bytes.Reader, error)
Seal(packetNumber protocol.PacketNumber, b *bytes.Buffer, associatedData []byte, plaintext []byte)
Open(packetNumber protocol.PacketNumber, associatedData []byte, ciphertext []byte) ([]byte, error)
Seal(packetNumber protocol.PacketNumber, associatedData []byte, plaintext []byte) []byte
}