Documentation
¶
Index ¶
- Constants
- Variables
- func DigestTxNamespace(tx *protoblocktx.Tx, nsIndex int) ([]byte, error)
- type BLSVerifier
- type BlindWrite
- type Digest
- type DigestVerifier
- type DummyVerifier
- type EcdsaTxVerifier
- type EdDSAVerifier
- type Namespace
- type NsVerifier
- type PrivateKey
- type PublicKey
- type Read
- type ReadWrite
- type Scheme
- type Signature
- type Tx
Constants ¶
const BlsHashPrefix = "BLS"
BlsHashPrefix is the prefix used to verify a BLS scheme signature.
Variables ¶
var ( // ErrSignatureMismatch is returned when a verifier detect a wrong signature. ErrSignatureMismatch = errors.New("signature mismatch") // AllSchemes all the supported scheme. AllSchemes = []Scheme{ NoScheme, Ecdsa, Bls, Eddsa, } // AllRealSchemes all supported real scheme (excluding NoScheme). AllRealSchemes = []Scheme{ Ecdsa, Bls, Eddsa, } )
Functions ¶
func DigestTxNamespace ¶
func DigestTxNamespace(tx *protoblocktx.Tx, nsIndex int) ([]byte, error)
DigestTxNamespace digests a transactions for a given namespace index.
Types ¶
type BLSVerifier ¶
type BLSVerifier struct {
// contains filtered or unexported fields
}
BLSVerifier verifies using the BLS scheme.
func NewBLSVerifier ¶
func NewBLSVerifier(key []byte) (*BLSVerifier, error)
NewBLSVerifier instantiate a new BLS scheme verifier.
type BlindWrite ¶
BlindWrite is a stab for protoblocktx.Write.
type DigestVerifier ¶
DigestVerifier verifies a digest.
type EcdsaTxVerifier ¶
type EcdsaTxVerifier struct {
// contains filtered or unexported fields
}
EcdsaTxVerifier verifies using the ECDSA scheme.
func NewEcdsaVerifier ¶
func NewEcdsaVerifier(key []byte) (*EcdsaTxVerifier, error)
NewEcdsaVerifier instantiate a new ECDSA scheme verifier.
type EdDSAVerifier ¶
EdDSAVerifier verifies using the EdDSA scheme.
type Namespace ¶
type Namespace struct {
Reads []Read
ReadWrites []ReadWrite
Writes []BlindWrite
}
Namespace is a stab for protoblocktx.TxNamespace.
type NsVerifier ¶
type NsVerifier struct {
DigestVerifier
}
NsVerifier verifies a given namespace.
func NewNsVerifier ¶
func NewNsVerifier(scheme Scheme, key []byte) (*NsVerifier, error)
NewNsVerifier creates a new namespace verifier according to the implementation scheme.
func (*NsVerifier) VerifyNs ¶
func (v *NsVerifier) VerifyNs(tx *protoblocktx.Tx, nsIndex int) error
VerifyNs verifies a transaction's namespace signature.
type ReadWrite ¶
ReadWrite is a stab for protoblocktx.ReadWrite.