Documentation ¶
Index ¶
- Constants
- func CalculateDigest(pre *protos.PreOrder) (string, error)
- func CheckDigest(pre *protos.PreOrder) error
- func HashToID(hash []byte) types.Identifier
- func IDToByte(id types.Identifier) []byte
- func MakeID(payload []byte) types.Identifier
- func PrivSign(hash types.Hash, nodeID int) (*protos.Certification, error)
- func PubVerify(cert *protos.Certification, hash types.Hash, nodeID int) error
- func SetKeys() error
- func VerifyProofCerts(digest types.Hash, pc *protos.QuorumCert, quorum int) error
- type Hasher
- type PrivateKey
- type PublicKey
- type StaticRand
Constants ¶
View Source
const (
// SHA3256LEN is the length for hash value of sha3 256
SHA3256LEN = 32
)
Variables ¶
This section is empty.
Functions ¶
func CalculateDigest ¶
CalculateDigest is used to calculate the digest
func CheckDigest ¶
CheckDigest is used to check the correctness of digest
func HashToID ¶
func HashToID(hash []byte) types.Identifier
func IDToByte ¶
func IDToByte(id types.Identifier) []byte
func MakeID ¶
func MakeID(payload []byte) types.Identifier
MakeID creates an ID from the hash of encoded data.
func VerifyProofCerts ¶
VerifyProofCerts is used to verify the validation of proof-certs
Types ¶
type Hasher ¶
type Hasher interface { // ComputeHash returns the hash output regardless of the hash state ComputeHash([]byte) types.Hash }
Hasher interface
type PrivateKey ¶
type PrivateKey interface { // Algorithm returns the signing algorithm related to the private key. Algorithm() string // Sign generates a signature using the provided hasher. Sign(types.Hash) (*protos.Certification, error) // PublicKey returns the public key. PublicKey() PublicKey }
PrivateKey is an unspecified signature scheme private key
type PublicKey ¶
type PublicKey interface { // Algorithm returns the signing algorithm related to the public key. Algorithm() string // Verify verifies a signature of an input message using the provided hasher. Verify(*protos.Certification, types.Hash) error }
PublicKey is an unspecified signature scheme public key.
type StaticRand ¶
type StaticRand struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.