ed25519

package
v6.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package ed25519 ed25519系统加密包

Index

Constants

View Source
const (
	Name = "ed25519"
	ID   = 2
)

const

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

Driver 驱动

func (Driver) GenKey

func (d Driver) GenKey() (crypto.PrivKey, error)

GenKey 生成私钥

func (Driver) PrivKeyFromBytes

func (d Driver) PrivKeyFromBytes(b []byte) (privKey crypto.PrivKey, err error)

PrivKeyFromBytes 字节转为私钥

func (Driver) PubKeyFromBytes

func (d Driver) PubKeyFromBytes(b []byte) (pubKey crypto.PubKey, err error)

PubKeyFromBytes 字节转为公钥

func (Driver) SignatureFromBytes

func (d Driver) SignatureFromBytes(b []byte) (sig crypto.Signature, err error)

SignatureFromBytes 字节转为签名

type PrivKeyEd25519

type PrivKeyEd25519 [64]byte

PrivKeyEd25519 PrivKey

func (PrivKeyEd25519) Bytes

func (privKey PrivKeyEd25519) Bytes() []byte

Bytes 字节格式

func (PrivKeyEd25519) Equals

func (privKey PrivKeyEd25519) Equals(other crypto.PrivKey) bool

Equals 相等

func (PrivKeyEd25519) PubKey

func (privKey PrivKeyEd25519) PubKey() crypto.PubKey

PubKey 公钥

func (PrivKeyEd25519) Sign

func (privKey PrivKeyEd25519) Sign(msg []byte) crypto.Signature

Sign 签名

type PubKeyEd25519

type PubKeyEd25519 [32]byte

PubKeyEd25519 PubKey

func (PubKeyEd25519) Bytes

func (pubKey PubKeyEd25519) Bytes() []byte

Bytes 字节格式

func (PubKeyEd25519) Equals

func (pubKey PubKeyEd25519) Equals(other crypto.PubKey) bool

Equals 相等

func (PubKeyEd25519) KeyString

func (pubKey PubKeyEd25519) KeyString() string

KeyString 公钥字符串格式

func (PubKeyEd25519) VerifyBytes

func (pubKey PubKeyEd25519) VerifyBytes(msg []byte, sig crypto.Signature) bool

VerifyBytes 验证字节

type SignatureEd25519

type SignatureEd25519 [64]byte

SignatureEd25519 Signature

func (SignatureEd25519) Bytes

func (sig SignatureEd25519) Bytes() []byte

Bytes 字节格式

func (SignatureEd25519) Equals

func (sig SignatureEd25519) Equals(other crypto.Signature) bool

Equals 相等

func (SignatureEd25519) IsZero

func (sig SignatureEd25519) IsZero() bool

IsZero 是否是0

func (SignatureEd25519) String

func (sig SignatureEd25519) String() string

type SignatureS

type SignatureS struct {
	crypto.Signature
}

SignatureS 签名

Jump to

Keyboard shortcuts

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