crypto

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: LGPL-3.0 Imports: 6 Imported by: 2

Documentation

Overview

Copyright 2019 ChainSafe Systems (ON) Corp. This file is part of gossamer.

The gossamer library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The gossamer library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the gossamer library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUint64 added in v0.3.0

func AppendUint64(t *merlin.Transcript, label []byte, n uint64)

AppendUint64 appends a uint64 to the given transcript using the given label

func NewBIP39Mnemonic added in v0.3.1

func NewBIP39Mnemonic() (string, error)

NewBIP39Mnemonic returns a new BIP39-compatible mnemonic

func PublicAddressToByteArray added in v0.2.0

func PublicAddressToByteArray(add common.Address) []byte

PublicAddressToByteArray returns []byte address for given PublicKey Address

Types

type KeyType

type KeyType = string

KeyType str

const Ed25519Type KeyType = "ed25519"

Ed25519Type ed25519

const Secp256k1Type KeyType = "secp256k1"

Secp256k1Type secp256k1

const Sr25519Type KeyType = "sr25519"

Sr25519Type sr25519

const UnknownType KeyType = "unknown"

UnknownType is used by the GenericKeystore

type Keypair

type Keypair interface {
	Type() KeyType
	Sign(msg []byte) ([]byte, error)
	Public() PublicKey
	Private() PrivateKey
}

Keypair interface

type PrivateKey

type PrivateKey interface {
	Sign(msg []byte) ([]byte, error)
	Public() (PublicKey, error)
	Encode() []byte
	Decode([]byte) error
	Hex() string
}

PrivateKey interface

type PublicKey

type PublicKey interface {
	Verify(msg, sig []byte) (bool, error)
	Encode() []byte
	Decode([]byte) error
	Address() common.Address
	Hex() string
}

PublicKey interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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