Revision 73795210a4490f42c2d1be1ef63420f67ca29dc0 authored by Thane Thomson on 21 December 2022, 22:48:02 UTC, committed by GitHub on 21 December 2022, 22:48:02 UTC
* docs: Update upgrading guidelines with new ABCI version

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Fix broken link in upgrading guidelines for ABCI++

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Prepare version in upgrading guidelines

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update UPGRADING.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Sergio Mena <sergio@informal.systems>
1 parent 37cb51c
Raw File
crypto.go
package crypto

import (
	"github.com/tendermint/tendermint/crypto/tmhash"
	"github.com/tendermint/tendermint/libs/bytes"
)

const (
	// AddressSize is the size of a pubkey address.
	AddressSize = tmhash.TruncatedSize
)

// An address is a []byte, but hex-encoded even in JSON.
// []byte leaves us the option to change the address length.
// Use an alias so Unmarshal methods (with ptr receivers) are available too.
type Address = bytes.HexBytes

func AddressHash(bz []byte) Address {
	return Address(tmhash.SumTruncated(bz))
}

type PubKey interface {
	Address() Address
	Bytes() []byte
	VerifySignature(msg []byte, sig []byte) bool
	Equals(PubKey) bool
	Type() string
}

type PrivKey interface {
	Bytes() []byte
	Sign(msg []byte) ([]byte, error)
	PubKey() PubKey
	Equals(PrivKey) bool
	Type() string
}

type Symmetric interface {
	Keygen() []byte
	Encrypt(plaintext []byte, secret []byte) (ciphertext []byte)
	Decrypt(ciphertext []byte, secret []byte) (plaintext []byte, err error)
}
back to top