Files
mcias/vendor/github.com/google/go-tpm/tpm2/create_salt.go
Kyle Isom 115f23a3ea Add Nix flake for mciasctl and mciasgrpcctl
Vendor dependencies and expose control program binaries via
nix build. Uses nixpkgs-unstable for Go 1.26 support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:01:21 -07:00

15 lines
440 B
Go

package tpm2
import "io"
var (
labelSecret = "SECRET"
)
// CreateEncryptedSalt encrypts a random salt for secure session establishment.
func CreateEncryptedSalt(rand io.Reader, pub LabeledEncapsulationKey) (salt []byte, encSecret []byte, err error) {
// The salt value is directly used from the Labeled Key Encapsulation operation.
// See Part 1, "Salted and Bound Session Key Generation"
return pub.Encapsulate(rand, labelSecret)
}