crypto

package
v0.0.0-...-7ede18c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestPubKey = []byte("0419e18e6ba7feb6e76fbd933030a20dfe59a24e04ec51133ef5b6825d0457524f1044f00826cc01bbfa981f50e6cbe16446a0760b3d872d716a51e409d8a5deb7")
View Source
var TestSecKey = []byte("ebd71b84d374f881e5280b708c502b2e69de22578d2b1c0fd4dcccd29ad7f4f3")

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

func AesEncrypt

func AesEncrypt(origData, key []byte) ([]byte, error)

func Crypto

func Crypto(data []byte, secKey []byte) ([]byte, error)

func GenerateKeyPair

func GenerateKeyPair() (pubkey, privkey []byte)

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func PubKey

func PubKey(priv []byte) ([]byte, error)

func RecoverPubKey

func RecoverPubKey(msg, sign []byte) ([]byte, error)

func S256

func S256() *secp256k1.BitCurve

func Sha3_256

func Sha3_256(data []byte) []byte

func Validate

func Validate(data, hash []byte) error

func Verify

func Verify(sign, pubKey, msg []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL