crypto

package module
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

README

crypto

Go Reference

Specifies the cryptographic algorithms and modes used by the crypto module. Forked from the original Coinbase kryptology library.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKeyshareRole = errors.New("invalid keyshare role")

Functions

func ComputeEcPoint

func ComputeEcPoint(pubKey []byte) (*curves.EcPoint, error)

ComputeEcPoint builds an elliptic curve point from a compressed byte slice

func ComputeEcdsaPublicKey

func ComputeEcdsaPublicKey(pubKey []byte) (*genericecdsa.PublicKey, error)

func GetECDSAPublicKey

func GetECDSAPublicKey(ks MPCShare) (*ecdsa.PublicKey, error)

GetECDSAPublicKey is the public key for the keyshare

func GetMPCMessage

func GetMPCMessage(k MPCShare) *protocol.Message

GetMPCMessage returns the protocol.Message for the keyshare

func GetRawPublicKey

func GetRawPublicKey(ks MPCShare) ([]byte, error)

GetRawPublicKey is the public key for the keyshare

func SerializeMPCSignature

func SerializeMPCSignature(sig MPCSignature) ([]byte, error)

SerializeSecp256k1Signature serializes an ECDSA signature into a byte slice

func VerifyMPCSignature

func VerifyMPCSignature(sig MPCSignature, msg []byte, publicKey *ecdsa.PublicKey) bool

VerifyMPCSignature verifies an MPC signature

func VerifySignature

func VerifySignature(ks MPCShare, msg []byte, sig []byte) (bool, error)

VerifySignature verifies the signature of a message

Types

type MPCMessage

type MPCMessage *protocol.Message

MPCMessage is the protocol.Message that is used for MPC

type MPCPublicKey

type MPCPublicKey *ecdsa.PublicKey

type MPCRole

type MPCRole int
const (
	MPCRoleUnknown MPCRole = iota
	MPCRoleUser
	MPCRoleValidator
)

func (MPCRole) IsUser

func (r MPCRole) IsUser() bool

func (MPCRole) IsValidator

func (r MPCRole) IsValidator() bool

type MPCShare

type MPCShare interface {
	Equals(o MPCShare) bool
	GetPayloads() map[string][]byte
	GetMetadata() map[string]string
	GetPublicKey() []byte
	GetProtocol() string
	GetRole() int32
	GetVersion() uint32
	Marshal() (string, error)
	Unmarshal(data string) error
}

func GenerateMPCKeyshares added in v1.30.0

func GenerateMPCKeyshares() ([]MPCShare, error)

GenerateMPCKeyshares generates a new MPC keyshare

func RunMPCRefresh

func RunMPCRefresh(refreshFuncVal RefreshFunc, refreshFuncUser RefreshFunc) ([]MPCShare, error)

RunMPCRefresh runs the MPC refresh protocol

type MPCSignature

type MPCSignature *curves.EcdsaSignature

func DeserializeMPCSignature

func DeserializeMPCSignature(sigBytes []byte) (MPCSignature, error)

DeserializeSecp256k1Signature deserializes an ECDSA signature from a byte slice

func RunMPCSign

func RunMPCSign(signFuncVal SignFunc, signFuncUser SignFunc) (MPCSignature, error)

RunMPCSign runs the MPC signing protocol

type RefreshFunc

type RefreshFunc interface {
	protocol.Iterator
}

RefreshFunc is the type for the refresh function

func GetRefreshFunc

func GetRefreshFunc(ks MPCShare) (RefreshFunc, error)

GetRefreshFunc returns the refresh function for the keyshare

type SignFunc

type SignFunc interface {
	protocol.Iterator
}

SignFunc is the type for the sign function

func GetSignFunc

func GetSignFunc(ks MPCShare, msg []byte) (SignFunc, error)

GetSignFunc returns the sign function for the keyshare

Directories

