bccrypto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DEKSize = 32

DEKSize is the number of bytes in a DEK.

View Source
const RefSize = 32 + 32

Variables

This section is empty.

Functions

This section is empty.

Types

type DEK

type DEK [DEKSize]byte

DEK is a Data Encryption Key.

func DeriveKey

func DeriveKey(hf blobcache.HashFunc, entropy *[32]byte, additional []byte) DEK

DeriveKey takes 256 bits of entropy, a hash function, and additional material and returns a 32 byte DEK.

func (*DEK) IsZero

func (dek *DEK) IsZero() bool

func (DEK) MarshalJSON

func (dek DEK) MarshalJSON() ([]byte, error)

func (*DEK) UnmarshalJSON

func (dek *DEK) UnmarshalJSON(data []byte) error

type Machine

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

Machine contains caches and configuration.

func NewMachine

func NewMachine(salt *blobcache.CID, hf blobcache.HashFunc) *Machine

func (*Machine) Get

func (w *Machine) Get(ctx context.Context, s schema.RO, ref Ref, buf []byte) (int, error)

func (*Machine) GetF

func (w *Machine) GetF(ctx context.Context, s schema.RO, ref Ref, fn func([]byte) error) error

func (*Machine) Post

func (w *Machine) Post(ctx context.Context, s schema.WO, data []byte) (Ref, error)

type Ref

type Ref struct {
	CID blobcache.CID
	DEK DEK
}

Ref contains a CID and a DEK.

func (Ref) IsZero

func (r Ref) IsZero() bool

func (Ref) Marshal

func (r Ref) Marshal(out []byte) []byte

func (*Ref) Unmarshal

func (r *Ref) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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