DGHV scheme is the first fully-homomorphic encryption scheme based on the integers,but homomorphic operation in this scheme would result in double increase of the ciphertext size. The ciphertext size must be controlled to a magnitude of less than polynomial bound O( λ7) by homorphical decrypting algorithm,while the ciphertext size would become increasingly large in the internal operation of the homomorphic decryption algorithm. Thus a compact-optimization technique for controlling the ciphertext in homomorphic addition and homomorphic multiplication is proposed,so that the ciphertext size in this scheme would remain within O( λ5),thus eliminating the influence of homomorphic operation on the ciphertext size,and meanwhile the homomorphic evaluation capability of the optimized scheme is further analyzed.