Path Synopsis
Package accumulator implements the cryptographic accumulator as described in https://eprint.iacr.org/2020/777.pdf It also implements the zero knowledge proof of knowledge protocol described in section 7 of the paper.
Package accumulator implements the cryptographic accumulator as described in https://eprint.iacr.org/2020/777.pdf It also implements the zero knowledge proof of knowledge protocol described in section 7 of the paper.
Package bulletproof implements the zero knowledge protocol bulletproofs as defined in https://eprint.iacr.org/2017/1066.pdf
Package bulletproof implements the zero knowledge protocol bulletproofs as defined in https://eprint.iacr.org/2017/1066.pdf
Package core contains a set of primitives, including but not limited to various elliptic curves, hashes, and commitment schemes.
Package core contains a set of primitives, including but not limited to various elliptic curves, hashes, and commitment schemes.
curves
Package curves: Field implementation IS NOT constant time as it leverages math/big for big number operations.
Package curves: Field implementation IS NOT constant time as it leverages math/big for big number operations.
curves/native/k256/fp
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography.
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography.
curves/native/k256/fq
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography.
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography.
curves/native/p256/fp
Code generated by Fiat Cryptography.
Code generated by Fiat Cryptography.
curves/native/p256/fq
Code generated by Fiat Cryptography.
Code generated by Fiat Cryptography.
dkg
frost
Package frost is an implementation of the DKG part of https://eprint.iacr.org/2020/852.pdf
Package frost is an implementation of the DKG part of https://eprint.iacr.org/2020/852.pdf
gennaro
Package gennaro is an implementation of the DKG part of https://eprint.iacr.org/2020/540.pdf
Package gennaro is an implementation of the DKG part of https://eprint.iacr.org/2020/540.pdf
gennaro2p
Package gennaro2p wraps dkg/genarro and specializes it for the 2-party case.
Package gennaro2p wraps dkg/genarro and specializes it for the 2-party case.
The macaroon package implements macaroons as described in the paper "Macaroons: Cookies with Contextual Caveats for Decentralized Authorization in the Cloud" (http://theory.stanford.edu/~ataly/Papers/macaroons.pdf)
The macaroon package implements macaroons as described in the paper "Macaroons: Cookies with Contextual Caveats for Decentralized Authorization in the Cloud" (http://theory.stanford.edu/~ataly/Papers/macaroons.pdf)
ot
base/simplest
Package simplest implements the "Verified Simplest OT", as defined in "protocol 7" of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
Package simplest implements the "Verified Simplest OT", as defined in "protocol 7" of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
extension/kos
Package kos in an implementation of maliciously secure OT extension protocol defined in "Protocol 9" of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
Package kos in an implementation of maliciously secure OT extension protocol defined in "Protocol 9" of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
ottest
Package ottest contains some utilities to test ot functions.
Package ottest contains some utilities to test ot functions.
Package paillier contains Paillier's cryptosystem (1999) [P99].
Package paillier contains Paillier's cryptosystem (1999) [P99].
Package sharing is an implementation of shamir secret sharing and implements the following papers.
Package sharing is an implementation of shamir secret sharing and implements the following papers.
v1
signatures
bbs
Package bbs is an implementation of BBS+ signature of https://eprint.iacr.org/2016/663.pdf
Package bbs is an implementation of BBS+ signature of https://eprint.iacr.org/2016/663.pdf
bls/bls_sig
Package bls_sig is an implementation of the BLS signature defined in https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-03
Package bls_sig is an implementation of the BLS signature defined in https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-03
tecdsa
dklsv1
package dklsv1 provides a wrapper around the [DKLs18](https://eprint.iacr.org/2018/499.pdf) sign and dkg and provides serialization, serialization, and versioning for the serialized data.
package dklsv1 provides a wrapper around the [DKLs18](https://eprint.iacr.org/2018/499.pdf) sign and dkg and provides serialization, serialization, and versioning for the serialized data.
dklsv1/dealer
Package dealer implements key generation via a trusted dealer for the protocol [DKLs18](https://eprint.iacr.org/2018/499.pdf).
Package dealer implements key generation via a trusted dealer for the protocol [DKLs18](https://eprint.iacr.org/2018/499.pdf).
dklsv1/dkg
Package dkg implements the Distributed Key Generation (DKG) protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
Package dkg implements the Distributed Key Generation (DKG) protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
dklsv1/refresh
This file implements the key refresh protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
This file implements the key refresh protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
dklsv1/sign
Package sign implements the 2-2 threshold signature protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
Package sign implements the 2-2 threshold signature protocol of [DKLs18](https://eprint.iacr.org/2018/499.pdf).
Package ted25519 implements the Ed25519 signature algorithm.
Package ted25519 implements the Ed25519 signature algorithm.
frost
Package frost is an implementation of t-of-n threshold signature of https://eprint.iacr.org/2020/852.pdf
Package frost is an implementation of t-of-n threshold signature of https://eprint.iacr.org/2020/852.pdf
zkp
schnorr
Package schnorr implements a Schnorr proof, as described and used in Doerner, et al.
Package schnorr implements a Schnorr proof, as described and used in Doerner, et al.

Jump to

Keyboard shortcuts

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