definition

package
v0.0.0-...-1e6caf6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STH_INIT = "http://ctng.uconn.edu/101"
	REV_INIT = "http://ctng.uconn.edu/102"
	ACC_INIT = "http://ctng.uconn.edu/103"
	CON_INIT = "http://ctng.uconn.edu/104"
	STH_FRAG = "http://ctng.uconn.edu/201"
	REV_FRAG = "http://ctng.uconn.edu/202"
	ACC_FRAG = "http://ctng.uconn.edu/203"
	STH_FULL = "http://ctng.uconn.edu/301"
	REV_FULL = "http://ctng.uconn.edu/302"
	ACC_FULL = "http://ctng.uconn.edu/303"
)

Identifiers for different types of gossip object or PoM counter that can be sent.

View Source
const (
	No_Sig_Match = "Signatures don't match"
	Mislabel     = "Fields mislabeled"
	Invalid_Type = "Invalid Type"
)

Types of errors that can occur when parsing a Gossip_object

View Source
const CTNG_APPLICATION = "CTng"

The only valid application type

Variables

This section is empty.

Functions

func ExtractRootHash

func ExtractRootHash(gossipSTH Gossip_object) ([]byte, error)

func TypeString

func TypeString(t string) string

This function prints the "name string" of each Gossip object type. It's used when printing this info to console.

func Verify_CON

func Verify_CON(g Gossip_object, c *crypto.CryptoConfig) error

func Verify_PayloadFrag

func Verify_PayloadFrag(g Gossip_object, c *crypto.CryptoConfig) error

verifies signature fragments match with payload

func Verify_PayloadThreshold

func Verify_PayloadThreshold(g Gossip_object, c *crypto.CryptoConfig) error

verifies threshold signatures match payload

func Verify_RSAPayload

func Verify_RSAPayload(g Gossip_object, c *crypto.CryptoConfig) error

Verifies RSAsig matches payload, wait.... i think this just works out of the box with what we have

Types

type Gossip_ID

type Gossip_ID struct {
	Period     string `json:"period"`
	Type       string `json:"type"`
	Entity_URL string `json:"entity_URL"`
}

func (Gossip_ID) String

func (g Gossip_ID) String() string

type Gossip_Storage

type Gossip_Storage map[Gossip_ID]Gossip_object

type Gossip_object

type Gossip_object struct {
	Application string    `json:"application"`
	Period      string    `json:"period"`
	Type        string    `json:"type"`
	Signer      string    `json:"signer"`
	Signers     []string  `json:"signers,omitempty"`
	Signature   [2]string `json:"signature"`
	// Timestamp is a UTC RFC3339 string
	Timestamp     string    `json:"timestamp"`
	Crypto_Scheme string    `json:"crypto_scheme"`
	Payload       [3]string `json:"payload,omitempty"`
}

func (Gossip_object) GetID

func (g Gossip_object) GetID() Gossip_ID

func (Gossip_object) GetTargetType

func (g Gossip_object) GetTargetType() string

func (Gossip_object) Verify

func (g Gossip_object) Verify(c *crypto.CryptoConfig) error

Verifies Gossip object based on the type: STH and Revocations use RSA Trusted information Fragments use BLS SigFragments PoMs use Threshold signatures

type Revocation

type Revocation struct {
	Period    string
	Delta_CRV []byte
	SRH       string
}

type STH

type STH struct {
	Signer    string
	Timestamp string
	Period    string
	RootHash  string
	TreeSize  int
}

Jump to

Keyboard shortcuts

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