package blockmode

import "xdx.jelly/xgcl/gerrors"

//go:generate stringer -type=ErrorCode -linecomment -output=errors_string.go errors.go
type ErrorCode gerrors.ErrorCode

func (e ErrorCode) Error() string {
	return gerrors.Format(uint32(e), e.String())
}

// error codes
const (
	ErrInvalidInput       ErrorCode = 0x0100b000 + iota //输入不合法
	ErrInvalidIV                                        //输入IV不合法
	ErrAEADTagCheckFailed                               //AEAD解密tag校验失败
	ErrAEADOpenFailed                                   //AEAD解密失败
	ErrGCMEncFailed                                     //GCM加密失败
	ErrGCMDecFailed                                     //GCM解密失败
	ErrXTSEncFailed                                     //XTS加密失败
	ErrXTSDecFailed                                     //XTS解密失败
)
