crypto

package
v0.6.28-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

It converts a `WebauthnCredential` to a `webauthn.Credential`

Index

Constants

BTCCoinType is the CoinType for Bitcoin.

View Source
const COSMOSCoinType = types.CoinType_CoinType_COSMOS

COSMOSCoinType is the CoinType for Cosmos.

DOGECoinType is the CoinType for Dogecoin.

ETHCoinType is the CoinType for Ethereum.

Ed25519KeyType is the key type for ed25519.

FILECOINCoinType is the CoinType for Filecoin.

HNSCoinType is the CoinType for Handshake.

LTCCoinType is the CoinType for Litecoin.

RSAKeyType is the key type for RSA.

SOLCoinType is the CoinType for Solana.

SONRCoinType is the CoinType for Sonr.

Secp256k1KeyType is the key type for secp256k1.

TestCoinType is the CoinType for Testnet.

WebAuthnKeyType is the key type for WebAuthn.

XRPCoinType is the CoinType for XRP.

Variables

View Source
var AllCoinTypes = types.AllCoinTypes

AllCoinTypes is a slice of all CoinTypes.

Functions

func Base58Decode added in v0.6.19

func Base58Decode(str string) ([]byte, error)

Base58Decode takes a base68 encoded string and returns a byte array.

func Base58Encode added in v0.6.19

func Base58Encode(bz []byte) string

Base58Encode takes a byte array and returns a base68 encoded string.

func Base64Decode added in v0.6.20

func Base64Decode(str string) ([]byte, error)

Base64Decode takes a base64 encoded string and returns a byte array.

func Base64Encode added in v0.6.20

func Base64Encode(bz []byte) string

Base64Encode takes a byte array and returns a base64 encoded string.

func DeriveBIP44

func DeriveBIP44(config *cmp.Config, coinType types.CoinType, account, change, addressIndex uint32) (*cmp.Config, error)

This function derives a BIP44 configuration for a specific coin type, account, change, and address index.

Types

type CoinType

type CoinType = types.CoinType

CoinType is a type alias for types.CoinType in pkg/crypto/internal/types.

func CoinTypeFromAddrPrefix

func CoinTypeFromAddrPrefix(str string) CoinType

CoinTypeFromAddrPrefix returns the CoinType from the public key address prefix (btc, eth).

func CoinTypeFromBipPath

func CoinTypeFromBipPath(i int32) CoinType

CoinTypeFromBipPath returns the CoinType from the BIP Path (0, 60).

func CoinTypeFromDidMethod

func CoinTypeFromDidMethod(str string) CoinType

CoinTypeFromDidMethod returns the CoinType from the DID Method (btc, eth).

func CoinTypeFromName

func CoinTypeFromName(str string) CoinType

CoinTypeFromName returns the CoinType from the Blockchain name (Bitcoin, Ethereum).

func CoinTypeFromTicker

func CoinTypeFromTicker(str string) CoinType

CoinTypeFromTicker returns the CoinType from the tokens Ticker (BTC, ETH).

type KeyType

type KeyType = types.KeyType

KeyType is a type alias for types.KeyType in pkg/crypto/internal/types.

type MPCCmpConfig

type MPCCmpConfig = cmp.Config

MPCCmpConfig is a type alias for pool.CmpConfig in pkg/pool.

type MPCECDSASignature

type MPCECDSASignature = ecdsa.Signature

MPCECDSASignature is a type alias for ecdsa.Signature in pkg/ecdsa.

func NewEmptyECDSASecp256k1Signature

func NewEmptyECDSASecp256k1Signature() MPCECDSASignature

NewEmptyECDSASecp256k1Signature creates a new empty MPCECDSASignature.

type MPCPool

type MPCPool = pool.Pool

MPCPool is a type alias for pool.Pool in pkg/pool.

func NewMPCPool

func NewMPCPool(size int) *MPCPool

NewMPCPool creates a new MPCPool with the given size.

type MPCSecp256k1Curve

type MPCSecp256k1Curve = curve.Secp256k1

MPCSecp256k1Curve is a type alias for curve.Secp256k1Point in pkg/math/curve.

type MPCSecp256k1Point

type MPCSecp256k1Point = curve.Secp256k1Point

MPCSecp256k1Point is a type alias for curve.Secp256k1Point in pkg/math/curve.

type Network

type Network interface {
	// Ls returns a list of peers that are connected to the network.
	Ls() []party.ID

	// A function that takes in a party ID and returns a channel of protocol messages.
	Next(id party.ID) <-chan *protocol.Message

	// Sending a message to the network.
	Send(msg *protocol.Message)

	// A channel that is closed when the party is done with the protocol.
	Done(id party.ID) chan struct{}

	// A function that is called when a party is done with the protocol.
	Quit(id party.ID)

	// IsOnlineNetwork returns true if the network is an online network.
	IsOnlineNetwork() bool
}

A Network is a channel that sends messages to parties and receives messages from parties.

type PartyID

type PartyID = party.ID

PartyID is a type alias for party.ID in pkg/party.

type PeerID

type PeerID = peer.ID

PeerID is a type alias for peer.ID in pkg/peer.

type PubKey

type PubKey = types.PubKey

PubKey is a type alias for types.PubKey in pkg/crypto/internal/types.

func NewEd25519PubKey

func NewEd25519PubKey(bz []byte) *PubKey

NewEd25519PubKey takes a byte array of raw public key bytes and returns a PubKey.

func NewPubKeyFromCmpConfig

func NewPubKeyFromCmpConfig(config *cmp.Config) (*PubKey, error)

NewPubKeyFromCmpConfig takes a `cmp.Config` and returns a `PubKey`

func NewRSAPubKey

func NewRSAPubKey(bz []byte) *PubKey

NewRSAPubKey takes a byte array of raw public key bytes and returns a PubKey.

func NewSecp256k1PubKey

func NewSecp256k1PubKey(bz []byte) *PubKey

NewSecp256k1PubKey takes a byte array of raw public key bytes and returns a PubKey.

func NewWebAuthnPubKey

func NewWebAuthnPubKey(bz []byte) *PubKey

NewWebAuthnPubKey takes a byte array of raw public key bytes and returns a PubKey.

func PubKeyFromBytes

func PubKeyFromBytes(bz []byte) (*PubKey, error)

PubKeyFromBytes takes a byte array and returns a PubKey

func PubKeyFromDID

func PubKeyFromDID(did string) (*PubKey, error)

It takes a string of a DID, decodes it from base58, unmarshals it into a PubKey, and returns the PubKey

Jump to

Keyboard shortcuts

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