Skip to content

Commit

Permalink
change error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Emman committed Feb 25, 2022
1 parent d4c1f4d commit 8bf00b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion padding/ansi_x923.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (pad ansiX923Padding) Pad(src []byte) []byte {
func (pad ansiX923Padding) Unpad(src []byte) ([]byte, error) {
srcLen := len(src)
if srcLen == 0 || srcLen%pad.BlockSize() != 0 {
return nil, errors.New("ansi x9.23: invalid src length")
return nil, errors.New("ansi x9.23: src length is not multiple of block size")
}
paddedLen := src[srcLen-1]
if paddedLen == 0 || int(paddedLen) > pad.BlockSize() {
Expand Down
2 changes: 1 addition & 1 deletion padding/pkcs7.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (pad pkcs7Padding) Pad(src []byte) []byte {
func (pad pkcs7Padding) Unpad(src []byte) ([]byte, error) {
srcLen := len(src)
if srcLen == 0 || srcLen%pad.BlockSize() != 0 {
return nil, errors.New("pkcs7: invalid src length")
return nil, errors.New("pkcs7: src length is not multiple of block size")
}
paddedLen := src[srcLen-1]
if paddedLen == 0 || int(paddedLen) > pad.BlockSize() {
Expand Down

0 comments on commit 8bf00b0

Please sign in to comment.