remove DiversificationNonce() from the AEAD interface

This commit is contained in:
Lucas Clemente
2016-06-02 16:13:48 +02:00
parent 5ed0182b67
commit d87e20efc9
5 changed files with 0 additions and 13 deletions

View File

@@ -6,5 +6,4 @@ import "github.com/lucas-clemente/quic-go/protocol"
type AEAD interface {
Open(packetNumber protocol.PacketNumber, associatedData []byte, ciphertext []byte) ([]byte, error)
Seal(packetNumber protocol.PacketNumber, associatedData []byte, plaintext []byte) []byte
DiversificationNonce() []byte
}

View File

@@ -56,5 +56,3 @@ func makeNonce(iv []byte, packetNumber protocol.PacketNumber) []byte {
binary.LittleEndian.PutUint64(res[4:12], uint64(packetNumber))
return res
}
func (aeadChacha20Poly1305) DiversificationNonce() []byte { return nil }

View File

@@ -61,8 +61,4 @@ var _ = Describe("Chacha20poly1305", func() {
_, err = NewAEADChacha20Poly1305(keyBob, keyAlice, ivBob, ivAlice[1:])
Expect(err).To(MatchError(e))
})
It("has nil diversification nonce", func() {
Expect(alice.DiversificationNonce()).To(BeEmpty())
})
})

View File

@@ -47,5 +47,3 @@ func (NullAEAD) Seal(packetNumber protocol.PacketNumber, associatedData []byte,
copy(res[12:], plaintext)
return res
}
func (NullAEAD) DiversificationNonce() []byte { return nil }

View File

@@ -38,8 +38,4 @@ var _ = Describe("Crypto/NullAEAD", func() {
_, err := NullAEAD{}.Open(0, nil, nil)
Expect(err).To(MatchError("NullAEAD: ciphertext cannot be less than 12 bytes long"))
})
It("has nil diversification nonce", func() {
Expect(NullAEAD{}.DiversificationNonce()).To(BeEmpty())
})
})