despectre

package
v0.0.0-...-aef2c42 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: 0BSD Imports: 7 Imported by: 0

Documentation

Overview

Package despectre creates a list of guarded memory pages filled with random data, and uses their hash to encrypt/decrypt a storage cell.

Index

Constants

View Source
const (

	// KeySize is the exact size of a key to store in a cell.
	KeySize = sha512.Size256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

Cell protects a secret of the size KeySize.

func New

func New(size int) (*Cell, error)

New returns a new Cell using at least size bytes to protect it.

func (*Cell) Free

func (c *Cell) Free()

Free the memory allocated for the cell.

func (*Cell) Store

func (c *Cell) Store(d []byte)

Store the secret d into the Cell. d needs to be KeySize bytes long.

func (*Cell) Update

func (c *Cell) Update() error

Update the cell with new random guard pages.

func (*Cell) With

func (c *Cell) With(f func([KeySize]byte) error) error

With executes f with the decrypted secret as a parameter.

Jump to

Keyboard shortcuts

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