forked from quic-go/quic-go
implement AES-GCM as AEAD
This commit is contained in:
@@ -16,7 +16,7 @@ type NullAEAD struct{}
|
||||
var _ AEAD = &NullAEAD{}
|
||||
|
||||
// Open and verify the ciphertext
|
||||
func (*NullAEAD) Open(associatedData []byte, r io.Reader) (*bytes.Reader, error) {
|
||||
func (*NullAEAD) Open(packetNumber uint64, associatedData []byte, r io.Reader) (*bytes.Reader, error) {
|
||||
ciphertext, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -40,7 +40,7 @@ func (*NullAEAD) Open(associatedData []byte, r io.Reader) (*bytes.Reader, error)
|
||||
}
|
||||
|
||||
// Seal writes hash and ciphertext to the buffer
|
||||
func (*NullAEAD) Seal(b *bytes.Buffer, associatedData []byte, plaintext []byte) {
|
||||
func (*NullAEAD) Seal(packetNumber uint64, b *bytes.Buffer, associatedData []byte, plaintext []byte) {
|
||||
hash := New128a()
|
||||
hash.Write(associatedData)
|
||||
hash.Write(plaintext)
|
||||
|
||||
Reference in New Issue
Block a user