gitee.com/lh-her-team/common@v1.5.1/crypto/bulletproofs/bulletproofs_cgo/constants.go (about)

     1  //+build linux,amd64
     2  
     3  package bulletproofs_cgo
     4  
     5  const SINGLE_PROOF_SIZE = 672
     6  const POINT_SIZE = 32
     7  
     8  const OK = 0
     9  const ERR_INVALID_PROOF = -1
    10  const ERR_INVALID_INPUT = -2
    11  const ERR_INTERNAL_ERROR = -3
    12  const ERR_NULL_INPUT = -4
    13  
    14  const ERR_MSG_INVALID_PROOF = "invalid proof"
    15  const ERR_MSG_INVALID_INPUT = "wrong input data format"
    16  const ERR_MSG_NULL_INPUT = "input is null"
    17  const ERR_MSG_DEFAULT = "unknown error"
    18  
    19  func getErrMsg(code int64) string {
    20  	switch code {
    21  	case -1:
    22  		return ERR_MSG_INVALID_PROOF
    23  	case -2:
    24  		return ERR_MSG_INVALID_INPUT
    25  	case -4:
    26  		return ERR_MSG_NULL_INPUT
    27  	default:
    28  		return ERR_MSG_DEFAULT
    29  	}
    30  }