code: func PKCS7Unpad(data []byte, blockSize int) ([]byte, error) {
  	length := len(data)
  	if length == 0 {
  		return nil, errors.New("Invalid padding size")
  	}
  	if length%blockSize != 0 {
  		return nil, errors.New("Invalid padding size")
  	}
  	pad := data[length-1]
  	padLen := int(pad)
  	if padLen > blockSize || padLen == 0 {
  		return nil, errors.New("Invalid padding size")
  	}
  	// TODO: Fix timing attack here.
  	for _, v := range data[length-padLen : length-1] {
  		if v != pad {
  			return nil, errors.New("Invalid padding")
  		}
  	}
  	return data[:length-padLen], nil
  }
docs: // PKCS7Unpad unpads data using PKCS7.
  // See http://tools.ietf.org/html/rfc2315.