core

package
v0.0.0-...-c365a6b Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNode

func AddNode(node verify.Node, tx *bolt.Tx) error

AddNode adds a node to the bucket "Nodes" in the database. It assumes that a database transaction has already been started and takes bolt.Tx as an argument.

func CalculateBlockHash

func CalculateBlockHash(block []byte) (string, error)

CalculateBlockHash calculates the sha1 checksum of a byte slice.

func CreateHeader

func CreateHeader(unsignedHash string, signedHash string, diskSize int, tableSize int) ([]byte, error)

CreateHeader creates a header to be used in an fsverify partition containing all necessary information.

func CreateNode

func CreateNode(blockStart int, blockEnd int, block []byte, prevNode *verify.Node, n string) (verify.Node, error)

CreateNode creates a Node based on given parameters. If prevNode is set to nil, meaning this node is the first node in a verification chain, prevNodeHash is set to "EntrypointN" with N being the number of entrypoint.

func ReadBlock

func ReadBlock(start int, end int, device *bytes.Reader) ([]byte, error)

ReadBlock reads the bytes in a specified ranges from a bytes.Reader. It additionally verifies that the amount of bytes read match with the size of the area and fails if the they do not match.

func SignDatabase

func SignDatabase(database string, minisignKeys string) ([]byte, error)

SignDatabase generates a minisign signature of the database using given keys. The minisign signature uses "fsverify" as the comments to ensure predictability when fsverify verifies the signature.

Types

This section is empty.

Jump to

Keyboard shortcuts

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