forked from quic-go/quic-go
improve crypto test coverage
This commit is contained in:
@@ -33,4 +33,13 @@ var _ = Describe("Crypto/NullAEAD", func() {
|
||||
aead := &NullAEAD{}
|
||||
Expect(aead.Seal(0, aad, plainText)).To(Equal(append([]byte{0x98, 0x9b, 0x33, 0x3f, 0xe8, 0xde, 0x32, 0x5c, 0xa6, 0x7f, 0x9c, 0xf7}, []byte("They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.")...)))
|
||||
})
|
||||
|
||||
It("rejects short ciphertexts", 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())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user