simplify AEAD.Seal

This commit is contained in:
Lucas Clemente
2016-04-10 20:33:24 +02:00
parent 893704e38f
commit 96ae3efa64
3 changed files with 3 additions and 5 deletions

View File

@@ -40,9 +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, r *bytes.Reader) {
plaintext, _ := ioutil.ReadAll(r)
func (*NullAEAD) Seal(b *bytes.Buffer, associatedData []byte, plaintext []byte) {
hash := New128a()
hash.Write(associatedData)
hash.Write(plaintext)