Documentation ¶
Index ¶
- Constants
- Variables
- func B2ImN(bytes []byte) *big.Int
- func DecodeECDSASig(sigStr string) (v byte, r string, s string, err error)
- func KeyGen(seed []byte) (ecdsa.PrivateKey, ecdsa.PublicKey)
- func NewBriSignatureError(key int, err error) error
- func PKBytes(pubKey *ecdsa.PublicKey) []byte
- func SKBytes(priKey *ecdsa.PrivateKey) []byte
- func Sign(keyBytes []byte, data []byte) ([]byte, error)
- func Verify(pubkeyBytes []byte, data []byte, sig []byte) (bool, error)
- type BriSignatureError
Constants ¶
View Source
const ( CBridgeSigSz = 65 CSKSz = 32 )
View Source
const ( UnExpectedError = iota InvalidPrivateKeyErr InvalidPublicKeyErr SignDataErr InvalidDataSignErr InvalidInputParamsSizeErr InvalidCommitteeInfoErr InvalidSignatureErr DecompressFromByteErr JSONError )
Variables ¶
View Source
var ErrCodeMessage = map[int]struct { Code int message string }{ UnExpectedError: {-1200, "Unexpected error"}, InvalidPrivateKeyErr: {-1201, "Private key is invalid"}, InvalidPublicKeyErr: {-1202, "Public key is invalid"}, InvalidDataSignErr: {-1203, "Signed data is invalid"}, InvalidCommitteeInfoErr: {-1204, "Committee's info is invalid"}, InvalidInputParamsSizeErr: {-1205, "Len of Input Params is invalid"}, DecompressFromByteErr: {-1206, "Decompress bytes array to Elliptic point error"}, JSONError: {-1207, "JSON Marshal, Unmarshal error"}, InvalidSignatureErr: {-1208, "Invalid signature"}, SignDataErr: {-1209, "Can not sign data"}, }
Functions ¶
func NewBriSignatureError ¶
func SKBytes ¶
func SKBytes(priKey *ecdsa.PrivateKey) []byte
Types ¶
type BriSignatureError ¶
func (BriSignatureError) Error ¶
func (e BriSignatureError) Error() string
Click to show internal directories.
Click to hide internal directories.