change AEAD interface to return bytes.Reader instead of io.Reader

This commit is contained in:
Lucas Clemente
2016-04-08 10:22:52 +02:00
parent 27c422a92b
commit 7296d4e55e
4 changed files with 18 additions and 4 deletions

View File

@@ -22,4 +22,14 @@ var _ = Describe("Crypto/NullAEAD", func() {
Expect(err).ToNot(HaveOccurred())
Expect(res).To(Equal([]byte("They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.")))
})
It("fails", func() {
aad := []byte("All human beings are born free and equal in dignity and rights..")
plainText := []byte("They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.")
hash := []byte{0x98, 0x9b, 0x33, 0x3f, 0xe8, 0xde, 0x32, 0x5c, 0xa6, 0x7f, 0x9c, 0xf7}
cipherText := append(hash, plainText...)
aead := &crypto.NullAEAD{}
_, err := aead.Open(aad, bytes.NewReader(cipherText))
Expect(err).To(HaveOccurred())
})
})