diff --git a/common/bytes.go b/common/bytes.go
index 0342083a1e07acf919ae14ebf7ae8c9d19b62196..c445968f2231a6b13072484c02bcd98bac26ddfa 100644
--- a/common/bytes.go
+++ b/common/bytes.go
@@ -89,18 +89,18 @@ func Hex2BytesFixed(str string, flen int) []byte {
 }
 
 func RightPadBytes(slice []byte, l int) []byte {
-	if l < len(slice) {
+	if l <= len(slice) {
 		return slice
 	}
 
 	padded := make([]byte, l)
-	copy(padded[0:len(slice)], slice)
+	copy(padded, slice)
 
 	return padded
 }
 
 func LeftPadBytes(slice []byte, l int) []byte {
-	if l < len(slice) {
+	if l <= len(slice) {
 		return slice
 	}