util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProduceOuterWrap

func ProduceOuterWrap(hashAlg tpm2.HashAlgorithmId, symmetricAlg *tpm2.SymDefObject, name tpm2.Name, seed []byte, useIV bool, data []byte) ([]byte, error)

ProduceOuterWrap adds an outer wrapper to the supplied data. The supplied name is associated with the data.

It encrypts the data using the specified symmetric algorithm and a key derived from the supplied seed and name.

It then prepends an integrity HMAC of the encrypted data and the supplied name using the specified digest algorithm and a key derived from the supplied seed.

func UnwrapOuter

func UnwrapOuter(hashAlg tpm2.HashAlgorithmId, symmetricAlg *tpm2.SymDefObject, name tpm2.Name, seed []byte, useIV bool, data []byte) ([]byte, error)

UnwrapOuter removes an outer wrapper from the supplied sensitive data blob. The supplied name is associated with the data.

It checks the integrity HMAC is valid using the specified digest algorithm and a key derived from the supplied seed and returns an error if the check fails.

It then decrypts the data blob using the specified symmetric algorithm and a key derived from the supplied seed and name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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