Remove check for minimum buffer length

This commit is contained in:
Alexander Neumann 2014-11-23 23:02:15 +01:00
parent 719e121c74
commit 79a1ad50ee
1 changed files with 0 additions and 4 deletions

4
key.go
View File

@ -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
}