From 79a1ad50ee8369bbccc444d301a8574fe961cbe7 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 23 Nov 2014 23:02:15 +0100 Subject: [PATCH] Remove check for minimum buffer length --- key.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/key.go b/key.go index 61acad949..4464dfd4d 100644 --- a/key.go +++ b/key.go @@ -257,10 +257,6 @@ func (k *Key) newIV(buf []byte) error { // HMAC. Encrypt returns the ciphertext's length. For the hash function, SHA256 // is used, so the overhead is 16+32=48 byte. func (k *Key) encrypt(ks *keys, ciphertext, plaintext []byte) (int, error) { - if cap(ciphertext) < maxCiphertextSize { - panic("encryption buffer is too small") - } - if cap(ciphertext) < len(plaintext)+ivSize+hmacSize { return 0, ErrBufferTooSmall }