forked from quic-go/quic-go
remove DiversificationNonce() from the AEAD interface
This commit is contained in:
@@ -6,5 +6,4 @@ import "github.com/lucas-clemente/quic-go/protocol"
|
|||||||
type AEAD interface {
|
type AEAD interface {
|
||||||
Open(packetNumber protocol.PacketNumber, associatedData []byte, ciphertext []byte) ([]byte, error)
|
Open(packetNumber protocol.PacketNumber, associatedData []byte, ciphertext []byte) ([]byte, error)
|
||||||
Seal(packetNumber protocol.PacketNumber, associatedData []byte, plaintext []byte) []byte
|
Seal(packetNumber protocol.PacketNumber, associatedData []byte, plaintext []byte) []byte
|
||||||
DiversificationNonce() []byte
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,5 +56,3 @@ func makeNonce(iv []byte, packetNumber protocol.PacketNumber) []byte {
|
|||||||
binary.LittleEndian.PutUint64(res[4:12], uint64(packetNumber))
|
binary.LittleEndian.PutUint64(res[4:12], uint64(packetNumber))
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
func (aeadChacha20Poly1305) DiversificationNonce() []byte { return nil }
|
|
||||||
|
|||||||
@@ -61,8 +61,4 @@ var _ = Describe("Chacha20poly1305", func() {
|
|||||||
_, err = NewAEADChacha20Poly1305(keyBob, keyAlice, ivBob, ivAlice[1:])
|
_, err = NewAEADChacha20Poly1305(keyBob, keyAlice, ivBob, ivAlice[1:])
|
||||||
Expect(err).To(MatchError(e))
|
Expect(err).To(MatchError(e))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("has nil diversification nonce", func() {
|
|
||||||
Expect(alice.DiversificationNonce()).To(BeEmpty())
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -47,5 +47,3 @@ func (NullAEAD) Seal(packetNumber protocol.PacketNumber, associatedData []byte,
|
|||||||
copy(res[12:], plaintext)
|
copy(res[12:], plaintext)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
func (NullAEAD) DiversificationNonce() []byte { return nil }
|
|
||||||
|
|||||||
@@ -38,8 +38,4 @@ var _ = Describe("Crypto/NullAEAD", func() {
|
|||||||
_, err := NullAEAD{}.Open(0, nil, nil)
|
_, err := NullAEAD{}.Open(0, nil, nil)
|
||||||
Expect(err).To(MatchError("NullAEAD: ciphertext cannot be less than 12 bytes long"))
|
Expect(err).To(MatchError("NullAEAD: ciphertext cannot be less than 12 bytes long"))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("has nil diversification nonce", func() {
|
|
||||||
Expect(NullAEAD{}.DiversificationNonce()).To(BeEmpty())
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user