When creating a cbc encrypter/decrypter (CryptBlocks) it doesn't check "The length
of src must be a multiple of the block size" (for example, I was expecting it to
use "default" padding of all zeros in that case, or some character sequence
delivered by others is dissatisfied the continue, it will panic. see
http://play.golang.org/p/3P1BzW76BC ). Post Go 1 it would likely be better to:
- CryptBlocks returns error, but this will change the signatures of CryptBlocks
- panic if the length of src is not a multiple of the block size, so it is clear where
is the actual error
ps:According to cipher.BlockMode
// CryptBlocks encrypts or decrypts a number of blocks. The length of
// src must be a multiple of the block size. Dst and src may point to
// the same memory.
CryptBlocks(dst, src []byte)
by xuxinhua1984: